lenkaseg

cranc_create_pr

Jan 18th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.63 KB | None | 0 0
  1. # Create subgroup 'create'
  2. @click.group()
  3. def create():
  4.     pass
  5.  
  6. @click.command(name="pr")
  7. @click.option("--repo")
  8. @click.option("--title")
  9. @click.option("--branch_to")
  10. @click.option("--branch_from")
  11. def create_pr(repo, title, branch_to, branch_from):
  12.     """this command creates a new pull request"""
  13.     try:
  14.         request = PAGURE.create_pull_request(repo=repo, title=title, branch_to=branch_to,
  15.                branch_from=branch_from)
  16.         pprint.pprint(request)
  17.     except Exception:
  18.         _log.exception("Failed to connect to the server")
  19.  
  20. # Adding create_pr into the group 'create'
  21. create.add_command(create_pr)
Advertisement
Add Comment
Please, Sign In to add comment