Remove get_bin_path usage.
This commit is contained in:
parent
d08dcbf054
commit
33ae2dc548
@ -42,12 +42,25 @@ if len(activities) == 0:
|
|||||||
activity = activities[0]
|
activity = activities[0]
|
||||||
cmd_args = activityfactory.get_command(activity)
|
cmd_args = activityfactory.get_command(activity)
|
||||||
|
|
||||||
|
def _which(exec_file):
|
||||||
|
if 'PATH' in os.environ:
|
||||||
|
envpath = os.environ['PATH']
|
||||||
|
else:
|
||||||
|
envpath = defpath
|
||||||
|
|
||||||
|
for path in envpath.split(os.pathsep):
|
||||||
|
fullname = os.path.join(path, exec_file)
|
||||||
|
if os.path.exists(fullname):
|
||||||
|
return fullname
|
||||||
|
|
||||||
|
return None
|
||||||
|
|
||||||
def _get_interpreter(exec_file):
|
def _get_interpreter(exec_file):
|
||||||
if os.path.exists(exec_file):
|
if os.path.exists(exec_file):
|
||||||
abs_path = exec_file
|
abs_path = exec_file
|
||||||
else:
|
else:
|
||||||
abs_path = os.path.join(env.get_bin_path(), exec_file)
|
abs_path = _which(exec_file)
|
||||||
if not os.path.exists(abs_path):
|
if not abs_path:
|
||||||
return exec_file
|
return exec_file
|
||||||
|
|
||||||
f = open(abs_path)
|
f = open(abs_path)
|
||||||
|
@ -80,9 +80,6 @@ def get_user_library_path():
|
|||||||
def get_locale_path(path=None):
|
def get_locale_path(path=None):
|
||||||
return get_prefix_path('share/locale', path)
|
return get_prefix_path('share/locale', path)
|
||||||
|
|
||||||
def get_bin_path(path=None):
|
|
||||||
return get_prefix_path('bin', path)
|
|
||||||
|
|
||||||
def get_service_path(name):
|
def get_service_path(name):
|
||||||
return _get_sugar_path('services', name)
|
return _get_sugar_path('services', name)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user