aboutsummaryrefslogtreecommitdiffstats
path: root/build/scripts/mkdocs_builder_wrapper.py
diff options
context:
space:
mode:
authorsnermolaev <snermolaev@yandex-team.ru>2022-02-10 16:45:53 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:53 +0300
commit7353a3fdea9c67c256980c00a2b3b67f09b23a27 (patch)
tree1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /build/scripts/mkdocs_builder_wrapper.py
parent2015790ac9fcc04caab83fccc23ab2460310a797 (diff)
downloadydb-7353a3fdea9c67c256980c00a2b3b67f09b23a27.tar.gz
Restoring authorship annotation for <snermolaev@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'build/scripts/mkdocs_builder_wrapper.py')
-rw-r--r--build/scripts/mkdocs_builder_wrapper.py70
1 files changed, 35 insertions, 35 deletions
diff --git a/build/scripts/mkdocs_builder_wrapper.py b/build/scripts/mkdocs_builder_wrapper.py
index 74e0690044..7e10dfac07 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()