mirror of
https://github.com/nikdoof/tvorganise.git
synced 2026-01-31 01:58:20 +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
|
#encoding:utf-8
|
||||||
import os, sys
|
import os, sys
|
||||||
|
|
||||||
|
# Import shared filename pattern config
|
||||||
|
from filename_config import tv_regex
|
||||||
|
|
||||||
def colour(text, colour="red"):
|
def colour(text, colour="red"):
|
||||||
nocolour = False
|
nocolour = False
|
||||||
if nocolour: # Colour no supported, return plain text
|
if nocolour: # Colour no supported, return plain text
|
||||||
@@ -29,25 +32,6 @@ def getError(invalid,errorno):
|
|||||||
return ret
|
return ret
|
||||||
#end searchError
|
#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
|
# Output-helper to convert array of
|
||||||
# numbers (episode numbers) to human-readable string
|
# numbers (episode numbers) to human-readable string
|
||||||
@@ -221,6 +205,16 @@ def find_files(loc):
|
|||||||
|
|
||||||
|
|
||||||
def main():
|
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
|
# Find all valid files
|
||||||
###################################
|
###################################
|
||||||
|
|||||||
Reference in New Issue
Block a user