rundaca: do not read password from command line argument
This commit is contained in:
parent
1b933f4dd1
commit
750ba1a4c1
|
@ -6,17 +6,6 @@ import os
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
START = 0
|
|
||||||
PASSWORD = ''
|
|
||||||
for arg in sys.argv[1:]:
|
|
||||||
if len(arg) == 1:
|
|
||||||
START = '0123456789abcdefghijklmnopqrstuvwxyz'.find(arg)
|
|
||||||
if START < 0:
|
|
||||||
START = 0
|
|
||||||
else:
|
|
||||||
PASSWORD = arg
|
|
||||||
|
|
||||||
|
|
||||||
def compilecppcheck(CPPFLAGS):
|
def compilecppcheck(CPPFLAGS):
|
||||||
subprocess.call(['nice', 'make', 'clean'])
|
subprocess.call(['nice', 'make', 'clean'])
|
||||||
subprocess.call(['nice', 'make', 'SRCDIR=build', 'CFGDIR=' +
|
subprocess.call(['nice', 'make', 'SRCDIR=build', 'CFGDIR=' +
|
||||||
|
@ -38,8 +27,8 @@ def daca2report(reportfolder):
|
||||||
|
|
||||||
|
|
||||||
# Upload file to sourceforge server using scp
|
# Upload file to sourceforge server using scp
|
||||||
def upload(localfolder, webfolder):
|
def upload(localfolder, webfolder, password):
|
||||||
if len(PASSWORD) < 3:
|
if len(password) < 3:
|
||||||
return
|
return
|
||||||
tries = 1
|
tries = 1
|
||||||
while tries <= 5:
|
while tries <= 5:
|
||||||
|
@ -48,7 +37,7 @@ def upload(localfolder, webfolder):
|
||||||
'scp -r ' + localfolder + ' danielmarjamaki,cppcheck@web.sf.net:htdocs/' + webfolder)
|
'scp -r ' + localfolder + ' danielmarjamaki,cppcheck@web.sf.net:htdocs/' + webfolder)
|
||||||
# child.expect('upload@trac.cppcheck.net\'s password:')
|
# child.expect('upload@trac.cppcheck.net\'s password:')
|
||||||
child.expect('Password:')
|
child.expect('Password:')
|
||||||
child.sendline(PASSWORD)
|
child.sendline(password)
|
||||||
child.interact()
|
child.interact()
|
||||||
return
|
return
|
||||||
except (IOError, OSError, pexpect.TIMEOUT, pexpect.EOF):
|
except (IOError, OSError, pexpect.TIMEOUT, pexpect.EOF):
|
||||||
|
@ -57,7 +46,7 @@ def upload(localfolder, webfolder):
|
||||||
tries = tries + 1
|
tries = tries + 1
|
||||||
|
|
||||||
|
|
||||||
def daca2(foldernum):
|
def daca2(foldernum, password):
|
||||||
folders = '0123456789abcdefghijklmnopqrstuvwxyz'
|
folders = '0123456789abcdefghijklmnopqrstuvwxyz'
|
||||||
folder = folders[foldernum % len(folders)]
|
folder = folders[foldernum % len(folders)]
|
||||||
|
|
||||||
|
@ -82,9 +71,18 @@ def daca2(foldernum):
|
||||||
daca2report(os.path.expanduser('~/daca2-report'))
|
daca2report(os.path.expanduser('~/daca2-report'))
|
||||||
|
|
||||||
print('rundaca2.py: upload')
|
print('rundaca2.py: upload')
|
||||||
upload(os.path.expanduser('~/daca2-report'), 'devinfo/')
|
upload(os.path.expanduser('~/daca2-report'), 'devinfo/', password)
|
||||||
|
|
||||||
foldernum = START
|
foldernum = 0
|
||||||
|
for arg in sys.argv[1:]:
|
||||||
|
if len(arg) == 1:
|
||||||
|
folderNum = '0123456789abcdefghijklmnopqrstuvwxyz'.find(arg)
|
||||||
|
if folderNum < 0:
|
||||||
|
folderNum = 0
|
||||||
|
|
||||||
|
print('enter password:')
|
||||||
|
password = sys.stdin.readline().rstrip()
|
||||||
while True:
|
while True:
|
||||||
daca2(foldernum)
|
daca2(foldernum, password)
|
||||||
foldernum = foldernum + 1
|
foldernum = foldernum + 1
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue