summaryrefslogtreecommitdiffstats
path: root/build/scripts/extract_jacoco_report.py
diff options
context:
space:
mode:
authorheretic <[email protected]>2022-02-10 16:45:43 +0300
committerDaniil Cherednik <[email protected]>2022-02-10 16:45:43 +0300
commit397cbe258b9e064f49c4ca575279f02f39fef76e (patch)
treea0b0eb3cca6a14e4e8ea715393637672fa651284 /build/scripts/extract_jacoco_report.py
parent43f5a35593ebc9f6bcea619bb170394ea7ae468e (diff)
Restoring authorship annotation for <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'build/scripts/extract_jacoco_report.py')
-rw-r--r--build/scripts/extract_jacoco_report.py58
1 files changed, 29 insertions, 29 deletions
diff --git a/build/scripts/extract_jacoco_report.py b/build/scripts/extract_jacoco_report.py
index 02e4ba9f13a..07c5cae13ca 100644
--- a/build/scripts/extract_jacoco_report.py
+++ b/build/scripts/extract_jacoco_report.py
@@ -1,29 +1,29 @@
-import argparse
-import os
-import re
-import tarfile
-
-
-if __name__ == '__main__':
- parser = argparse.ArgumentParser()
-
- parser.add_argument('--archive', action='store')
- parser.add_argument('--source-re', action='store')
- parser.add_argument('--destination', action='store')
-
- args = parser.parse_args()
-
- with tarfile.open(args.archive) as tf:
- open(args.destination, 'wb').close()
- extract_list = []
- matcher = re.compile(args.source_re)
- temp_dir = os.path.join(os.path.dirname(args.destination), 'temp_profiles')
- if not os.path.exists(temp_dir):
- os.makedirs(temp_dir)
- for f in [i for i in tf if matcher.match(i.name)]:
- tf.extract(f, path=temp_dir)
- for directory, _, srcs in os.walk(temp_dir):
- for f in srcs:
- with open(args.destination, 'ab') as dst:
- with open(os.path.join(temp_dir, directory, f), 'rb') as src:
- dst.write(src.read())
+import argparse
+import os
+import re
+import tarfile
+
+
+if __name__ == '__main__':
+ parser = argparse.ArgumentParser()
+
+ parser.add_argument('--archive', action='store')
+ parser.add_argument('--source-re', action='store')
+ parser.add_argument('--destination', action='store')
+
+ args = parser.parse_args()
+
+ with tarfile.open(args.archive) as tf:
+ open(args.destination, 'wb').close()
+ extract_list = []
+ matcher = re.compile(args.source_re)
+ temp_dir = os.path.join(os.path.dirname(args.destination), 'temp_profiles')
+ if not os.path.exists(temp_dir):
+ os.makedirs(temp_dir)
+ for f in [i for i in tf if matcher.match(i.name)]:
+ tf.extract(f, path=temp_dir)
+ for directory, _, srcs in os.walk(temp_dir):
+ for f in srcs:
+ with open(args.destination, 'ab') as dst:
+ with open(os.path.join(temp_dir, directory, f), 'rb') as src:
+ dst.write(src.read())