Get command line arguments.
()
| 7 | |
| 8 | |
| 9 | def get_commandline_args(): |
| 10 | """Get command line arguments.""" |
| 11 | extra_chars = [ |
| 12 | " ", |
| 13 | ";", |
| 14 | "&", |
| 15 | "(", |
| 16 | ")", |
| 17 | "|", |
| 18 | "^", |
| 19 | "<", |
| 20 | ">", |
| 21 | "?", |
| 22 | "*", |
| 23 | "[", |
| 24 | "]", |
| 25 | "$", |
| 26 | "`", |
| 27 | '"', |
| 28 | "\\", |
| 29 | "!", |
| 30 | "{", |
| 31 | "}", |
| 32 | ] |
| 33 | |
| 34 | # Escape the extra characters for shell |
| 35 | argv = [ |
| 36 | ( |
| 37 | arg.replace("'", "'\\''") |
| 38 | if all(char not in arg for char in extra_chars) |
| 39 | else "'" + arg.replace("'", "'\\''") + "'" |
| 40 | ) |
| 41 | for arg in sys.argv |
| 42 | ] |
| 43 | |
| 44 | return sys.executable + " " + " ".join(argv) |
| 45 | |
| 46 | |
| 47 | def is_scipy_wav_style(value): |
no outgoing calls
no test coverage detected
searching dependent graphs…