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@tomeuvizoso.net>2008-09-11 07:03:05 (GMT)
committer Tomeu Vizoso <tomeu@tomeuvizoso.net>2008-09-11 07:03:05 (GMT)
commit0490247fcb1d79701bbf22b30c3c3c05ccef3f83 (patch)
treeb2098308a3693390503f1af8bf0179dcce2a7811 /src
parent5c1f3b7daa18da4f1fe6243087cf117e268c43b6 (diff)
Hopefully really avoid access to private member
Diffstat (limited to 'src')
-rw-r--r--src/sugar/datastore/datastore.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/sugar/datastore/datastore.py b/src/sugar/datastore/datastore.py
index 1917b19..81c00e4 100644
--- a/src/sugar/datastore/datastore.py
+++ b/src/sugar/datastore/datastore.py
@@ -100,8 +100,8 @@ class DSObject(object):
metadata = property(get_metadata, set_metadata)
- def get_file_path(self):
- if self._file_path is None and not self.object_id is None:
+ def get_file_path(self, fetch=True):
+ if fetch and self._file_path is None and not self.object_id is None:
self.set_file_path(dbus_helpers.get_filename(self.object_id))
self._owns_file = True
return self._file_path
@@ -249,10 +249,9 @@ def write(ds_object, update_mtime=True, transfer_ownership=False,
properties['mtime'] = datetime.now().isoformat()
properties['timestamp'] = int(time.time())
- if ds_object._file_path is None:
+ file_path = ds_object.get_file_path(fetch=False)
+ if file_path is None:
file_path = ''
- else:
- file_path = ds_object._file_path
# FIXME: this func will be sync for creates regardless of the handlers
# supplied. This is very bad API, need to decide what to do here.