Checks that a tool can be invoked by 'command'. If command is not an absolute path, checks if it can be found in 'path'. If comand is absolute path, check that it exists. Returns 'command' if ok and empty string otherwise.
(command)
| 412 | |
| 413 | # ported from trunk@47281 |
| 414 | def check_tool(command): |
| 415 | """ Checks that a tool can be invoked by 'command'. |
| 416 | If command is not an absolute path, checks if it can be found in 'path'. |
| 417 | If comand is absolute path, check that it exists. Returns 'command' |
| 418 | if ok and empty string otherwise. |
| 419 | """ |
| 420 | assert(isinstance(command, list)) |
| 421 | assert(all(isinstance(c, str) for c in command)) |
| 422 | #FIXME: why do we check the first and last elements???? |
| 423 | if check_tool_aux(command[0]) or check_tool_aux(command[-1]): |
| 424 | return command |
| 425 | |
| 426 | # ported from trunk@47281 |
| 427 | def handle_options(tool, condition, command, options): |
no test coverage detected