diff options
author | Tomeu Vizoso <tomeu@tomeuvizoso.net> | 2007-06-15 14:48:53 (GMT) |
---|---|---|
committer | Tomeu Vizoso <tomeu@tomeuvizoso.net> | 2007-06-15 14:48:53 (GMT) |
commit | 6c0885b490b79662245f51628201a83e7ae70067 (patch) | |
tree | b6163aa9aeac916f800a8f7cdda93f080c92e045 | |
parent | cb9dd212e989d531621aeaa5b08b9e982fbb4f5d (diff) |
Check type of bundle path by os.path.isdir().
-rw-r--r-- | sugar/activity/bundle.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sugar/activity/bundle.py b/sugar/activity/bundle.py index 70954f9..e4f09d3 100644 --- a/sugar/activity/bundle.py +++ b/sugar/activity/bundle.py @@ -80,8 +80,7 @@ class Bundle: def _get_info_file(self): info_file = None - ext = os.path.splitext(self._path)[1] - if ext == '.activity': + if os.path.isdir(self._path): info_path = os.path.join(self._path, 'activity', 'activity.info') if os.path.isfile(info_path): info_file = open(info_path) @@ -158,8 +157,7 @@ class Bundle: linfo_file = None lang = locale.getdefaultlocale()[0] - ext = os.path.splitext(self._path)[1] - if ext == '.activity': + if os.path.isdir(self._path): linfo_path = os.path.join(self.get_locale_path(), lang, 'activity.linfo') if not os.path.isfile(linfo_path): linfo_path = os.path.join(self.get_locale_path(), lang[:2], 'activity.linfo') @@ -205,8 +203,7 @@ class Bundle: def get_icon(self): """Get the activity icon name""" - ext = os.path.splitext(self._path)[1] - if ext == '.activity': + if os.path.isdir(self._path): activity_path = os.path.join(self._path, 'activity') return os.path.join(activity_path, self._icon + '.svg') else: |