Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArt
diff options
context:
space:
mode:
authorWalter Bender <walter@sugarlabs.org>2013-10-30 17:24:11 (GMT)
committer Walter Bender <walter@sugarlabs.org>2013-10-30 17:24:11 (GMT)
commit955cbca83a84b0c1ea06f8c33dfec8dd0f850ed1 (patch)
treeb35c003c4250652885887bfa8e554ce84b2b8696 /TurtleArt
parent32444889db2d7573426b3e93722a566b36385bc3 (diff)
comvert custom blocks to new prim style -- args is passed as a tuple
Diffstat (limited to 'TurtleArt')
-rw-r--r--TurtleArt/talogo.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/TurtleArt/talogo.py b/TurtleArt/talogo.py
index 8a64f7b..b645e73 100644
--- a/TurtleArt/talogo.py
+++ b/TurtleArt/talogo.py
@@ -39,7 +39,7 @@ import traceback
from tablock import (Block, Media, media_blocks_dictionary)
from taconstants import (TAB_LAYER, DEFAULT_SCALE, ICON_SIZE)
-from tajail import myfunc
+from tajail import (myfunc, myfunc_import)
from tapalette import (block_names, value_blocks)
from tatype import (TATypeError, TYPES_NUMERIC)
from tautils import (get_pixbuf_from_journal, data_from_file, get_stack_name,
@@ -832,6 +832,16 @@ class LogoCode:
while self.heap:
self.heap.pop()
+ 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)
+ '''
+ except:
+ raise logoerror("#syntaxerror")
+ '''
+
def prim_myfunction(self, f, *args):
""" Programmable block (Call tajail.myfunc and convert any errors to
logoerrors) """