Added worklist of folders

This commit is contained in:
2018-02-09 21:34:01 +01:00
parent cf798226a2
commit cb8f1cbba9
6 changed files with 23 additions and 5 deletions

View File

@@ -10,6 +10,10 @@ import sys
from h2inc_parser import parseline, parseparsed
import h2inc_gui
tupline = []
preproc = ()
outfile = ''
folders = []
cnt = 0
def sourcedir_filecnt(sourcedir):
@@ -24,6 +28,7 @@ def sourcedir_filecnt(sourcedir):
def sourcedir_foldercnt(sourcedir):
### Return the number of folders, if it contains '*.h' files, in sourcedir - including subdirectories ###
global cnt
global folders
for folderName, subfolders, files in os.walk(sourcedir):
if subfolders:
for subfolder in subfolders:
@@ -32,4 +37,17 @@ def sourcedir_foldercnt(sourcedir):
if tempf:
cnt = cnt+1
print(folderName)
return cnt
folders += [folderName]
print(folders)
return cnt
def process_files(sourcedir, destdir):
WorkPath = os.path.dirname(sourcedir)
print(WorkPath)
incpath = destdir
print(incpath)
if not os.path.exists(incpath):
os.makedirs(incpath)
pattern = '.h'
inputfile = 'gtkaboutdialog.h'
filehandle = open(WorkPath+'/'+inputfile, 'r')