Move config into main(), moved filename_config import next to other imports

This commit is contained in:
dbr
2008-12-29 17:18:53 +10:30
parent b925d8a709
commit 124b442709

View File

@@ -2,6 +2,9 @@
#encoding:utf-8
import os, sys
# Import shared filename pattern config
from filename_config import tv_regex
def colour(text, colour="red"):
nocolour = False
if nocolour: # Colour no supported, return plain text
@@ -29,25 +32,6 @@ def getError(invalid,errorno):
return ret
#end searchError
###################################
# Configs
###################################
# Import shared filename pattern config
from filename_config import tv_regex
# Error-code to error-description mapping
errors = {
1:'malformed name',
2:'missing epsiode name',
3:'path is incorrect'
}
# Location to process
loc = "." # Runs from the current path
###################################
# Output-helper to convert array of
# numbers (episode numbers) to human-readable string
@@ -221,6 +205,16 @@ def find_files(loc):
def main():
# Error-code to error-description mapping
errors = {
1:'malformed name',
2:'missing epsiode name',
3:'path is incorrect'
}
# Location to process
loc = "." # Runs from the current path
###################################
# Find all valid files
###################################