mirror of
https://github.com/nikdoof/tvorganise.git
synced 2026-01-31 01:58:20 +00:00
PEP8 work, cleanup
This commit is contained in:
@@ -8,12 +8,15 @@ filenames and automatically copies them to
|
|||||||
the location format defined in the configuration file.
|
the location format defined in the configuration file.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import os, sys, re
|
import os
|
||||||
|
import sys
|
||||||
|
import re
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
import shutil
|
import shutil
|
||||||
import ConfigParser
|
import ConfigParser
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
|
||||||
class TvOrganiser():
|
class TvOrganiser():
|
||||||
|
|
||||||
_config = {}
|
_config = {}
|
||||||
@@ -58,7 +61,6 @@ class TvOrganiser():
|
|||||||
self._config = config
|
self._config = config
|
||||||
return config
|
return config
|
||||||
|
|
||||||
|
|
||||||
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 recurse
|
||||||
@@ -108,8 +110,7 @@ class TvOrganiser():
|
|||||||
'epno': epno,
|
'epno': epno,
|
||||||
'filepath': filepath,
|
'filepath': filepath,
|
||||||
'filename': filename,
|
'filename': filename,
|
||||||
'ext':ext
|
'ext': ext})
|
||||||
})
|
|
||||||
break # Matched - to the next file!
|
break # Matched - to the next file!
|
||||||
else:
|
else:
|
||||||
self._logger.warning("Invalid name: %s" % (f))
|
self._logger.warning("Invalid name: %s" % (f))
|
||||||
@@ -136,7 +137,6 @@ class TvOrganiser():
|
|||||||
action = "store_true", default = False,
|
action = "store_true", default = False,
|
||||||
help = "Verbose output")
|
help = "Verbose output")
|
||||||
|
|
||||||
|
|
||||||
opts, args = parser.parse_args()
|
opts, args = parser.parse_args()
|
||||||
|
|
||||||
if os.path.exists(opts.config):
|
if os.path.exists(opts.config):
|
||||||
@@ -160,7 +160,6 @@ class TvOrganiser():
|
|||||||
|
|
||||||
self._logger.info("Old path:", oldfile)
|
self._logger.info("Old path:", oldfile)
|
||||||
self._logger.info("New path:", newfile)
|
self._logger.info("New path:", newfile)
|
||||||
ans= "always"
|
|
||||||
|
|
||||||
if opts.always:
|
if opts.always:
|
||||||
if not os.path.exists(newpath):
|
if not os.path.exists(newpath):
|
||||||
|
|||||||
Reference in New Issue
Block a user