summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinson Lee <vlee@vmware.com>2009-08-23 00:32:29 -0700
committerVinson Lee <vlee@vmware.com>2009-08-23 00:32:29 -0700
commit491a658b97bf949600726b620349a302aafa5fe3 (patch)
treeb3f65b3f94b76d2e0a8f28e3e268bc4af04109dc
parent4f9b764c77251e152845513bbaeffc83bf487708 (diff)
Python: Add spaces after commas.
-rw-r--r--framework/core.py20
-rw-r--r--framework/exectest.py2
-rw-r--r--framework/summary.py6
-rwxr-xr-xpiglit-create-summary.py4
-rwxr-xr-xpiglit-run.py4
-rwxr-xr-xpiglit-summary-html.py12
6 files changed, 24 insertions, 24 deletions
diff --git a/framework/core.py b/framework/core.py
index 8e1631f72..ff6a9248d 100644
--- a/framework/core.py
+++ b/framework/core.py
@@ -103,10 +103,10 @@ class TestResult(dict):
'dict': dict.__repr__(self)
}
- def allTestResults(self,name):
+ def allTestResults(self, name):
return {name: self}
- def write(self,file,path):
+ def write(self, file, path):
print >>file, "@test: " + encode(path)
for k in self:
v = self[k]
@@ -142,7 +142,7 @@ class GroupResult(dict):
def allTestResults(self, groupName):
collection = {}
- for name,sub in self.items():
+ for name, sub in self.items():
subfullname = name
if len(groupName) > 0:
subfullname = groupName + '/' + subfullname
@@ -150,7 +150,7 @@ class GroupResult(dict):
return collection
def write(self, file, groupName):
- for name,sub in self.items():
+ for name, sub in self.items():
subfullname = name
if len(groupName) > 0:
subfullname = groupName + '/' + subfullname
@@ -237,7 +237,7 @@ class TestrunResult:
stack[-1](line[0:-1])
linenr = linenr + 1
- def parseDir(self,path,PreferSummary):
+ def parseDir(self, path, PreferSummary):
main = None
filelist = [path + '/main', path + '/summary']
if PreferSummary:
@@ -264,10 +264,10 @@ class Environment:
self.execute = True
self.filter = []
- def run(self,command):
+ def run(self, command):
p = subprocess.Popen(
command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- (stdout,stderr) = p.communicate();
+ (stdout, stderr) = p.communicate();
return stderr+stdout
def collectData(self):
@@ -316,7 +316,7 @@ class Test:
print " result: %(result)s" % { 'result': result['result'] }
- result.write(env.file,path)
+ result.write(env.file, path)
if Test.sleep:
time.sleep(Test.sleep)
else:
@@ -382,12 +382,12 @@ def loadTestProfile(filename):
traceback.print_exc()
raise Exception('Could not read tests profile')
-def loadTestResults(path,PreferSummary=False):
+def loadTestResults(path, PreferSummary=False):
try:
mode = os.stat(path)[stat.ST_MODE]
testrun = TestrunResult()
if stat.S_ISDIR(mode):
- testrun.parseDir(path,PreferSummary)
+ testrun.parseDir(path, PreferSummary)
else:
file = open(path, 'r')
testrun.parseFile(file)
diff --git a/framework/exectest.py b/framework/exectest.py
index 8d6a3bcca..d1c9d62f8 100644
--- a/framework/exectest.py
+++ b/framework/exectest.py
@@ -44,7 +44,7 @@ class PlainExecTest(Test):
stderr=subprocess.PIPE,
universal_newlines=True
)
- out,err = proc.communicate()
+ out, err = proc.communicate()
outlines = out.split('\n')
outpiglit = map(lambda s: s[7:], filter(lambda s: s.startswith('PIGLIT:'), outlines))
diff --git a/framework/summary.py b/framework/summary.py
index 18bfc8b33..08dd13b62 100644
--- a/framework/summary.py
+++ b/framework/summary.py
@@ -28,13 +28,13 @@ import core
##### Vector indicating the number of subtests that have passed/failed/etc.
#############################################################################
class PassVector:
- def __init__(self,p,w,f,s):
+ def __init__(self, p, w, f, s):
self.passnr = p
self.warnnr = w
self.failnr = f
self.skipnr = s
- def add(self,o):
+ def add(self, o):
self.passnr += o.passnr
self.warnnr += o.warnnr
self.failnr += o.failnr
@@ -106,7 +106,7 @@ results is an array of GroupResult instances, one per testrun
# Perform some initial annotations
for j in range(len(self.results)):
result = self.results[j]
- result.passvector = PassVector(0,0,0,0)
+ result.passvector = PassVector(0, 0, 0, 0)
result.testrun = self.summary.testruns[j]
# Collect, create and annotate children
diff --git a/piglit-create-summary.py b/piglit-create-summary.py
index 882c20c45..914d09eed 100755
--- a/piglit-create-summary.py
+++ b/piglit-create-summary.py
@@ -55,7 +55,7 @@ def main():
OptionName = ''
- for name,value in options:
+ for name, value in options:
if name in ('-h', '--help'):
usage()
@@ -65,7 +65,7 @@ def main():
resultsFilename = args[0]
results = core.loadTestResults(resultsFilename)
- for testname,result in results.allTestResults().items():
+ for testname, result in results.allTestResults().items():
if 'info' in result:
if len(result['info']) > 4096:
result['info'] = result['info'][0:4096]
diff --git a/piglit-run.py b/piglit-run.py
index 17ac388dc..20f7c3a2c 100755
--- a/piglit-run.py
+++ b/piglit-run.py
@@ -68,7 +68,7 @@ def main():
OptionName = ''
- for name,value in options:
+ for name, value in options:
if name in ('-h', '--help'):
usage()
elif name in ('-d', '--dry-run'):
@@ -95,7 +95,7 @@ def main():
print "Writing summary file..."
results = core.loadTestResults(resultsDir)
- for testname,result in results.allTestResults().items():
+ for testname, result in results.allTestResults().items():
if 'info' in result:
if len(result['info']) > 4096:
result['info'] = result['info'][0:4096]
diff --git a/piglit-summary-html.py b/piglit-summary-html.py
index be55642d1..35e49e04e 100755
--- a/piglit-summary-html.py
+++ b/piglit-summary-html.py
@@ -99,13 +99,13 @@ def buildDetails(testResult):
continue
value = buildDetailValue(testResult[name])
- details += [(name,value)]
+ details += [(name, value)]
- details.sort(lambda a,b: len(a[1])-len(b[1]))
+ details.sort(lambda a, b: len(a[1])-len(b[1]))
text = ''
alternate = 'a'
- for name,value in details:
+ for name, value in details:
text += ResultDetail % locals()
if alternate == 'a':
@@ -265,7 +265,7 @@ def parse_listfile(filename):
file.close()
return eval(code)
-def loadresult(descr,OptionPreferSummary):
+def loadresult(descr, OptionPreferSummary):
result = core.loadTestResults(descr[0], OptionPreferSummary)
if len(descr) > 1:
result.__dict__.update(descr[1])
@@ -280,7 +280,7 @@ def main():
OptionOverwrite = False
OptionPreferSummary = True
OptionList = []
- for name,value in options:
+ for name, value in options:
if name == "-h" or name == "--help":
usage()
elif name == "-o" or name == "--overwrite":
@@ -298,7 +298,7 @@ def main():
summaryDir = args[0]
core.checkDir(summaryDir, not OptionOverwrite)
- results = [loadresult(descr,OptionPreferSummary) for descr in OptionList]
+ results = [loadresult(descr, OptionPreferSummary) for descr in OptionList]
summary = framework.summary.Summary(results)
for j in range(len(summary.testruns)):