Added filelist

This commit is contained in:
2018-02-09 21:55:26 +01:00
parent cb8f1cbba9
commit a11fb3436f
4 changed files with 9 additions and 5 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
+9 -5
View File
@@ -13,22 +13,26 @@ import h2inc_gui
tupline = [] tupline = []
preproc = () preproc = ()
outfile = '' outfile = ''
folders = [] filelist = []
folderlist = []
cnt = 0 cnt = 0
def sourcedir_filecnt(sourcedir): def sourcedir_filecnt(sourcedir):
### Return the number of files, ending with '.h', in sourcedir - including subdirectories ### ### Return the number of files, ending with '.h', in sourcedir - including subdirectories ###
cnt = 0 cnt = 0
global filelist
for folderName, subfolders, files in os.walk(sourcedir): for folderName, subfolders, files in os.walk(sourcedir):
for file in files: for file in files:
if file.lower().endswith('.h'): if file.lower().endswith('.h'):
cnt = cnt+1 cnt += 1
filelist += [file]
print(filelist)
return cnt return cnt
def sourcedir_foldercnt(sourcedir): def sourcedir_foldercnt(sourcedir):
### Return the number of folders, if it contains '*.h' files, in sourcedir - including subdirectories ### ### Return the number of folders, if it contains '*.h' files, in sourcedir - including subdirectories ###
global cnt global cnt
global folders global folderlist
for folderName, subfolders, files in os.walk(sourcedir): for folderName, subfolders, files in os.walk(sourcedir):
if subfolders: if subfolders:
for subfolder in subfolders: for subfolder in subfolders:
@@ -37,8 +41,8 @@ def sourcedir_foldercnt(sourcedir):
if tempf: if tempf:
cnt = cnt+1 cnt = cnt+1
print(folderName) print(folderName)
folders += [folderName] folderlist += [folderName]
print(folders) print(folderlist)
return cnt return cnt
def process_files(sourcedir, destdir): def process_files(sourcedir, destdir):