Don't push to the DS a file path pointing to nowhere #258
This commit is contained in:
parent
df247733a2
commit
ace5e73d3d
@ -774,14 +774,16 @@ class Activity(Window, gtk.Container):
|
|||||||
if preview is not None:
|
if preview is not None:
|
||||||
self.metadata['preview'] = dbus.ByteArray(preview)
|
self.metadata['preview'] = dbus.ByteArray(preview)
|
||||||
|
|
||||||
|
file_path = os.path.join(self.get_activity_root(), 'instance',
|
||||||
|
'%i' % time.time())
|
||||||
try:
|
try:
|
||||||
file_path = os.path.join(self.get_activity_root(), 'instance',
|
|
||||||
'%i' % time.time())
|
|
||||||
self.write_file(file_path)
|
self.write_file(file_path)
|
||||||
self._owns_file = True
|
|
||||||
self._jobject.file_path = file_path
|
|
||||||
except NotImplementedError:
|
except NotImplementedError:
|
||||||
logging.debug('Activity.write_file is not implemented.')
|
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:
|
# Cannot call datastore.write async for creates:
|
||||||
# https://dev.laptop.org/ticket/3071
|
# https://dev.laptop.org/ticket/3071
|
||||||
|
Loading…
Reference in New Issue
Block a user