rename util.find_exe to findexe

This commit is contained in:
Adrian Buehlmann 2011-05-08 20:35:46 +02:00
parent 511ac574fb
commit 4163cf2e6f
8 changed files with 10 additions and 10 deletions

View File

@ -29,7 +29,7 @@ class MissingTool(Exception):
def checktool(exe, name=None, abort=True):
name = name or exe
if not util.find_exe(exe):
if not util.findexe(exe):
exc = abort and util.Abort or MissingTool
raise exc(_('cannot find required "%s" tool') % name)

View File

@ -36,10 +36,10 @@ class gnuarch_source(converter_source, commandline):
# Could use checktool, but we want to check for baz or tla.
self.execmd = None
if util.find_exe('baz'):
if util.findexe('baz'):
self.execmd = 'baz'
else:
if util.find_exe('tla'):
if util.findexe('tla'):
self.execmd = 'tla'
else:
raise util.Abort(_('cannot find a GNU Arch tool'))

View File

@ -1648,7 +1648,7 @@ def debuginstall(ui):
# editor
ui.status(_("Checking commit editor...\n"))
editor = ui.geteditor()
cmdpath = util.find_exe(editor) or util.find_exe(editor.split()[0])
cmdpath = util.findexe(editor) or util.findexe(editor.split()[0])
if not cmdpath:
if editor == 'vi':
ui.write(_(" No commit editor set and can't find vi in PATH\n"))

View File

@ -31,10 +31,10 @@ def _findtool(ui, tool):
continue
p = util.lookupreg(k, _toolstr(ui, tool, "regname"))
if p:
p = util.find_exe(p + _toolstr(ui, tool, "regappend"))
p = util.findexe(p + _toolstr(ui, tool, "regappend"))
if p:
return p
return util.find_exe(_toolstr(ui, tool, "executable", tool))
return util.findexe(_toolstr(ui, tool, "executable", tool))
def _picktool(repo, ui, path, binary, symlink):
def check(tool, pat, symlink, binary):

View File

@ -112,7 +112,7 @@ def validateconfig(ui):
raise util.Abort(_('smtp specified as email transport, '
'but no smtp host configured'))
else:
if not util.find_exe(method):
if not util.findexe(method):
raise util.Abort(_('%r specified as email transport, '
'but not in PATH') % method)

View File

@ -221,7 +221,7 @@ def isowner(st):
"""Return True if the stat object st is from the current user."""
return st.st_uid == os.getuid()
def find_exe(command):
def findexe(command):
'''Find executable for command searching like which does.
If command is a basename then PATH is searched for command.
PATH isn't searched if command is an absolute or relative path.

View File

@ -319,7 +319,7 @@ def hgexecutable():
elif mainfrozen():
_sethgexecutable(sys.executable)
else:
exe = find_exe('hg') or os.path.basename(sys.argv[0])
exe = findexe('hg') or os.path.basename(sys.argv[0])
_sethgexecutable(exe)
return _hgexecutable

View File

@ -163,7 +163,7 @@ def explainexit(code):
def isowner(st):
return True
def find_exe(command):
def findexe(command):
'''Find executable for command searching like cmd.exe does.
If command is a basename then PATH is searched for command.
PATH isn't searched if command is an absolute or relative path.