mirror of
https://github.com/nikdoof/tvorganise.git
synced 2026-01-31 10:08:20 +00:00
Moved finding files into find_files function
This commit is contained in:
@@ -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()
|
||||||
Reference in New Issue
Block a user