mirror of
https://github.com/nikdoof/tvorganise.git
synced 2026-01-31 01:58:20 +00:00
Further PEP8 work.
This commit is contained in:
@@ -63,8 +63,9 @@ class TvOrganiser():
|
|||||||
|
|
||||||
def _findFiles(self, args):
|
def _findFiles(self, args):
|
||||||
"""
|
"""
|
||||||
Takes a list of files/folders, grabs files inside them. Does not recurse
|
Takes a list of files/folders, grabs files inside them. Does not
|
||||||
more than one level (if a folder is supplied, it will list files within)
|
recurse more than one level (if a folder is supplied, it will list
|
||||||
|
files within)
|
||||||
"""
|
"""
|
||||||
allfiles = []
|
allfiles = []
|
||||||
for cfile in args:
|
for cfile in args:
|
||||||
@@ -94,7 +95,7 @@ class TvOrganiser():
|
|||||||
if match:
|
if match:
|
||||||
showname, seasno, epno, epname = match.groups()
|
showname, seasno, epno, epname = match.groups()
|
||||||
|
|
||||||
#remove ._- characters from name (- removed only if next to end of line)
|
#remove ._- characters from name
|
||||||
showname = re.sub("[\._]|\-(?=$)", " ", showname).strip()
|
showname = re.sub("[\._]|\-(?=$)", " ", showname).strip()
|
||||||
|
|
||||||
seasno, epno = int(seasno), int(epno)
|
seasno, epno = int(seasno), int(epno)
|
||||||
@@ -154,9 +155,10 @@ class TvOrganiser():
|
|||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
for name in files:
|
for name in files:
|
||||||
oldfile = os.path.join(name['filepath'], name['filename']) + "." + name['ext']
|
filename = "%s.%s" % (name['filename'], name['ext'])
|
||||||
|
oldfile = os.path.join(name['filepath'], filename)
|
||||||
newpath = config['target_path'] % name
|
newpath = config['target_path'] % name
|
||||||
newfile = os.path.join(newpath, name['filename']) + "." + name['ext']
|
newfile = os.path.join(newpath, filename)
|
||||||
|
|
||||||
self._logger.info("Old path:", oldfile)
|
self._logger.info("Old path:", oldfile)
|
||||||
self._logger.info("New path:", newfile)
|
self._logger.info("New path:", newfile)
|
||||||
|
|||||||
Reference in New Issue
Block a user