示例#1
0
文件: main.py 项目: bth/stools
def main():
    """
        Entry point function
    """
    args = parse_args()
    logging.basicConfig(level=args.log, format='%(name)-10s: %(message)s')
    logging.info('Start')

    if args.execute != None:
        task_name = args.execute[0]
        arguments_list = args.execute[1:]
        task_to_execute = Configuration.get_task(args.configuration, task_name, arguments_list)
        if task_to_execute == None:
            print "Task " + task_name + " unknown."
        else:
            print "Execution of " + task_name + "..."
            task_to_execute.execute()
            
    if args.execute == None or task_to_execute == None:
        # Diplay all tasks
        list_tasks(args.configuration)
示例#2
0
文件: main.py 项目: bth/stools
def main():
    """
        Entry point function
    """
    args = parse_args()
    logging.basicConfig(level=args.log, format='%(name)-10s: %(message)s')
    logging.info('Start')

    if args.execute != None:
        task_name = args.execute[0]
        arguments_list = args.execute[1:]
        task_to_execute = Configuration.get_task(args.configuration, task_name,
                                                 arguments_list)
        if task_to_execute == None:
            print "Task " + task_name + " unknown."
        else:
            print "Execution of " + task_name + "..."
            task_to_execute.execute()

    if args.execute == None or task_to_execute == None:
        # Diplay all tasks
        list_tasks(args.configuration)
示例#3
0
文件: main.py 项目: bth/stools
def list_tasks(configuration_file):
    print "Tasks:"
    tasks_dictionary = Configuration.get_tasks_list(configuration_file)
    for task_name in tasks_dictionary.keys():
        print "\t" + task_name
示例#4
0
文件: main.py 项目: bth/stools
def list_tasks(configuration_file):
    print "Tasks:"
    tasks_dictionary = Configuration.get_tasks_list(configuration_file)
    for task_name in tasks_dictionary.keys():
        print "\t" + task_name