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