1
0
mirror of http://aero2k.de/t/repos/urlbot-native.git synced 2017-09-06 15:25:38 +02:00

get_reply_data: split on anything, remove strip(\n)

This commit is contained in:
urlbot
2014-10-29 13:47:26 +01:00
parent d571926fd5
commit 65681bcc61

View File

@@ -18,14 +18,14 @@ plugins['command'] = []
def get_reply_data(data, field=0): def get_reply_data(data, field=0):
# FIXME: we can't determine if a user named 'foo> ' just wrote ' > bar' # FIXME: we can't determine if a user named 'foo> ' just wrote ' > bar'
# or a user 'foo' just wrote '> > bar' # or a user 'foo' just wrote '> > bar'
f = data.split(' ') f = data.split()
if 0 == field: if 0 == field:
return f[0].strip('<>') return f[0].strip('<>')
else: else:
if field > len(f): if field > len(f):
return None return None
return f[field].strip('\n') return f[field]
def register_event(t, callback, args): def register_event(t, callback, args):
joblist.append((t, callback, args)) joblist.append((t, callback, args))