|
|
@@ -1,11 +1,31 @@
|
|
|
import sys
|
|
|
import os
|
|
|
import readline
|
|
|
+import subprocess
|
|
|
|
|
|
+def vi():
|
|
|
+ subprocess.call('vi')
|
|
|
+
|
|
|
+possibles = globals().copy()
|
|
|
+possibles.update(locals())
|
|
|
|
|
|
while True:
|
|
|
- test = raw_input('$ ')
|
|
|
+ input_string = raw_input('$ ')
|
|
|
+ method = possibles.get(input_string)
|
|
|
+ if not method:
|
|
|
+ try:
|
|
|
+
|
|
|
+ print subprocess.check_output(input_string)
|
|
|
+ except:
|
|
|
+ print "Method was not implemented, tryed built-in"
|
|
|
+ print 'Exec failed:', input_string
|
|
|
+
|
|
|
+ else:
|
|
|
+ method()
|
|
|
+
|
|
|
try:
|
|
|
- exec(test)
|
|
|
+ pass
|
|
|
+ #exec(test)
|
|
|
+
|
|
|
except:
|
|
|
print 'Execution error'
|