mirror of
https://github.com/nikdoof/tvorganise.git
synced 2025-12-13 06:42:16 +00:00
Move config into main(), moved filename_config import next to other imports
This commit is contained in:
@@ -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
|
||||
###################################
|
||||
|
||||
Reference in New Issue
Block a user