Added function to recursively traverse a directory tree and process all files ending in '.h'.

This commit is contained in:
2018-12-17 19:56:12 +01:00
parent 4f9609c1ac
commit de50a9e073
+6 -5
View File
@@ -39,6 +39,10 @@ class H2INC:
else:
return False
def process_directory(self):
for f in self.filelist:
self.read_file(f)
def read_file(self, fn):
parse = PARSER()
outfile = ''
@@ -103,10 +107,7 @@ if __name__ == "__main__":
app = H2INC()
if app.srcfilecnt(app.sourcedir) == True:
print(app.filecnt)
#print(app.filelist)
if app.srcfoldercnt(app.sourcedir) == True:
print(app.foldercnt)
#print(app.folderlist)
#for f in app.filelist:
#app.read_file(f)
app.read_file("./gtk.h") #testfile for comments and header includes
#app.read_file("./gtk.h") #testfile for comments and header includes
app.process_directory()