mod_util.py

changeset 150
2fd1f6ee05f5
parent 148
7e225c2659b8
child 152
1b734faab67a
equal deleted inserted replaced
149:1759c15cd0ca 150:2fd1f6ee05f5
249 url = 'http://eval.appspot.com/eval?statement=' + urllib.quote (args['command']) 249 url = 'http://eval.appspot.com/eval?statement=' + urllib.quote (args['command'])
250 result = utility.read_url (url).splitlines() 250 result = utility.read_url (url).splitlines()
251 251
252 # \x0f is the 'reset colors' code, prepended to all reply lines to prevent other bots from 252 # \x0f is the 'reset colors' code, prepended to all reply lines to prevent other bots from
253 # reacting to this .py call. 253 # reacting to this .py call.
254
255 if result[0] == 'Traceback (most recent call last):': 254 if result[0] == 'Traceback (most recent call last):':
256 reply ('\x0f' + result[-1]) 255 reply ('\x0f' + result[-1])
257 else: 256 else:
258 for line in result: 257 for line in result:
259 reply ('\x0f' + line) 258 reply ('\x0f' + line)

mercurial