Welcome to BMO
find_program(name, hints=[], recursive=False)
where is a given binary
Source code in bmo/common.py
42 43 44 45 46 47 48 49 50 51 52 53 54 |
|
is_windows(cygwin_is_windows=True)
Check if we are running on windows.
Parameters
cygwin_is_windows : (default `True`). When set to `True`, consider cygwin as Windows.
Returns
True
if on Windows, False
otherwise.
Source code in bmo/common.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
|
run_command(cmd, cwd=Path.cwd(), silent=False, stream=True)
Run a given command.
Parameters
str
cmd
Path
Current working directory.
bool
If True
, output is not printed onto console.
bool
If True
the output is printed line by line eagerly (as soon as a line is available)
rather than all at once.
Returns
str
Credits
- https://stackoverflow.com/questions/18421757/live-output-from-subprocess-command
Source code in bmo/common.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
|
search_pat(pat, haystack)
Search for a pattern in haystack.
Source code in bmo/common.py
106 107 108 109 110 |
|
download_and_run_script(script, force=False, download_only=False)
Download a script from https://gitlab.subcom.tech/open/scripts repo and execute it..
Parameters
str
The name or the full URL of the script.
bool
When set to True
, redownload the script even if it exists in the cache.
download_only
When set to True
, only download the script and do not execute it.
Returns
True
on success. False
otherwise.
Source code in bmo/subcom.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
|