MCPcopy Create free account
hub / github.com/EasyIME/PIME / program_paths

Function program_paths

python/cinbase/tools/cpuinfo.py:197–209  ·  view source on GitHub ↗
(program_name)

Source from the content-addressed store, hash-verified

195
196
197def program_paths(program_name):
198 paths = []
199 exts = filter(None, os.environ.get('PATHEXT', '').split(os.pathsep))
200 path = os.environ['PATH']
201 for p in os.environ['PATH'].split(os.pathsep):
202 p = os.path.join(p, program_name)
203 if os.access(p, os.X_OK):
204 paths.append(p)
205 for e in exts:
206 pext = p + e
207 if os.access(pext, os.X_OK):
208 paths.append(pext)
209 return paths
210
211def _get_field_actual(cant_be_number, raw_string, field_names):
212 for line in raw_string.splitlines():

Callers 8

has_dmesgMethod · 0.85
has_cpufreq_infoMethod · 0.85
has_sestatusMethod · 0.85
has_sysctlMethod · 0.85
has_isainfoMethod · 0.85
has_kstatMethod · 0.85
has_sysinfoMethod · 0.85
has_lscpuMethod · 0.85

Calls 4

splitMethod · 0.80
joinMethod · 0.80
getMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected