From edf6d4698bfbfac0c202480c2f3d89102a7d95ce Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Fri, 22 Mar 2013 01:47:57 +0000 Subject: clean up --- diff --git a/TurtleArt/tautils.py b/TurtleArt/tautils.py index 45128e0..0bad48a 100644 --- a/TurtleArt/tautils.py +++ b/TurtleArt/tautils.py @@ -1,5 +1,6 @@ -#copyright (c) 2007-8, Playful Invention Company. +#copyright (c) 2007-8, Playful Invention Company #Copyright (c) 2008-13, Walter Bender +#Copyright (c) 2013 Alan Aguiar #Permission is hereby granted, free of charge, to any person obtaining a copy #of this software and associated documentation files (the "Software"), to deal @@ -805,11 +806,11 @@ def power_manager_off(status): except gconf.GError: pass - bus = dbus.SystemBus() + _bus = dbus.SystemBus() try: - proxy = bus.get_object(OHM_SERVICE_NAME, OHM_SERVICE_PATH) - self._keystore = dbus.Interface(proxy, OHM_SERVICE_IFACE) - self._keystore.SetKey('suspend.automatic_pm', bool(VALUE)) + _proxy = _bus.get_object(OHM_SERVICE_NAME, OHM_SERVICE_PATH) + _keystore = dbus.Interface(_proxy, OHM_SERVICE_IFACE) + _keystore.SetKey('suspend.automatic_pm', bool(VALUE)) except dbus.exceptions.DBusException: if status: try: diff --git a/TurtleArt/tawindow.py b/TurtleArt/tawindow.py index ebc1e3d..8d2c664 100644 --- a/TurtleArt/tawindow.py +++ b/TurtleArt/tawindow.py @@ -317,11 +317,8 @@ class TurtleArtWindow(): # Add the icon dir to the icon_theme search path self._add_plugin_icon_dir(os.path.join(self._get_plugin_home(), plugin_dir)) - except ImportError as e: - debug_output('Failed to import %s: %s' % (plugin_class, str(e)), - self.running_sugar) - except: - debug_output('Failed to load %s' % (plugin_class), + except Exception as e: + debug_output('Failed to load %s: %s' % (plugin_class, str(e)), self.running_sugar) def _add_plugin_icon_dir(self, dirname): @@ -2769,7 +2766,8 @@ may not terminate.', False) self.running_blocks = True self._start_plugins() # Let the plugins know we are running. top = find_top_block(blk) - self.lc.run_blocks(top, self.just_blocks(), True) + code = self.lc.generate_code(top, self.just_blocks()) + self.lc.run_blocks(code) if self.interactive_mode: gobject.idle_add(self.lc.doevalstep) else: @@ -3984,7 +3982,7 @@ may not terminate.', False) filename = name + suffix datapath = get_path(self.activity, 'instance') elif len(name) == 0: - name = 'ta' + name = 'turtleblocks' + suffix if self.save_folder is not None: self.load_save_folder = self.save_folder filename, self.load_save_folder = get_save_name( -- cgit v0.9.1