diff options
author | kakabba <kakabba@yandex-team.ru> | 2022-02-10 16:46:04 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:04 +0300 |
commit | c8e3995898c443e78266f7420aac5fb3da15d413 (patch) | |
tree | a530e068cc107e227deccc80722204db63a4d75d /build/plugins/_unpickler.py | |
parent | 110a978b66fe6c0916572df51cfead2a9b647174 (diff) | |
download | ydb-c8e3995898c443e78266f7420aac5fb3da15d413.tar.gz |
Restoring authorship annotation for <kakabba@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'build/plugins/_unpickler.py')
-rw-r--r-- | build/plugins/_unpickler.py | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/build/plugins/_unpickler.py b/build/plugins/_unpickler.py index e01e7b3118..9e6249c2f7 100644 --- a/build/plugins/_unpickler.py +++ b/build/plugins/_unpickler.py @@ -2,41 +2,41 @@ import sys sys.dont_write_bytecode = True -import argparse -import base64 +import argparse +import base64 try: import cPickle as pickle except Exception: import pickle - + import _common as common - - -def main(): - parser = argparse.ArgumentParser() - parser.add_argument('--data', help='pickled object of TCustomCommand class', required=True) - parser.add_argument('--src-root', help='$S real path', required=True) - parser.add_argument('--build-root', help='$B real path', required=True) - parser.add_argument('--tools', help='binaries needed by command', required=True, nargs='+') + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument('--data', help='pickled object of TCustomCommand class', required=True) + parser.add_argument('--src-root', help='$S real path', required=True) + parser.add_argument('--build-root', help='$B real path', required=True) + parser.add_argument('--tools', help='binaries needed by command', required=True, nargs='+') args, unknown_args = parser.parse_known_args() - - encoded_cmd = args.data - src_root = args.src_root - build_root = args.build_root - tools = args.tools - - assert (int(tools[0]) == len(tools[1:])), "tools quantity != tools number!" - + + encoded_cmd = args.data + src_root = args.src_root + build_root = args.build_root + tools = args.tools + + assert (int(tools[0]) == len(tools[1:])), "tools quantity != tools number!" + cmd_object = pickle.loads(base64.b64decode(encoded_cmd)) - - cmd_object.set_source_root(src_root) - cmd_object.set_build_root(build_root) - - if len(tools[1:]) == 0: + + cmd_object.set_source_root(src_root) + cmd_object.set_build_root(build_root) + + if len(tools[1:]) == 0: cmd_object.run(unknown_args, common.get_interpreter_path()) - else: + else: cmd_object.run(unknown_args, *tools[1:]) - - -if __name__ == '__main__': - main() + + +if __name__ == '__main__': + main() |