From 124b442709dbb87e5e586dde944f4b6a1240a195 Mon Sep 17 00:00:00 2001 From: dbr Date: Mon, 29 Dec 2008 17:18:53 +1030 Subject: [PATCH] Move config into main(), moved filename_config import next to other imports --- checkTvEps.py | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/checkTvEps.py b/checkTvEps.py index 50af78a..a98aedf 100755 --- a/checkTvEps.py +++ b/checkTvEps.py @@ -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 ###################################