donate-cpu.py: Fix some PEP 8 and other warnings (#1579)
There should not be functional changes. Tested locally.
This commit is contained in:
parent
126bd2bb5d
commit
2b008b473a
|
@ -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!'
|
||||
|
|
Loading…
Reference in New Issue