]> jfr.im git - erebus.git/commitdiff
Removed unused hostmask parse
authorConny Sjöblom <redacted>
Tue, 4 Feb 2014 22:02:07 +0000 (00:02 +0200)
committerConny Sjöblom <redacted>
Tue, 4 Feb 2014 22:02:07 +0000 (00:02 +0200)
modules/twitch.py
modules/youtube.py

index 466d430769a9fc800d695c4b6e8fe4f0fe598c6a..fdd7b32ea7e5bcf07dcf3dcc8da296ca49d83929 100644 (file)
@@ -22,36 +22,10 @@ import urllib2
 import json
 
 checkfor = "twitch"
-hostmask_regex = re.compile('^(.*)!(.*)@(.*)$')
 url_regex = re.compile('(http|ftp|https):\/\/([\w\-_]+(?:(?:\.[\w\-_]+)+))([\w\-\.,@?^=%&amp;:/~\+#]*[\w\-\@?^=%&amp;/~\+#])?')
-def parser_hostmask(hostmask):
-       if isinstance(hostmask, dict):
-               return hostmask
-
-       nick = None
-       user = None
-       host = None
-
-       if hostmask is not None:
-               match = hostmask_regex.match(hostmask)
-
-               if not match:
-                       nick = hostmask
-               else:
-                       nick = match.group(1)
-                       user = match.group(2)
-                       host = match.group(3)
-
-       return {
-               'nick': nick,
-               'user': user,
-               'host': host
-       }
 
 @lib.hooknum("PRIVMSG")
 def privmsg_hook(bot, line):
-       sender = parser_hostmask(line[1:line.find(' ')])
-
        try:
                linetx = line.split(None, 3)[3][1:]
        except IndexError:
index e1c61a39ce4b3bd1d135f746cfd9562e2a4754ea..cd62f5fd031a4a2f440f7025f1253341356d14f7 100644 (file)
@@ -23,36 +23,10 @@ import HTMLParser
 from BeautifulSoup import BeautifulSoup
 
 checkfor = "youtube"
-hostmask_regex = re.compile('^(.*)!(.*)@(.*)$')
 url_regex = re.compile('http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+')
-def parser_hostmask(hostmask):
-       if isinstance(hostmask, dict):
-               return hostmask
-
-       nick = None
-       user = None
-       host = None
-
-       if hostmask is not None:
-               match = hostmask_regex.match(hostmask)
-
-               if not match:
-                       nick = hostmask
-               else:
-                       nick = match.group(1)
-                       user = match.group(2)
-                       host = match.group(3)
-
-       return {
-               'nick': nick,
-               'user': user,
-               'host': host
-       }
 
 @lib.hooknum("PRIVMSG")
 def privmsg_hook(bot, line):
-       sender = parser_hostmask(line[1:line.find(' ')])
-
        try:
                linetx = line.split(None, 3)[3][1:]
        except IndexError: