Permalink
Browse files

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

…mports
  • Loading branch information...
1 parent b925d8a commit 124b442709dbb87e5e586dde944f4b6a1240a195 @dbr committed Dec 29, 2008
Showing with 13 additions and 19 deletions.
  1. +13 −19 checkTvEps.py
View
@@ -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
###################################

0 comments on commit 124b442

Please sign in to comment.