PEP8 fixes.

This commit is contained in:
XhmikosR 2014-02-20 11:03:55 +02:00
parent 94454df14f
commit aabee422e0
2 changed files with 10 additions and 6 deletions

View File

@ -17,6 +17,8 @@ def wget(url):
return '' return ''
# Perform a git pull. # Perform a git pull.
def gitpull(): def gitpull():
try: try:
subprocess.call(['git', 'pull']) subprocess.call(['git', 'pull'])

View File

@ -29,7 +29,7 @@ def upload(file_to_upload, destination):
password = sys.argv[1] password = sys.argv[1]
child = pexpect.spawn( child = pexpect.spawn(
'scp ' + file_to_upload + ' danielmarjamaki,cppcheck@web.sourceforge.net:' + destination) 'scp ' + file_to_upload + ' danielmarjamaki,cppcheck@web.sourceforge.net:' + destination)
#child.expect( # child.expect(
# 'danielmarjamaki,cppcheck@web.sourceforge.net\'s password:') # 'danielmarjamaki,cppcheck@web.sourceforge.net\'s password:')
child.expect('Password:') child.expect('Password:')
child.sendline(password) child.sendline(password)
@ -131,26 +131,28 @@ def daca2report():
subprocess.call(['python', 'tools/daca2-report.py', 'daca2-report']) subprocess.call(['python', 'tools/daca2-report.py', 'daca2-report'])
upload('-r daca2-report', 'htdocs/devinfo/') upload('-r daca2-report', 'htdocs/devinfo/')
def daca2folder(): def daca2folder():
oldresults = glob.glob(os.path.expanduser('~/daca2/*/results.txt')) oldresults = glob.glob(os.path.expanduser('~/daca2/*/results.txt'))
oldestfolder = None oldestfolder = None
oldestdate = None oldestdate = None
for old in oldresults: for old in oldresults:
f = open(old,'rt') f = open(old, 'rt')
filedata = f.read() filedata = f.read()
f.close() f.close()
pos = filedata.find('STARTDATE') pos = filedata.find('STARTDATE')
if pos < 0: if pos < 0:
pos = old.find('/daca2/') pos = old.find('/daca2/')
return old[pos+7:old.find('/',pos+8)] return old[pos + 7:old.find('/', pos + 8)]
startdate = filedata[pos+10:pos+20] startdate = filedata[pos + 10:pos + 20]
if not oldestdate or oldestdate > startdate: if not oldestdate or oldestdate > startdate:
oldestdate = startdate oldestdate = startdate
pos = old.find('/daca2/') pos = old.find('/daca2/')
oldestfolder = old[pos+7:old.find('/',pos+8)] oldestfolder = old[pos + 7:old.find('/', pos + 8)]
return oldestfolder return oldestfolder
def daca2(): def daca2():
folder = daca2folder() folder = daca2folder()
print('Daca2 folder=' + folder) print('Daca2 folder=' + folder)
@ -164,7 +166,7 @@ def daca2():
subprocess.call( subprocess.call(
['make', 'clean']) ['make', 'clean'])
subprocess.call( subprocess.call(
['nice', 'make', 'SRCDIR=build', 'CFGDIR='+os.path.expanduser('~/cppcheck/cfg'), 'CXXFLAGS=-O2', 'CPPFLAGS=-DMAXTIME=600']) ['nice', 'make', 'SRCDIR=build', 'CFGDIR=' + os.path.expanduser('~/cppcheck/cfg'), 'CXXFLAGS=-O2', 'CPPFLAGS=-DMAXTIME=600'])
subprocess.call( subprocess.call(
['mv', 'cppcheck', os.path.expanduser('~/daca2/cppcheck-O2')]) ['mv', 'cppcheck', os.path.expanduser('~/daca2/cppcheck-O2')])