Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWalter Bender <walter.bender@gmail.com>2013-01-25 15:51:55 (GMT)
committer Walter Bender <walter.bender@gmail.com>2013-01-25 15:51:55 (GMT)
commitcda3843fc5f21f167d200f17aa35828c1fefad14 (patch)
tree747848f10eeb00bd6508f03c26200e9a76eba50a
parentca5dc291c0b7c3c98101d0feb5c9d5a0f7683972 (diff)
move action out of chooser block so we can set clock cursor while project loads
-rw-r--r--TurtleArt/tautils.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/TurtleArt/tautils.py b/TurtleArt/tautils.py
index 6da36cc..30bf986 100644
--- a/TurtleArt/tautils.py
+++ b/TurtleArt/tautils.py
@@ -226,15 +226,17 @@ def chooser(parent_window, filter, action):
chooser = ObjectChooser(None, parent_window,
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT)
if chooser is not None:
+ dsobject = None
try:
result = chooser.run()
if result == gtk.RESPONSE_ACCEPT:
dsobject = chooser.get_selected_object()
- action(dsobject)
- dsobject.destroy()
finally:
chooser.destroy()
del chooser
+ if dsobject is not None:
+ action(dsobject)
+ dsobject.destroy()
def data_from_file(ta_file):
@@ -266,6 +268,7 @@ def data_from_string(text):
print 'type error (%s) in data_from_string' % (type(text))
return None
+
def data_to_file(data, ta_file):
''' Write data to a file. '''
file_handle = file(ta_file, 'w')