aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar jesopo2018-10-02 17:59:33 +0100
committerGravatar jesopo2018-10-02 17:59:33 +0100
commit74180cb10363b4260cfa989930cfce9f6abe662c (patch)
tree9a23b4d3b3f341ff39d2ae36b1e8edd8304bfe84 /src
parentRe-add lost "!" prefix on stderr prefix (diff)
signature
Simplify Utils.seperate_hostmask
Diffstat (limited to 'src')
-rw-r--r--src/Utils.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/Utils.py b/src/Utils.py
index 2f1782bc..9fcf0883 100644
--- a/src/Utils.py
+++ b/src/Utils.py
@@ -53,14 +53,8 @@ class IRCHostmask(object):
def seperate_hostmask(hostmask):
hostmask = remove_colon(hostmask)
- first_delim = hostmask.find("!")
- second_delim = hostmask.find("@")
- nickname, username, hostname = hostmask, None, None
- if first_delim > -1 and second_delim > first_delim:
- nickname, username = hostmask.split("!", 1)
- username, hostname = username.split("@", 1)
- elif second_delim > -1:
- nickname, hostname = hostmask.split("@", 1)
+ nickname, _, username = hostmask.partition("!")
+ username, _, hostname = username.partition("@")
return IRCHostmask(nickname, username, hostname, hostmask)
def get_url(url, **kwargs):