diff options
author | snermolaev <snermolaev@yandex-team.ru> | 2022-02-10 16:45:53 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:53 +0300 |
commit | 2015790ac9fcc04caab83fccc23ab2460310a797 (patch) | |
tree | e644e9bc3f6f688561a871793b59bf8a637e0f72 /build/scripts/mkdocs_builder_wrapper.py | |
parent | c768a99151e47c3a4bb7b92c514d256abd301c4d (diff) | |
download | ydb-2015790ac9fcc04caab83fccc23ab2460310a797.tar.gz |
Restoring authorship annotation for <snermolaev@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'build/scripts/mkdocs_builder_wrapper.py')
-rw-r--r-- | build/scripts/mkdocs_builder_wrapper.py | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/build/scripts/mkdocs_builder_wrapper.py b/build/scripts/mkdocs_builder_wrapper.py index 7e10dfac07..74e0690044 100644 --- a/build/scripts/mkdocs_builder_wrapper.py +++ b/build/scripts/mkdocs_builder_wrapper.py @@ -1,35 +1,35 @@ -import os -import subprocess -import sys - - -def main(): - cmd = [] - build_root = sys.argv[1] - length = len(build_root) - is_dep = False - for arg in sys.argv[2:]: - if is_dep: - is_dep = False - if not arg.endswith('.tar.gz'): - continue - basename = os.path.basename(arg) - assert arg.startswith(build_root) and len(arg) > length + len(basename) and arg[length] in ('/', '\\') - cmd.extend(['--dep', '{}:{}:{}'.format(build_root, os.path.dirname(arg[length+1:]), basename)]) - elif arg == '--dep': - is_dep = True - else: - cmd.append(arg) - assert not is_dep - p = subprocess.Popen(cmd, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - out, err = p.communicate() - if p.returncode: - if out: - sys.stderr.write('stdout:\n{}\n'.format(out)) - if err: - sys.stderr.write('stderr:\n{}\n'.format(err)) - sys.exit(p.returncode) - - -if __name__ == '__main__': - main() +import os +import subprocess +import sys + + +def main(): + cmd = [] + build_root = sys.argv[1] + length = len(build_root) + is_dep = False + for arg in sys.argv[2:]: + if is_dep: + is_dep = False + if not arg.endswith('.tar.gz'): + continue + basename = os.path.basename(arg) + assert arg.startswith(build_root) and len(arg) > length + len(basename) and arg[length] in ('/', '\\') + cmd.extend(['--dep', '{}:{}:{}'.format(build_root, os.path.dirname(arg[length+1:]), basename)]) + elif arg == '--dep': + is_dep = True + else: + cmd.append(arg) + assert not is_dep + p = subprocess.Popen(cmd, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + out, err = p.communicate() + if p.returncode: + if out: + sys.stderr.write('stdout:\n{}\n'.format(out)) + if err: + sys.stderr.write('stderr:\n{}\n'.format(err)) + sys.exit(p.returncode) + + +if __name__ == '__main__': + main() |