Fix unicode problem, PV detection...
This commit is contained in:
parent
f34ee31036
commit
fa4922d5aa
@ -55,6 +55,9 @@ def parsemsg(msg):
|
|||||||
msgpart = complete[1]
|
msgpart = complete[1]
|
||||||
sender = info[0].split('!')
|
sender = info[0].split('!')
|
||||||
|
|
||||||
|
if len(msgpart) <= 0:
|
||||||
|
return
|
||||||
|
|
||||||
if CHANLIST.find(info[2]) != -1 and re.match(".*(norme|coding style).*", msgpart) is not None and re.match(".*(please|give|obtenir|now|plz|stp|svp|s'il (te|vous) pla.t|check).*", msgpart) is not None:
|
if CHANLIST.find(info[2]) != -1 and re.match(".*(norme|coding style).*", msgpart) is not None and re.match(".*(please|give|obtenir|now|plz|stp|svp|s'il (te|vous) pla.t|check).*", msgpart) is not None:
|
||||||
norme.launch (s, sender, msgpart)
|
norme.launch (s, sender, msgpart)
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ def speak(endstate):
|
|||||||
force = 1
|
force = 1
|
||||||
|
|
||||||
if force or msg[0] != lastmsg[0]:
|
if force or msg[0] != lastmsg[0]:
|
||||||
if msg[0] == NICK:
|
if msg[0] == OWNER:
|
||||||
sentence += "En message privé. "
|
sentence += "En message privé. "
|
||||||
else:
|
else:
|
||||||
sentence += "Sur " + msg[0] + ". "
|
sentence += "Sur " + msg[0] + ". "
|
||||||
@ -75,7 +75,7 @@ def speak(endstate):
|
|||||||
msg[3] = msg[3].replace("ACTION ", "")
|
msg[3] = msg[3].replace("ACTION ", "")
|
||||||
action = 1
|
action = 1
|
||||||
for (txt, mood) in SMILEY:
|
for (txt, mood) in SMILEY:
|
||||||
if msg[3].find(txt) >= 1:
|
if msg[3].find(txt) >= 0:
|
||||||
sentence += msg[1] + (" %s : "%mood)
|
sentence += msg[1] + (" %s : "%mood)
|
||||||
msg[3] = msg[3].replace(txt, "")
|
msg[3] = msg[3].replace(txt, "")
|
||||||
action = 1
|
action = 1
|
||||||
@ -173,7 +173,7 @@ def parsemsg (msg, CHANLIST):
|
|||||||
else:
|
else:
|
||||||
print cmd[1] + " not in listened channels"
|
print cmd[1] + " not in listened channels"
|
||||||
|
|
||||||
elif sender[0] != OWNER and (len(CHANLIST) == 0 or CHANLIST.count(info[2]) > 0 or info[2] == NICK):
|
elif sender[0] != OWNER and (len(CHANLIST) == 0 or CHANLIST.count(info[2]) > 0 or info[2] == OWNER):
|
||||||
g_queue.append([info[2], sender[0], datetime.now(), msgpart])
|
g_queue.append([info[2], sender[0], datetime.now(), msgpart])
|
||||||
if talkEC == 0:
|
if talkEC == 0:
|
||||||
thread.start_new_thread(speak, (0,))
|
thread.start_new_thread(speak, (0,))
|
||||||
@ -212,7 +212,7 @@ class Server:
|
|||||||
line = line.rstrip() #remove trailing 'rn'
|
line = line.rstrip() #remove trailing 'rn'
|
||||||
|
|
||||||
if line.find('PRIVMSG') != -1: #Call a parsing function
|
if line.find('PRIVMSG') != -1: #Call a parsing function
|
||||||
parsemsg(line, self.channels)
|
parsemsg(unicode(line, encoding='utf-8'), self.channels)
|
||||||
|
|
||||||
line = line.split()
|
line = line.split()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user