From a07a8baa47dec137af6a9c2c75c8ce687e3b5fe5 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Sun, 28 Dec 2003 14:17:13 +0000 Subject: [PATCH] Prefer a local version to rox to a zero-install version. git-svn-id: https://rox.svn.sourceforge.net/svnroot/rox/trunk/ROX-Lib2@3275 66de3db3-b00d-0410-b41b-f4738ad19bea --- python/rox/filer.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/python/rox/filer.py b/python/rox/filer.py index 20867c3..ee9fac9 100644 --- a/python/rox/filer.py +++ b/python/rox/filer.py @@ -28,9 +28,15 @@ def spawn_rox(args): """Run rox (either from PATH or through Zero Install) with the given arguments.""" import os.path + for dir in os.environ.get('PATH', '').split(':'): + path = os.path.join(dir, 'rox') + if os.path.isfile(path): + _spawn(('rox',) + args) + return if os.path.exists('/uri/0install/rox.sourceforge.net'): _spawn(('/bin/0run', 'rox.sourceforge.net/rox 2002-01-01') + args) else: + print "Didn't find rox in PATH, and Zero Install not present. Trying 'rox' anyway..." _spawn(('rox',) + args) def open_dir(dir): -- 2.11.4.GIT