Added basic implementation for Python code evaluation

This commit is contained in:
2019-11-07 17:18:07 +01:00
parent b818c992ec
commit 448ebc696a
18 changed files with 501 additions and 156 deletions
+8 -4
View File
@@ -28,6 +28,8 @@ def sysarg_to_string(argv):
result += '"' + s + '"' if " " in s else s
first = False
if result[0] in ('"', "'"):
result = result[1:-1] # strip quotes
return result
@@ -53,15 +55,17 @@ def main(argv):
if o in ('-d', "--debug"):
debug = True
init_logging(debug)
sheerka = Sheerka()
# init_logging(debug)
sheerka = Sheerka(debug=debug)
sheerka.initialize()
_in = sysarg_to_string(args)
result = sheerka.eval(_in)
logging.info(result)
return result[-1].status
for res in result:
logging.info(res)
return result[-1].status if len(result) > 0 else 1
except getopt.GetoptError:
usage()
sys.exit(2)