diff options
author | Walter Bender <walter@sugarlabs.org> | 2013-11-02 14:17:08 (GMT) |
---|---|---|
committer | Walter Bender <walter@sugarlabs.org> | 2013-11-02 14:17:08 (GMT) |
commit | 9c63c5b5e3dde3f85f0fe7e0db3ee6434a6429bf (patch) | |
tree | 1598140e7542d741cda3785daca71df0de8c0fee /TurtleArt | |
parent | 7324e6cda8abae54111c5f886c8069812fb040bc (diff) |
more tweaks to python export code
Diffstat (limited to 'TurtleArt')
-rw-r--r-- | TurtleArt/tajail.py | 4 | ||||
-rw-r--r-- | TurtleArt/talogo.py | 8 |
2 files changed, 4 insertions, 8 deletions
diff --git a/TurtleArt/tajail.py b/TurtleArt/tajail.py index 539c126..1a89f1d 100644 --- a/TurtleArt/tajail.py +++ b/TurtleArt/tajail.py @@ -34,7 +34,7 @@ def myfunc(f, args): return userdefined.values()[0](*args) -def myfunc_import(parent, f, x): +def myfunc_import(parent, f, args): ''' Run Python code imported from Journal ''' if 'def myblock(lc,' in f: base_class = parent.tw.lc # pre-v107, we passed lc @@ -43,7 +43,7 @@ def myfunc_import(parent, f, x): userdefined = {} try: exec f in globals(), userdefined - return userdefined['myblock'](base_class, x) + return userdefined['myblock'](base_class, args) except: traceback.print_exc() return None diff --git a/TurtleArt/talogo.py b/TurtleArt/talogo.py index 1ee11f2..82c35b7 100644 --- a/TurtleArt/talogo.py +++ b/TurtleArt/talogo.py @@ -248,7 +248,6 @@ class LogoCode: for b in blocks: b.unhighlight() - ''' # Hidden macro expansions for b in blocks: if b.name in ['while', 'until']: @@ -262,7 +261,6 @@ class LogoCode: blocks = new_blocks[:] if b == blk: blk = action_blk - ''' for b in blocks: if b.name in ('hat', 'hat1', 'hat2'): @@ -882,12 +880,10 @@ class LogoCode: def prim_myblock(self, *args): """ Run Python code imported from Journal """ if self.bindex is not None and self.bindex in self.tw.myblock: - # try: - myfunc_import(self, self.tw.myblock[self.bindex], args) - ''' + try: + myfunc_import(self, self.tw.myblock[self.bindex], args) except: raise logoerror("#syntaxerror") - ''' def prim_myfunction(self, f, *args): """ Programmable block (Call tajail.myfunc and convert any errors to |