diff options
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | talogo.py | 22 | ||||
-rw-r--r-- | tawindow.py | 28 |
3 files changed, 28 insertions, 24 deletions
@@ -2,6 +2,8 @@ * chmod +x svg factory * added missing import gettext from talogo.py +* renamed xo-man to xo-child +* caught missing attribute when running from outside of Sugar 68 @@ -166,10 +166,11 @@ def setup_cmd(lc, str): def start_eval(lc, list): icall(lc, evline, list); yield True # turn off stop icon when execution is finished - try: - lc.tw.activity.stop.set_icon("stopitoff") - except: - lc.tw.activity.projectToolbar.stop.set_icon("stopitoff") + if hasattr(lc.tw,"activity"): + try: + lc.tw.activity.stop.set_icon("stopitoff") + except: + lc.tw.activity.projectToolbar.stop.set_icon("stopitoff") yield False def evline(lc, list): @@ -947,12 +948,13 @@ def hideblocks(lc): hideshow_button(lc.tw) for i in lc.tw.selbuttons: hide(i) - try: - # Use new toolbar design - lc.tw.activity.do_hide() - except: - # Use old toolbar design - lc.tw.activity.projectToolbar.do_hide() + if hasattr(lc.tw,"activity"): + try: + # Use new toolbar design + lc.tw.activity.do_hide() + except: + # Use old toolbar design + lc.tw.activity.projectToolbar.do_hide() def doevalstep(lc): starttime = millis() diff --git a/tawindow.py b/tawindow.py index 731d8e2..bb6567e 100644 --- a/tawindow.py +++ b/tawindow.py @@ -589,7 +589,7 @@ def keypress_cb(area, event, tw): else: alt_mask = False results = key_press(tw, alt_mask, keyname, keyunicode) - if keyname is not None and \ + if keyname is not None and hasattr(tw,"activity") and \ hasattr(tw.activity, 'chattube') and tw.activity.chattube is not None: # print "key press" if alt_mask: @@ -782,19 +782,19 @@ def xy(event): return map(int, event.get_coords()) def showPopup(block_name,tw): - try: - label = _(block_name) + ": " + hover_dict[block_name] - except: - label = _(block_name) - try: - # Use new toolbar - tw.activity.hover_help_label.set_text(label) - tw.activity.hover_help_label.show() - except: - # Use old toolbar - tw.activity.helpToolbar.hover_help_label.set_text(label) - tw.activity.helpToolbar.hover_help_label.show() - + if hasattr(tw,"activity"): + try: + label = _(block_name) + ": " + hover_dict[block_name] + except: + label = _(block_name) + try: + # Use new toolbar + tw.activity.hover_help_label.set_text(label) + tw.activity.hover_help_label.show() + except: + # Use old toolbar + tw.activity.helpToolbar.hover_help_label.set_text(label) + tw.activity.helpToolbar.hover_help_label.show() """ i = popupHandler.getInvoker(block_name) if i: |