daca2: choose folder from command line
This commit is contained in:
parent
95138dbead
commit
b1470dc36e
|
@ -2,9 +2,10 @@
|
||||||
#
|
#
|
||||||
# 1. Create a folder daca2 in your HOME folder
|
# 1. Create a folder daca2 in your HOME folder
|
||||||
# 2. Put cppcheck-O2 in daca2. It should be built with all optimisations.
|
# 2. Put cppcheck-O2 in daca2. It should be built with all optimisations.
|
||||||
# 3. Edit this line: FOLDER = 'a'
|
# 3. Choose a folder to check. Choose any that match regexpr: (lib)?[0-9a-z]
|
||||||
# 4. Optional: Put a file called "suppressions.txt" in the daca2 folder.
|
# 4. Optional: Put a file called "suppressions.txt" in the daca2 folder.
|
||||||
# 5. Run the daca2 script: python daca2.py
|
# 5. Optional: tweak FTPSERVER and FTPPATH in this script below.
|
||||||
|
# 6. Run the daca2 script: python daca2.py FOLDER
|
||||||
|
|
||||||
import ftplib
|
import ftplib
|
||||||
import subprocess
|
import subprocess
|
||||||
|
@ -27,7 +28,7 @@ def removeAllExceptResults():
|
||||||
elif filename != 'results.txt':
|
elif filename != 'results.txt':
|
||||||
os.remove(filename)
|
os.remove(filename)
|
||||||
|
|
||||||
def generatereport(allfolders):
|
def generateDaca2Report(allfolders):
|
||||||
filename = os.path.expanduser('~/daca2/daca2.html')
|
filename = os.path.expanduser('~/daca2/daca2.html')
|
||||||
f = open(filename, 'wt')
|
f = open(filename, 'wt')
|
||||||
f.write('<html>\n')
|
f.write('<html>\n')
|
||||||
|
@ -55,6 +56,9 @@ if not os.path.isfile(workdir + 'suppressions.txt'):
|
||||||
suppressions.write('\n')
|
suppressions.write('\n')
|
||||||
suppressions.close()
|
suppressions.close()
|
||||||
|
|
||||||
|
if len(sys.argv) == 2:
|
||||||
|
FOLDER = sys.argv[1]
|
||||||
|
|
||||||
print('~/daca2/' + FOLDER)
|
print('~/daca2/' + FOLDER)
|
||||||
if not os.path.isdir(workdir + FOLDER):
|
if not os.path.isdir(workdir + FOLDER):
|
||||||
os.makedirs(workdir + FOLDER)
|
os.makedirs(workdir + FOLDER)
|
||||||
|
@ -115,4 +119,4 @@ for package in packages:
|
||||||
# remove all files/folders except results.txt
|
# remove all files/folders except results.txt
|
||||||
removeAllExceptResults()
|
removeAllExceptResults()
|
||||||
|
|
||||||
generatereport(f.nlst(FTPPATH))
|
generateDaca2Report(f.nlst(FTPPATH))
|
||||||
|
|
Loading…
Reference in New Issue