Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Schampijer <simon@schampijer.de>2007-10-17 21:38:50 (GMT)
committer Simon Schampijer <simon@schampijer.de>2007-10-17 21:38:50 (GMT)
commit76d1c7256181ef2dc1cd052f93310e2910d81179 (patch)
tree29ac1326f5032c187e06399878ac274ae4e070c5
parente5bc61dbeb1a522e1564875192da7028836a3208 (diff)
Fix the case where no activity can be associated with the downloaded file.
-rw-r--r--downloadmanager.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/downloadmanager.py b/downloadmanager.py
index ebba6a2..e0d39db 100644
--- a/downloadmanager.py
+++ b/downloadmanager.py
@@ -183,13 +183,11 @@ class Download:
logging.debug('Start application with downloaded object')
from sugar.activity import activityfactory
from sugar import activity
- activities_info = activity.get_registry().get_activities_for_type(
+ activities = activity.get_registry().get_activities_for_type(
self._mime_type)
- activities = []
bundle_id = None
- for activity_info in activities_info:
- activities.append(activity_info)
- bundle_id = activities[0].bundle_id
+ if len(activities):
+ bundle_id = activities[0].bundle_id
if bundle_id is not None:
logging.debug('--> Found activity to open mime=%s bundle_id=%s'
%(self._mime_type, bundle_id))