# assume it's there os.utime(path, (now, now)) except os.error: # if it isn't, try creating the directory, # a file with that name open(path, "w").close() os.utime(path, (now, now)) if __name__ == '__main__': from logging import INFO, DEBUG, ERROR TRACE = 5 VERBOSE = 15 from common import logger logger.initialize(level=DEBUG) settings = Settings() log.info('HostNames: {}'.format(settings.Hostnames)) log.info('SeriesDir: {}'.format(settings.SeriesDir)) log.info('MoviesDir: {}'.format(settings.MoviesDir)) log.info('NewSeriesDir: {}'.format(settings.NewSeriesDir)) log.info('NewMoviesDir: {}'.format(settings.NewMoviesDir)) log.info('UnpackDir: {}'.format(settings.UnpackDir)) log.info('DownloadMovies: {}'.format(settings.DownloadMovies)) log.info('EpisodeAdjList: {}'.format(settings.EpisodeAdjList)) log.info('MediaExt: {}'.format(settings.MediaExt)) log.info('MovieGlob: {}'.format(settings.MovieGlob)) log.info('IgnoreGlob: {}'.format(settings.IgnoreGlob)) log.info('Predicates: {}'.format(settings.Predicates)) log.info('DBFile: {}'.format(settings.DBFile))
def __init__(self, distribute): self.distribute = distribute log.debug('PackageHandler Initialized') def NewDownload(self, pathname): try: self.distribute.distribute(pathname) except: an_error = traceback.format_exc(1) log.error(traceback.format_exception_only(type(an_error), an_error)[-1]) log.error('Rename skipped for: {}'.format(os.path.basename(pathname))) if __name__ == "__main__": logger.initialize() library = Distribute() daemon = MyDaemon('/tmp/daemon-DownloadMonitor2.pid', library) Library.args = library.options.parser.parse_args(sys.argv[1:]) log.debug("Parsed command line: {!s}".format(library.args)) log_level = logging.getLevelName(library.args.loglevel.upper()) if library.args.logfile == 'daddyvision.log': log_file = '{}.log'.format(__pgmname__) else: log_file = os.path.expanduser(library.args.logfile) # If an absolute path is not specified, use the default directory.
else: self.year = _movie.releasedate.year log.trace("Movie Located in TMDB") self.tmdb_id = _movie.id self.imdb_id = _movie.imdb self.slug = self.title self.cast = _movie.cast if hasattr(_movie, "alternate_titles"): self.alternate_title = _movie.alternate_titles return if __name__ == "__main__": from sys import argv from common import logger from logging import DEBUG; TRACE = 5; VERBOSE = 15 logger.initialize(level=DEBUG) DadVision.args = DadVision.cmdoptions.ParseArgs(argv[1:]) logger.start(DadVision.args.logfile, DEBUG, timed=DadVision.args.timed) movie = TMDB() if len(DadVision.args.pathname) > 0: for pathname in DadVision.args.pathname: movie.media_details(pathname) movie = movie.tmdb()
def __init__(self, distribute): self.distribute = distribute log.debug("PackageHandler Initialized") def NewDownload(self, pathname): try: self.distribute.distribute(pathname) except: an_error = traceback.format_exc(1) log.error(traceback.format_exception_only(type(an_error), an_error)[-1]) log.error("Rename skipped for: {}".format(os.path.basename(pathname))) if __name__ == "__main__": logger.initialize() library = Distribute() daemon = MyDaemon("/tmp/daemon-DownloadMonitor2.pid", library) Library.args = library.options.parser.parse_args(sys.argv[1:]) log.debug("Parsed command line: {!s}".format(library.args)) log_level = logging.getLevelName(library.args.loglevel.upper()) if library.args.logfile == "daddyvision.log": log_file = "{}.log".format(__pgmname__) else: log_file = os.path.expanduser(library.args.logfile) # If an absolute path is not specified, use the default directory.