Added function to recursively traverse a directory tree and process all files ending in '.h'.
This commit is contained in:
@@ -39,6 +39,10 @@ class H2INC:
|
|||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
def process_directory(self):
|
||||||
|
for f in self.filelist:
|
||||||
|
self.read_file(f)
|
||||||
|
|
||||||
def read_file(self, fn):
|
def read_file(self, fn):
|
||||||
parse = PARSER()
|
parse = PARSER()
|
||||||
outfile = ''
|
outfile = ''
|
||||||
@@ -103,10 +107,7 @@ if __name__ == "__main__":
|
|||||||
app = H2INC()
|
app = H2INC()
|
||||||
if app.srcfilecnt(app.sourcedir) == True:
|
if app.srcfilecnt(app.sourcedir) == True:
|
||||||
print(app.filecnt)
|
print(app.filecnt)
|
||||||
#print(app.filelist)
|
|
||||||
if app.srcfoldercnt(app.sourcedir) == True:
|
if app.srcfoldercnt(app.sourcedir) == True:
|
||||||
print(app.foldercnt)
|
print(app.foldercnt)
|
||||||
#print(app.folderlist)
|
#app.read_file("./gtk.h") #testfile for comments and header includes
|
||||||
#for f in app.filelist:
|
app.process_directory()
|
||||||
#app.read_file(f)
|
|
||||||
app.read_file("./gtk.h") #testfile for comments and header includes
|
|
||||||
Reference in New Issue
Block a user