| |
@@ -1,12 +1,45 @@
|
| |
import click
|
| |
- import requests
|
| |
+ import pprint
|
| |
+
|
| |
+ from libpagure import libpagure
|
| |
|
| |
@click.group()
|
| |
- def lists():
|
| |
+ def cranc():
|
| |
pass
|
| |
|
| |
- @click.command()
|
| |
- def list_pull_requests():
|
| |
+ api_token = os.getenv('CRANC_TOKEN')
|
| |
+
|
| |
+
|
| |
+ ################################################################################
|
| |
+ # PR section
|
| |
+ ################################################################################
|
| |
+
|
| |
+ @click.group()
|
| |
+ def pr():
|
| |
pass
|
| |
|
| |
- lists.add_command(list_pull_requests)
|
| |
+ @click.command()
|
| |
+ #@click.option('--author', default='all')
|
| |
+
|
| |
+ def list():
|
| |
+ """
|
| |
+ Get all pull requests of a project.
|
| |
+ :param status: filters the status of the requests
|
| |
+ :param assignee: filters the assignee of the requests
|
| |
+ :param author: filters the author of the requests
|
| |
+ :return:
|
| |
+ """
|
| |
+ pagure = libpagure.Pagure(pagure_token=api_token, pagure_repository='pagure')
|
| |
+ prs = pagure.list_requests()
|
| |
+
|
| |
+ pprint.pprint(prs)
|
| |
+
|
| |
+ pr.add_command(list)
|
| |
+
|
| |
+
|
| |
+
|
| |
+ ################################################################################
|
| |
+ # General section
|
| |
+ ################################################################################
|
| |
+
|
| |
+ cranc.add_command(pr)
|
| |
cranc pr list
fetches all the pull requests from pagure projectREADME.md also updated
Fixes #1