Added worklist of folders
This commit is contained in:
20
h2inc.py
20
h2inc.py
@@ -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')
|
Reference in New Issue
Block a user