From b933633bc6f75861fd45b41140b0d6ccd143145c Mon Sep 17 00:00:00 2001 From: Stephen Watson Date: Mon, 26 Jan 2009 22:59:21 +0000 Subject: [PATCH] Fix problem installing handlers which are zero-install aware (reported by Mark Williams). --- ROX-Lib2/python/rox/mime_handler.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/ROX-Lib2/python/rox/mime_handler.py b/ROX-Lib2/python/rox/mime_handler.py index 2f7a5e1..b29ab76 100644 --- a/ROX-Lib2/python/rox/mime_handler.py +++ b/ROX-Lib2/python/rox/mime_handler.py @@ -219,13 +219,15 @@ class InstallList(rox.Dialog): return uninstall -def _run_by_injector(): +def _run_by_injector(app_dir=None): """Internal function.""" try: from zeroinstall.injector import basedir + if not app_dir: + app_dir=rox.app_dir for d in basedir.xdg_cache_dirs: - if rox.app_dir.find(d)==0: - # Applicaion is in a cache dir + if app_dir.find(d)==0: + # Application is in a cache dir return True elif rox._roxlib_dir.find(d)==0: # ROX-Lib is in a cache dir, we are probably being run by the @@ -357,7 +359,7 @@ def install_send_to_types(types, application=None, injint=None): win.destroy() -def install_from_appinfo(appdir = rox.app_dir, injint=None): +def install_from_appinfo(appdir = rox.app_dir, injint=None, overwrite=True): """Read the AppInfo file from the AppDir and perform the installations indicated. The elements to use are and , each containing a number of elements. @@ -372,8 +374,8 @@ def install_from_appinfo(appdir = rox.app_dir, injint=None): can_run = ainfo.getCanRun() can_thumbnail = ainfo.getCanThumbnail() if can_run or can_thumbnail: - install_run_action(can_run, appdir, injint) - install_thumbnailer(can_thumbnail, appdir, injint) + install_run_action(can_run, appdir, overwrite, injint) + install_thumbnailer(can_thumbnail, appdir, overwrite, injint) install_send_to_types(can_run, appdir, injint) else: raise Exception('Internal error: No actions found in %s. ' -- 2.11.4.GIT