Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@sugarlabs.org>2009-02-05 11:43:50 (GMT)
committer Tomeu Vizoso <tomeu@sugarlabs.org>2009-02-05 11:43:50 (GMT)
commitace5e73d3d4a7a6b5fe601e0acfd566bf26b6281 (patch)
tree399f666c1527d8a65c2cda3e32e8df86f3658fe3 /src
parentdf247733a2408242fe3ccb274fbfd2d9486afeca (diff)
Don't push to the DS a file path pointing to nowhere #258
Diffstat (limited to 'src')
-rw-r--r--src/sugar/activity/activity.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/sugar/activity/activity.py b/src/sugar/activity/activity.py
index 5f15876..66dcbd1 100644
--- a/src/sugar/activity/activity.py
+++ b/src/sugar/activity/activity.py
@@ -774,14 +774,16 @@ class Activity(Window, gtk.Container):
if preview is not None:
self.metadata['preview'] = dbus.ByteArray(preview)
+ file_path = os.path.join(self.get_activity_root(), 'instance',
+ '%i' % time.time())
try:
- file_path = os.path.join(self.get_activity_root(), 'instance',
- '%i' % time.time())
self.write_file(file_path)
- self._owns_file = True
- self._jobject.file_path = file_path
except NotImplementedError:
logging.debug('Activity.write_file is not implemented.')
+ else:
+ if os.path.exists(file_path):
+ self._owns_file = True
+ self._jobject.file_path = file_path
# Cannot call datastore.write async for creates:
# https://dev.laptop.org/ticket/3071