From 76d1c7256181ef2dc1cd052f93310e2910d81179 Mon Sep 17 00:00:00 2001 From: Simon Schampijer Date: Wed, 17 Oct 2007 21:38:50 +0000 Subject: Fix the case where no activity can be associated with the downloaded file. --- (limited to 'downloadmanager.py') 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)) -- cgit v0.9.1