]>
Commit | Line | Data |
---|---|---|
28d7d32f JR |
1 | # module info |
2 | modinfo = { | |
3 | 'author': 'John Runyon (DimeCadmium)', | |
4 | 'license': 'public domain', | |
5 | 'compatible': [1], | |
6 | 'depends': [], | |
7 | } | |
8 | ||
d1ea05b0 JR |
9 | # preamble |
10 | import modlib | |
11 | lib = modlib.modlib(__name__) | |
12 | modstart = lib.modstart | |
13 | modstop = lib.modstop | |
14 | ||
28d7d32f | 15 | # module code |
d1ea05b0 JR |
16 | import sys |
17 | ||
18 | ||
19 | @lib.hook('eval') | |
20 | def cmd_eval(bot, user, chan, *args): | |
21 | try: ret = eval(' '.join(args)) | |
22 | except: bot.msg(chan, "Error (%s): %s" % (sys.exc_info()[0], sys.exc_info()[1])) | |
23 | else: bot.msg(chan, "Done: %r" % (ret)) | |
24 | ||
25 | ||
26 | @lib.hook('exec') | |
27 | def cmd_exec(bot, user, chan, *args): | |
28 | try: exec ' '.join(args) | |
29 | except: bot.msg(chan, "Error: %s %s" % (sys.exc_info()[0], sys.exc_info()[1])) | |
30 | else: bot.msg(chan, "Done.") |