From 1bd1b6c81e6a8352f5552fb70da40d21768485be Mon Sep 17 00:00:00 2001 From: C. Scott Ananian Date: Thu, 14 Aug 2008 06:49:45 +0000 Subject: Trac #7733: fix severe performance regression when creating ActivityBundle. --- (limited to 'src/sugar/bundle/activitybundle.py') diff --git a/src/sugar/bundle/activitybundle.py b/src/sugar/bundle/activitybundle.py index 5f29a69..be997cc 100644 --- a/src/sugar/bundle/activitybundle.py +++ b/src/sugar/bundle/activitybundle.py @@ -205,13 +205,13 @@ class ActivityBundle(Bundle): def get_locale_path(self): """Get the locale path inside the (installed) activity bundle.""" - if not self._unpacked: + if self._zip_file is not None: raise NotInstalledException return os.path.join(self._path, 'locale') def get_icons_path(self): """Get the icons path inside the (installed) activity bundle.""" - if not self._unpacked: + if self._zip_file is not None: raise NotInstalledException return os.path.join(self._path, 'icons') @@ -237,7 +237,7 @@ class ActivityBundle(Bundle): def get_icon(self): """Get the activity icon name""" icon_path = os.path.join('activity', self._icon + '.svg') - if self._unpacked: + if self._zip_file is None: return os.path.join(self._path, icon_path) else: icon_data = self.get_file(icon_path).read() @@ -365,7 +365,7 @@ class ActivityBundle(Bundle): raise RegistrationException def uninstall(self, force=False): - if self._unpacked: + if self._zip_file is None: install_path = self._path else: if not self.is_installed(): -- cgit v0.9.1