From 5c1f3b7daa18da4f1fe6243087cf117e268c43b6 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Thu, 11 Sep 2008 09:00:44 +0200 Subject: [PATCH 1/3] Revert "Avoid access to private member" This reverts commit 0cf0cacbd0a3b661c3139b2fc261a0ff971f4797. --- src/sugar/datastore/datastore.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sugar/datastore/datastore.py b/src/sugar/datastore/datastore.py index d5dca7d9..1917b19f 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, fetch=True): - if fetch and self._file_path is None and not self.object_id is None: + def get_file_path(self): + if 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,7 +249,7 @@ def write(ds_object, update_mtime=True, transfer_ownership=False, properties['mtime'] = datetime.now().isoformat() properties['timestamp'] = int(time.time()) - if ds_object.get_file_path(fetch=False) is None: + if ds_object._file_path is None: file_path = '' else: file_path = ds_object._file_path From 0490247fcb1d79701bbf22b30c3c3c05ccef3f83 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Thu, 11 Sep 2008 09:03:05 +0200 Subject: [PATCH 2/3] Hopefully really avoid access to private member --- src/sugar/datastore/datastore.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/sugar/datastore/datastore.py b/src/sugar/datastore/datastore.py index 1917b19f..81c00e40 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. From e721f74f63334457f31cf9a6e21006fbd00b4db1 Mon Sep 17 00:00:00 2001 From: Simon Schampijer Date: Thu, 11 Sep 2008 10:49:54 +0200 Subject: [PATCH 3/3] Ignore pseudo.po for the manifest --- src/sugar/activity/bundlebuilder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sugar/activity/bundlebuilder.py b/src/sugar/activity/bundlebuilder.py index ec5e90a8..0f99b0f8 100644 --- a/src/sugar/activity/bundlebuilder.py +++ b/src/sugar/activity/bundlebuilder.py @@ -31,7 +31,7 @@ from sugar import env from sugar.bundle.activitybundle import ActivityBundle IGNORE_DIRS = ['dist', '.git'] -IGNORE_FILES = ['.gitignore', 'MANIFEST', '*.pyc', '*~', '*.bak'] +IGNORE_FILES = ['.gitignore', 'MANIFEST', '*.pyc', '*~', '*.bak', 'pseudo.po'] def list_files(base_dir, ignore_dirs=None, ignore_files=None): result = []