示例#1
0
def find_sprints(args, conf):
    search_args = ['open']
    board_name = None
    if args.name and args.active and ACTIVE_PATTERN in args.name:
        logger.error('you have specified active flag and included the pattern "{active}" in the name')
    if args.name:
        board_name = args.name
    if args.active:
        if board_name is None:
            board_name = ACTIVE_PATTERN
        else:
            board_name += '*(active)'
    try:
        conf = util.update_config_group('sprint', args, conf)
        bot = agilebot.cmd_util.create_bot(conf, logger)
        resp = bot.trello.find_boards(
            board_name=board_name,
            organization_id=args.organization_id
        )

    except Exception as e:
        util.log_generic_error(e, sys.exc_info(), logger)
        sys.exit(1)
    else:
        return resp
示例#2
0
def cmd_sprint_get_closing(args, conf):
    logger.debug('CMD sprint get-closing')
    try:
        conf = util.update_config_group('sprint', args, conf)
        bot = agilebot.cmd_util.create_bot(conf, logger)
        resp = bot.get_closing_sprint()
    except Exception as e:
        util.log_generic_error(e, sys.exc_info(), logger)
        sys.exit(1)
    else:
        print(json.dumps(resp))
示例#3
0
def cmd_render_name(args, conf):
    logger.debug('CMD sprint render-name')
    try:
        conf = util.update_config_group('sprint', args, conf)
        bot = agilebot.cmd_util.create_bot(conf, logger)
        rendered_name = bot.format_sprint_name(args.sprint_name)
    except Exception as e:
        util.log_generic_error(e, sys.exc_info(), logger)
        sys.exit(1)
    else:
        print(rendered_name)
示例#4
0
def cmd_trello_find_boards(args, conf):
    logger.debug('CMD trello find-boards')
    bot = create_bot(args, conf)
    try:
        boards = bot.trello.find_boards(
            board_name=args.board_name,
            organization_id=args.organization_id
        )
    except Exception as e:
        util.log_generic_error(e, sys.exc_info(), logger)
        sys.exit(1)
    else:
        print(json.dumps(boards))
示例#5
0
def cmd_sprint_start_new(args, conf):
    logger.debug('CMD sprint render-name')
    try:
        conf = util.update_config_group('sprint', args, conf)
        bot = agilebot.cmd_util.create_bot(conf, logger)
        resp = bot.start_new_sprint(
            sprint_name=args.new_sprint_name,
            closing_sprint_name=args.closing_sprint_name,
            organization_id=args.organization_id)
    except Exception as e:
        util.log_generic_error(e, sys.exc_info(), logger)
        sys.exit(1)
    else:
        print(json.dumps(resp))