donate-cpu.py: Fix some PEP 8 and other warnings (#1579)

There should not be functional changes.
Tested locally.
This commit is contained in:
Sebastian 2019-01-09 16:01:53 +01:00 committed by GitHub
parent 126bd2bb5d
commit 2b008b473a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 4 deletions

View File

@ -29,6 +29,7 @@ import time
import re
import tarfile
def checkRequirements():
result = True
for app in ['g++', 'git', 'make', 'wget']:
@ -39,6 +40,7 @@ def checkRequirements():
result = False
return result
def getCppcheck(cppcheckPath):
print('Get Cppcheck..')
for i in range(5):
@ -115,7 +117,6 @@ def getPackage(server_address):
return package.decode('utf-8')
def handleRemoveReadonly(func, path, exc):
import stat
if not os.access(path, os.W_OK):
@ -260,6 +261,7 @@ def splitResults(results):
ret.append(w.strip())
return ret
def diffResults(workPath, ver1, results1, ver2, results2):
print('Diff results..')
ret = ''
@ -312,6 +314,7 @@ def uploadResults(package, results, server_address):
pass
return False
jobs = '-j1'
stopTime = None
workpath = os.path.expanduser('~/cppcheck-donate-cpu-workfolder')
@ -373,10 +376,10 @@ while True:
sys.exit(1)
for ver in cppcheckVersions:
if ver == 'head':
if compile(cppcheckPath, jobs) == False:
if not compile(cppcheckPath, jobs):
print('Failed to compile Cppcheck, retry later')
sys.exit(1)
elif compile_version(workpath, jobs, ver) == False:
elif not compile_version(workpath, jobs, ver):
print('Failed to compile Cppcheck-{}, retry later'.format(ver))
sys.exit(1)
if packageUrl:
@ -398,7 +401,7 @@ while True:
cppcheck = 'cppcheck/cppcheck'
else:
cppcheck = ver + '/cppcheck'
c,errout,t = scanPackage(workpath, cppcheck, jobs)
c, errout, t = scanPackage(workpath, cppcheck, jobs)
if c < 0:
crash = True
count += ' Crash!'