diff options
author | Nick Brassel <[email protected]> | 2025-02-28 09:23:04 +1100 |
---|---|---|
committer | Nick Brassel <[email protected]> | 2025-02-28 09:23:04 +1100 |
commit | a63fd7f01cdabd9ce85bb09ae2b573fd3b8e60aa (patch) | |
tree | 35d817580e5244d62a150a2d012f72906a610977 /lib/python/qmk/commands.py | |
parent | 6d0e5728aa61b442885d48caf49d29e5c60e8197 (diff) | |
parent | cdb865cf60b17593f5c811c24a21d7b3030d8653 (diff) | |
download | qmk_firmware-a63fd7f01cdabd9ce85bb09ae2b573fd3b8e60aa.tar.gz qmk_firmware-a63fd7f01cdabd9ce85bb09ae2b573fd3b8e60aa.zip |
Merge remote-tracking branch 'upstream/develop'0.28.0
Diffstat (limited to 'lib/python/qmk/commands.py')
-rw-r--r-- | lib/python/qmk/commands.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/python/qmk/commands.py b/lib/python/qmk/commands.py index a05b3641b5..0e1876ca7a 100644 --- a/lib/python/qmk/commands.py +++ b/lib/python/qmk/commands.py @@ -98,11 +98,14 @@ def in_virtualenv(): return active_prefix != sys.prefix -def dump_lines(output_file, lines, quiet=True): +def dump_lines(output_file, lines, quiet=True, remove_repeated_newlines=False): """Handle dumping to stdout or file Creates parent folders if required """ generated = '\n'.join(lines) + '\n' + if remove_repeated_newlines: + while '\n\n\n' in generated: + generated = generated.replace('\n\n\n', '\n\n') if output_file and output_file.name != '-': output_file.parent.mkdir(parents=True, exist_ok=True) if output_file.exists(): |