summaryrefslogtreecommitdiff
path: root/buildscripts/aggregate_tracefiles.py
diff options
context:
space:
mode:
authorJonathan Abrahams <jonathan@mongodb.com>2018-03-26 11:25:04 -0400
committerJonathan Abrahams <jonathan@mongodb.com>2018-03-26 13:04:25 -0400
commit36148ad8bbdb94162b2926f4700d935ee4dc5994 (patch)
tree1d893c4ca0b0afa407f7724c7942dfbf643560af /buildscripts/aggregate_tracefiles.py
parentd62d631f0ca40c5199fdfae2980080ca0cc982b5 (diff)
downloadmongo-36148ad8bbdb94162b2926f4700d935ee4dc5994.tar.gz
SERVER-23312 Format Python files with yapf
Diffstat (limited to 'buildscripts/aggregate_tracefiles.py')
-rw-r--r--buildscripts/aggregate_tracefiles.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/buildscripts/aggregate_tracefiles.py b/buildscripts/aggregate_tracefiles.py
index 8f1db7851c9..8ff46194ebc 100644
--- a/buildscripts/aggregate_tracefiles.py
+++ b/buildscripts/aggregate_tracefiles.py
@@ -2,11 +2,12 @@ import subprocess
import os
import sys
from optparse import OptionParser
-
""" This script aggregates several tracefiles into one tracefile
All but the last argument are input tracefiles or .txt files which list tracefiles.
The last argument is the tracefile to which the output will be written
"""
+
+
def aggregate(inputs, output):
"""Aggregates the tracefiles given in inputs to a tracefile given by output"""
args = ['lcov']
@@ -17,18 +18,20 @@ def aggregate(inputs, output):
args += ['-o', output]
print ' '.join(args)
-
- return subprocess.call(args)
+
+ return subprocess.call(args)
+
def getfilesize(path):
if not os.path.isfile(path):
return 0
return os.path.getsize(path)
-def main ():
+
+def main():
inputs = []
- usage = "usage: %prog input1.info input2.info ... output.info"
+ usage = "usage: %prog input1.info input2.info ... output.info"
parser = OptionParser(usage=usage)
(options, args) = parser.parse_args()
@@ -43,12 +46,12 @@ def main ():
inputs.append(path)
elif ext == '.txt':
- inputs += [line.strip() for line in open(path)
- if getfilesize(line.strip()) > 0]
+ inputs += [line.strip() for line in open(path) if getfilesize(line.strip()) > 0]
else:
return "unrecognized file type"
return aggregate(inputs, args[-1])
+
if __name__ == '__main__':
sys.exit(main())