Commit 2cbba2a0 authored by Jonas's avatar Jonas

Réorganisation arguments

parent f440319e
......@@ -31,14 +31,15 @@ reload(sys)
sys.setdefaultencoding('utf8')
parser = argparse.ArgumentParser(description = "Grabber xmltv via l'api de la freebox")
parser.add_argument("-v", "--verbose", dest="verbose", default="warning", help="Verbose (debug,info,warning,error) [info par defaut]")
parser.add_argument("--description", action = 'store_true', help="Description")
parser.add_argument("--capabilities", action = 'store_true', help="Capactitée")
parser.add_argument("--quiet", action = 'store_true', help="Supprime toute les sorties de progressions")
parser.add_argument("--configure", action = 'store_true', help="Configurer le grabber")
config_file = os.path.join(os.environ['HOME'],'.xmltv','tv_grab_fr_mafreebox.conf')
parser.add_argument("--config-file", action = 'store_true', default=config_file, help="Fichier de configuration (%s par défaut)"%config_file)
args = parser.parse_args()
parser.add_argument("--quiet", action = 'store_true', help="Supprime toutes les sorties de progressions")
parser.add_argument("--verbose", action = 'store_true', help="Bavard (affiche plus d'information de progression)")
parser.add_argument("--debug", action = 'store_true', help="Affiche des informations pour le debug")
TZ = get_localzone()
B_URL = "http://mafreebox.freebox.fr"
......@@ -48,16 +49,14 @@ ICON_URL = BASE_URL + "tv/img/channels/logos68x60/"
EPG_URL = BASE_URL + "tv/epg/by_channel/"
PROG_URL = BASE_URL + "tv/epg/programs/"
if args.verbose == 'debug' :
if args.debug :
logLevel = logging.DEBUG
elif args.verbose == 'info' :
elif args.verbose :
logLevel = logging.INFO
elif args.verbose == 'error' :
logLevel = logging.ERROR
elif args.quiet :
logLevel = logging.CRITICAL
else :
logLevel = logging.WARNING
if args.quiet :
logLevel = logging.CRITICAL
logging.basicConfig(
format = "%(asctime)s %(levelname)s - %(message)s",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment