diff options
author | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-10-29 20:03:28 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-10-29 20:03:28 (GMT) |
commit | b44dac10102f1ebe5615ee60130f3c8338d9ad81 (patch) | |
tree | 741ce767e70d31c8351a56849d47b6d06622c3ae | |
parent | 9a0401e0d082b40e564bb1d911c51385b73101ac (diff) |
Don't crash if bundles dir doesn't exist in the profiles
-rw-r--r-- | sugar/activity/bundleregistry.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sugar/activity/bundleregistry.py b/sugar/activity/bundleregistry.py index 4acf6dd..804a514 100644 --- a/sugar/activity/bundleregistry.py +++ b/sugar/activity/bundleregistry.py @@ -25,10 +25,12 @@ class BundleRegistry: return self._bundles.values().__iter__() def _scan_directory(self, path): - for f in os.listdir(path): - bundle_dir = os.path.join(path, f) - if os.path.isdir(bundle_dir) and bundle_dir.endswith('.activity'): - self._add_bundle(bundle_dir) + if os.path.isdir(path): + for f in os.listdir(path): + bundle_dir = os.path.join(path, f) + if os.path.isdir(bundle_dir) and \ + bundle_dir.endswith('.activity'): + self._add_bundle(bundle_dir) def _add_bundle(self, bundle_dir): info_path = os.path.join(bundle_dir, 'activity.info') |