233
233
# it will exercise the two main methods of our class and display the results
234
234
# onto the screen (in an albeit ugly way).
235
235
#if __name__ == '__main__':
236
## This is how you create an instance of your RecursiveParser class
236
# This is how you create an instance of your RecursiveParser class
237
237
#parser = RecursiveParser()
239
## Replace /home/user/documents with whichever path you wish to search
239
# Replace /home/user/documents with whichever path you wish to search
240
240
#print 'PRINTING DIRECTORIES\n'
241
241
#dirs = parser.getRecursiveDirList('/home/user/documents')
244
## Replace /home/user/documents with whichever path you wish to extract a list of files from
245
## Remember that the extensions argument is optional. If you leave it off the returned list
246
## contain a list of all the files in the specified directory.
244
# Replace /home/user/documents with whichever path you wish to extract a list of files from
245
# Remember that the extensions argument is optional. If you leave it off the returned list
246
# contain a list of all the files in the specified directory.
247
247
#print 'PRINTING ALL FILES\n'
248
248
#files = parser.getRecursiveFileList('/home/user/documents')
251
## Here is an example that specifies some file extensions.
251
# Here is an example that specifies some file extensions.
252
252
#print 'PRINTING ALL HTML, TXT, and DOC FILES\n'
253
253
#files = parser.getRecursiveFileList('/home/user/documents', ['html', 'txt', 'doc'])
256
## Finally, here is an example that specifies only one file extension. Note that even
257
## when there is only one file extension, it still needs to be in a list
256
# Finally, here is an example that specifies only one file extension. Note that even
257
# when there is only one file extension, it still needs to be in a list
258
258
#print 'PRINTING ALL HTML FILES\n'
259
259
#files = parser.getRecursiveFileList('/home/user/documents', ['html'])