Ejemplo n.º 1
0
def __rename():
    for pathSource in Config.get('renamer.path.sources').split(','):
        try:
            Renamer(pathSource, 'Pictures').run()
            Renamer(pathSource, 'Videos').run()
        except Exception as err:
            logging.error(str(err))
Ejemplo n.º 2
0
def __normalise():
    for pathSource in Config.get('normaliser.path.sources').split(','):
        try:
            Normaliser(pathSource, 'Pictures').run()
            Normaliser(pathSource, 'Videos').run()
        except Exception as err:
            logging.error(str(err))
Ejemplo n.º 3
0
def __shrink():
    for pathSource in Config.get('shrinker.path.sources').split(','):
        try:
            Shrinker(pathSource, 'Pictures').run()
            Shrinker(pathSource, 'Videos').run()
        except Exception as err:
            logging.error(str(err))
Ejemplo n.º 4
0
def __classify():
    for pathSource in Config.get('classifier.path.sources').split(','):
        try:
            Classifier(pathSource, 'Pictures').run()
            Classifier(pathSource, 'Videos').run()
        except Exception as err:
            logging.error(str(err))
Ejemplo n.º 5
0
 def __handleError(self, filename):
     self.numberOfErrors = self.numberOfErrors + 1
     logging.error("Error normalising %s. Error number %s.",
                   filename,
                   str(self.numberOfErrors),
                   exc_info=True)
     if self.numberOfErrors == int(
             Config.get('normaliser.max.number.of.errors')):
         raise ValueError(
             'Too many errors. Something is wrong. Aborting execution.')
Ejemplo n.º 6
0
#!/usr/bin/python

from log.Logging import logging
from renamer.Renamer import Renamer
from config.Config import Config
from utils import Locker


def __rename():
    for pathSource in Config.get('renamer.path.sources').split(','):
        try:
            Renamer(pathSource, 'Pictures').run()
            Renamer(pathSource, 'Videos').run()
        except Exception as err:
            logging.error(str(err))


if Locker.startService():
    __rename()
    Locker.stopService()
else:
    logging.error(
        "The renamer could not start because there was a locker file.")
Ejemplo n.º 7
0
 def get(name):
     try:
         return Config.getFromSection('All', name)
     except:
         logging.error("Configuration property %s not found in %s", name,
                       getConfigFileName())
Ejemplo n.º 8
0
 def shrink(self):
     logging.error(
         'File %s cannot be shrinked because its type is unknown.',
         self.sourceFilename)