A wrapper around shutil.which() that searches a predictable set of paths and is more verbose about what is happening. See get_path() for more information.
(file, mode=os.F_OK | os.X_OK)
| 247 | |
| 248 | |
| 249 | def which(file, mode=os.F_OK | os.X_OK): |
| 250 | """A wrapper around shutil.which() that searches a predictable set of |
| 251 | paths and is more verbose about what is happening. See get_path() |
| 252 | for more information. |
| 253 | """ |
| 254 | path = get_path() |
| 255 | rv = _which(file, mode, path) |
| 256 | if rv: |
| 257 | debug2("which() found '%s' at %s" % (file, rv)) |
| 258 | else: |
| 259 | debug2("which() could not find '%s' in %s" % (file, path)) |
| 260 | return rv |
| 261 | |
| 262 | |
| 263 | def is_admin_user(): |
no test coverage detected