MCPcopy Index your code
hub / github.com/pyload/pyload / which

Function which

module/plugins/internal/misc.py:740–754  ·  view source on GitHub ↗

Works exactly like the unix command which Courtesy of http://stackoverflow.com/a/377028/675646

(filename)

Source from the content-addressed store, hash-verified

738
739
740def which(filename):
741 """
742 Works exactly like the unix command which
743 Courtesy of http://stackoverflow.com/a/377028/675646
744 """
745 dirname, basename = os.path.split(filename)
746
747 if dirname:
748 return filename if isexecutable(filename) else None
749
750 else:
751 for path in os.environ['PATH'].split(os.pathsep):
752 filename = os.path.join(path.strip('"'), filename)
753 if isexecutable(filename):
754 return filename
755
756
757def format_exc(frame=None):

Callers 1

findMethod · 0.85

Calls 3

isexecutableFunction · 0.85
splitMethod · 0.80
joinMethod · 0.80

Tested by

no test coverage detected