def running(): global category_choosed category_choosed = "all" # Print the title Header().first_title() start_time = time.time() for r in runLaZagne(): pass write_in_file(stdoutRes) print_footer() elapsed_time = time.time() - start_time print '\nelapsed time = ' + str(elapsed_time)
#2- Main commands subparsers = parser.add_subparsers(help='Choose a main command') for d in dic: subparsers.add_parser(d, parents=dic[d]['parents'], help=dic[d]['help']).set_defaults( func=dic[d]['func'], auditType=d) # ------------------------------------------- Parse arguments ------------------------------------------- args = dict(parser.parse_args()._get_kwargs()) arguments = parser.parse_args() category_choosed = args['auditType'] # Define constant variables output() verbosity() manage_advanced_options() start_time = time.time() for r in runLaZagne(): pass write_in_file(stdoutRes) print_footer() elapsed_time = time.time() - start_time print '\nelapsed time = ' + str(elapsed_time)
dic_tmp = {c: {'parents': parser_tab, 'help':'Run %s module' % c, 'func': runModule}} dic = dict(dic.items() + dic_tmp.items()) #2- Main commands subparsers = parser.add_subparsers(help='Choose a main command') for d in dic: subparsers.add_parser(d, parents=dic[d]['parents'], help=dic[d]['help']).set_defaults(func=dic[d]['func'], auditType=d) # ------------------------------------------- Parse arguments ------------------------------------------- args = dict(parser.parse_args()._get_kwargs()) arguments = parser.parse_args() category_choosed = args['auditType'] # Define constant variables output() verbosity() manage_advanced_options() start_time = time.time() for r in runLaZagne(category_choosed): pass clean_temporary_files() write_in_file(stdoutRes) print_footer() elapsed_time = time.time() - start_time print '\nelapsed time = ' + str(elapsed_time)