eval function
authorvunhat_minh <vunhat_minh@dwango.co.jp>
Fri, 27 Jun 2014 07:45:04 +0000 (16:45 +0900)
committervunhat_minh <vunhat_minh@dwango.co.jp>
Fri, 27 Jun 2014 07:45:04 +0000 (16:45 +0900)
rainbowstream/rainbow.py

index 77621a7..d98d1e0 100644 (file)
@@ -1086,6 +1086,10 @@ def reset():
     if g['reset']:
         printNicely(magenta('Need tips ? Type "h" and hit Enter key!'))
     g['reset'] = False
+    try:
+        print eval(g['cmd'])
+    except:
+        pass
 
 
 def process(cmd):
@@ -1180,6 +1184,7 @@ def listen():
             cmd = line.split()[0]
         except:
             cmd = ''
+        g['cmd'] = cmd
         # Save cmd to global variable and call process
         try:
             g['stuff'] = ' '.join(line.split()[1:])