Exemple #1
0
numeric_level = getattr(logging, args.loglevel.upper(), None)
if not isinstance(numeric_level, int):
    raise ValueError('Invalid log level: %s' % args.loglevel)

if args.logdest.lower() == "stdout":
    logging.basicConfig(level=numeric_level)
else:
    logging.basicConfig(level=numeric_level, filename=args.logdest)

logging.debug("logging.level= " + args.loglevel + ", logging.filename=" +
              args.logdest)

# Git Setup
if args.push == True:
    pusher = Pusher()
    pusher.setup('./')

# if args.ignore_date == False:
#   today = date.today()
#   try:
#     with open("./data/last_update_cases.txt", encoding='utf-8') as last_update:
#       replication_date = timezone.localize(datetime.fromisoformat(last_update.read())).date()

#     # Compare with today
#     if today.isoformat() == replication_date.isoformat():
#     #if today.day == replication_date.day and today.month == replication_date.month and today.year == replication_date.year:
#       logging.info("Files are already up to date. Done")
#       exit()

#   except (OSError, IOError, FileNotFoundError) as e:
#     logging.debug(e)