Moved finding files into find_files function

This commit is contained in:
dbr
2008-12-29 17:00:50 +10:30
parent eac58ad04a
commit b45386ead1

View File

@@ -207,15 +207,24 @@ class Episode:
#end Episode
###################################
# Find all valid files
###################################
def find_files(loc):
"""Recursivly finds files in a directory
"""
allfiles=[]
for (path,dirs,files) in os.walk(loc):
for file in files:
filename = os.path.join(os.path.abspath(path), file)
allfiles.append( str(filename) )
#end for f
return allfiles
#end find_files
def main():
###################################
# Find all valid files
###################################
allfiles = find_files(loc)
# Strip out dotfiles/folder.jpg
decrappified = []
@@ -318,3 +327,6 @@ if len(valid) > 0:
allepisodes[showname][seasno][epno]['name'] = title
#end for cur in valid
print allepisodes
if __name__ == '__main__':
main()