From 2b008b473a606ed34b4a88cd5d7a4618882df844 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Wed, 9 Jan 2019 16:01:53 +0100 Subject: [PATCH] donate-cpu.py: Fix some PEP 8 and other warnings (#1579) There should not be functional changes. Tested locally. --- tools/donate-cpu.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tools/donate-cpu.py b/tools/donate-cpu.py index 6e0f0be65..e763aad5e 100644 --- a/tools/donate-cpu.py +++ b/tools/donate-cpu.py @@ -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!'