diff options
author | akastornov <akastornov@yandex-team.ru> | 2022-02-10 16:46:03 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:03 +0300 |
commit | 3a2de774d91ca8d7325aaf81c200b1d2047725e6 (patch) | |
tree | 5674a780ce03a8bbd794733a19c7a70d587e4a14 /build/scripts/writer.py | |
parent | 7bd11ff35e97544d119e43447e3e865f2588ee7f (diff) | |
download | ydb-3a2de774d91ca8d7325aaf81c200b1d2047725e6.tar.gz |
Restoring authorship annotation for <akastornov@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'build/scripts/writer.py')
-rw-r--r-- | build/scripts/writer.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/build/scripts/writer.py b/build/scripts/writer.py index 21bb3006e58..7eceef9ccd2 100644 --- a/build/scripts/writer.py +++ b/build/scripts/writer.py @@ -1,10 +1,10 @@ import sys import argparse - + import process_command_files as pcf + - -def parse_args(): +def parse_args(): args = pcf.get_args(sys.argv[1:]) parser = argparse.ArgumentParser() parser.add_argument('-f', '--file', dest='file_path') @@ -15,7 +15,7 @@ def parse_args(): parser.add_argument('-m', '--content-multiple', nargs='*', dest='content') parser.add_argument('-P', '--path-list', action='store_true', default=False) return parser.parse_args(args) - + def smart_shell_quote(v): if v is None: @@ -23,11 +23,11 @@ def smart_shell_quote(v): if ' ' in v or '"' in v or "'" in v: return "\"{0}\"".format(v.replace('"', '\\"')) return v - -if __name__ == '__main__': + +if __name__ == '__main__': args = parse_args() open_type = 'a' if args.append else 'w' - + content = args.content if args.quote: content = [smart_shell_quote(ln) for ln in content] if content is not None else None |