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
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))
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)
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))
def create_bot(args, conf): # update trello arguments conf = util.update_config_group('trello', args, conf) # create the bot return agilebot.cmd_util.create_bot(conf, logger)