diff options
author | Walter Bender <walter@sugarlabs.org> | 2013-12-11 15:16:15 (GMT) |
---|---|---|
committer | Walter Bender <walter@sugarlabs.org> | 2013-12-11 15:16:15 (GMT) |
commit | 68cb5b448753040aa49889e1fae9a09239a6acf2 (patch) | |
tree | ff4d8390a14198d7e0499ba34a8469783488e6a4 /plugins/turtle_blocks_extras | |
parent | 7675249cff03e9c52a1dc58f46da761ebfee85b5 (diff) |
set default to journal when loading heap in Sugar
Diffstat (limited to 'plugins/turtle_blocks_extras')
-rw-r--r-- | plugins/turtle_blocks_extras/turtle_blocks_extras.py | 30 |
1 files changed, 24 insertions, 6 deletions
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)], |