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/tared_protoc.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/tared_protoc.py')
-rw-r--r-- | build/scripts/tared_protoc.py | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/build/scripts/tared_protoc.py b/build/scripts/tared_protoc.py index 7643e1dbfe4..3207b54b1d0 100644 --- a/build/scripts/tared_protoc.py +++ b/build/scripts/tared_protoc.py @@ -1,31 +1,31 @@ -import os -import optparse -import tarfile -import contextlib -import subprocess as sp - - -def parse_args(): - parser = optparse.OptionParser() - parser.disable_interspersed_args() - parser.add_option('--tar-output') - parser.add_option('--protoc-out-dir') - return parser.parse_args() - - -def main(): - opts, args = parse_args() - assert opts.tar_output - assert opts.protoc_out_dir - - if not os.path.exists(opts.protoc_out_dir): - os.makedirs(opts.protoc_out_dir) - - sp.check_call(args) - - with contextlib.closing(tarfile.open(opts.tar_output, 'w')) as tf: - tf.add(opts.protoc_out_dir, arcname='') - - -if __name__ == '__main__': - main() +import os +import optparse +import tarfile +import contextlib +import subprocess as sp + + +def parse_args(): + parser = optparse.OptionParser() + parser.disable_interspersed_args() + parser.add_option('--tar-output') + parser.add_option('--protoc-out-dir') + return parser.parse_args() + + +def main(): + opts, args = parse_args() + assert opts.tar_output + assert opts.protoc_out_dir + + if not os.path.exists(opts.protoc_out_dir): + os.makedirs(opts.protoc_out_dir) + + sp.check_call(args) + + with contextlib.closing(tarfile.open(opts.tar_output, 'w')) as tf: + tf.add(opts.protoc_out_dir, arcname='') + + +if __name__ == '__main__': + main() |