Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--TurtleArt/taconstants.py6
-rw-r--r--plugins/turtle_blocks_extras/turtle_blocks_extras.py30
2 files changed, 30 insertions, 6 deletions
diff --git a/TurtleArt/taconstants.py b/TurtleArt/taconstants.py
index 75288c1..81f15f0 100644
--- a/TurtleArt/taconstants.py
+++ b/TurtleArt/taconstants.py
@@ -544,4 +544,10 @@ MACROS = {
[25, 'description', 0, 0, [24, None]]],
'reskin':
[[0, 'skin', 0, 0, [None, 1, None]],
+ [1, 'journal', 0, 0, [0, None]]],
+ 'saveheaptojournal':
+ [[0, 'saveheap', 0, 0, [None, 1, None]],
+ [1, 'journal', 0, 0, [0, None]]],
+ 'loadheapfromjournal':
+ [[0, 'loadheap', 0, 0, [None, 1, None]],
[1, 'journal', 0, 0, [0, None]]]}
diff --git a/plugins/turtle_blocks_extras/turtle_blocks_extras.py b/plugins/turtle_blocks_extras/turtle_blocks_extras.py
index 2bb07dd..ec4558f 100644
--- a/plugins/turtle_blocks_extras/turtle_blocks_extras.py
+++ b/plugins/turtle_blocks_extras/turtle_blocks_extras.py
@@ -541,17 +541,35 @@ make "tmp first :taheap\nmake "taheap butfirst :taheap\noutput :tmp\nend\n')
prim_name='saveheap',
help_string=_('saves FILO (first-in \
last-out heap) to a file'))
+
self.tw.lc.def_prim('saveheap', 1,
Primitive(self.tw.lc.save_heap,
arg_descs=[ArgSlot(TYPE_OBJECT)]))
- palette.add_block('loadheap',
- style='basic-style-1arg',
- label=_('load heap from file'),
- default=_('filename'),
- prim_name='loadheap',
- help_string=_('loads FILO (first-in \
+ if self.tw.running_sugar:
+ palette.add_block('loadheap',
+ style='basic-style-1arg',
+ hidden=True,
+ label=_('load heap from file'),
+ default=_('filename'),
+ prim_name='loadheap',
+ help_string=_('loads FILO (first-in \
last-out heap) from a file'))
+ # macro
+ palette.add_block('loadheapfromjournal',
+ style='basic-style-1arg',
+ label=_('load heap from file'),
+ help_string=_('loads FILO (first-in \
+last-out heap) from a file'))
+ else:
+ palette.add_block('loadheap',
+ style='basic-style-1arg',
+ label=_('load heap from file'),
+ default=_('filename'),
+ prim_name='loadheap',
+ help_string=_('loads FILO (first-in \
+last-out heap) from a file'))
+
self.tw.lc.def_prim('loadheap', 1,
Primitive(self.tw.lc.load_heap,
arg_descs=[ArgSlot(TYPE_OBJECT)],