Ejemplo n.º 1
0
def show(args):
    if args.issue is not None:
        handler = GitManager().perform_git_workflow(lambda: IssueHandler())
        issue = handler.get_issue_from_issue_id(args.issue)

        if issue == None:
            print(f"Issue with ID {args.issue} was not found.")
        else:
            handler.display_issue(issue)
    else:
        list(args)
Ejemplo n.º 2
0
def edit(args):
    handler = GitManager().perform_git_workflow(lambda: IssueHandler())
    if not handler.does_issue_exist(args.issue):
        print("Error: Issue does not exist")
        return

    issue = handler.get_issue_from_issue_id(args.issue)

    if (issue == None):
        print("There was a problem ")

    print("Issue before editing:")
    handler.display_issue(issue)

    issue.summary = args.summary if args.summary != None else issue.summary
    issue.description = args.description if args.description != None else issue.description
    issue.assignee = GitUser(email=args.assignee) if args.assignee != None else issue.assignee
    issue.reporter = GitUser(email=args.reporter) if args.reporter != None else issue.reporter
    issue.status = args.status if args.status != None else issue.status

    print()
    confirm_operation(issue, lambda: handler.store_issue(issue, "edit"))
Ejemplo n.º 3
0
def list(args):
    handler = GitManager().perform_git_workflow(lambda: IssueHandler())
    issues = issue_handler.get_all_issues()
    for i in issues:
        handler.display_issue(i)
        print()