Process multiline command by running through `textwrap.dedent()`, removes comments (lines starting with `#` or ` #` until end of line), removes entirely blank lines. Returns list of lines.
( command)
| 2690 | # |
| 2691 | |
| 2692 | def _command_lines( command): |
| 2693 | ''' |
| 2694 | Process multiline command by running through `textwrap.dedent()`, removes |
| 2695 | comments (lines starting with `#` or ` #` until end of line), removes |
| 2696 | entirely blank lines. |
| 2697 | |
| 2698 | Returns list of lines. |
| 2699 | ''' |
| 2700 | command = textwrap.dedent( command) |
| 2701 | lines = [] |
| 2702 | for line in command.split( '\n'): |
| 2703 | if line.startswith( '#'): |
| 2704 | h = 0 |
| 2705 | else: |
| 2706 | h = line.find( ' #') |
| 2707 | if h >= 0: |
| 2708 | line = line[:h] |
| 2709 | if line.strip(): |
| 2710 | lines.append(line.rstrip()) |
| 2711 | return lines |
| 2712 | |
| 2713 | |
| 2714 | def cpu_bits(): |