Added function process_files
This commit is contained in:
31
h2inc.py
31
h2inc.py
@@ -26,7 +26,7 @@ def sourcedir_filecnt(sourcedir):
|
||||
if file.lower().endswith('.h'):
|
||||
cnt += 1
|
||||
filelist += [file]
|
||||
print(filelist)
|
||||
#print(filelist)
|
||||
return cnt
|
||||
|
||||
def sourcedir_foldercnt(sourcedir):
|
||||
@@ -42,16 +42,25 @@ def sourcedir_foldercnt(sourcedir):
|
||||
cnt = cnt+1
|
||||
print(folderName)
|
||||
folderlist += [folderName]
|
||||
print(folderlist)
|
||||
#print(folderlist)
|
||||
#print(len(folderlist))
|
||||
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')
|
||||
global folderlist
|
||||
global filelist
|
||||
cnt = 0
|
||||
for f in folderlist:
|
||||
folderlist[cnt] = str(f).replace(str(sourcedir.get()), str(destdir.get()))
|
||||
print(folderlist[cnt])
|
||||
if not os.path.exists(folderlist[cnt]):
|
||||
os.makedirs(folderlist[cnt])
|
||||
cnt += 1
|
||||
#WorkPath = os.path.dirname(sourcedir)
|
||||
#print(WorkPath)
|
||||
#incpath = destdir
|
||||
#print(incpath)
|
||||
|
||||
#pattern = '.h'
|
||||
#inputfile = 'gtkaboutdialog.h'
|
||||
#filehandle = open(WorkPath+'/'+inputfile, 'r')
|
Reference in New Issue
Block a user