Add helper for finding files in folder

This commit is contained in:
Thomas Adamcik 2010-10-25 23:31:40 +02:00
parent 21123e3cd9
commit b455b54577

View File

@ -26,3 +26,9 @@ def path_to_uri(*paths):
if sys.platform == 'win32':
return 'file:' + urllib.pathname2url(path)
return 'file://' + urllib.pathname2url(path)
def find_files(folder):
for dirpath, dirnames, filenames in os.walk(folder):
for filename in filenames:
dirpath = os.path.abspath(dirpath)
yield os.path.join(dirpath, filename)