From 9c63c5b5e3dde3f85f0fe7e0db3ee6434a6429bf Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Sat, 02 Nov 2013 14:17:08 +0000 Subject: more tweaks to python export code --- diff --git a/NEWS b/NEWS index 1b374d1..90a68da 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,7 @@ ENHANCEMENTS: * Add Marian Zepf's export Python +* Add busy cursor while project is loading from store * New translations 192 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 diff --git a/plugins/audio_sensors/audio_sensors.py b/plugins/audio_sensors/audio_sensors.py index 1e0ed01..adc951f 100644 --- a/plugins/audio_sensors/audio_sensors.py +++ b/plugins/audio_sensors/audio_sensors.py @@ -59,6 +59,7 @@ class Audio_sensors(Plugin): def __init__(self, parent): Plugin.__init__(self) self._parent = parent + self.audio_started = False self._status = True # TODO: test for audio device # These flags are referenced by audiograb self.hw = self._parent.hw @@ -211,7 +212,6 @@ class Audio_sensors(Plugin): self._parent.lc.def_prim( 'voltage2', 0, lambda self: primitive_dictionary['voltage'](1)) - self.audio_started = False if self.hw in [XO175, XO30, XO4]: self.PARAMETERS = { SENSOR_AC_BIAS: (False, True, 80, True), -- cgit v0.9.1