forked from transifex/PyGithub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR add the follow code examples * Issue examples (get list, get specific issue, create issue) * Milestone examples (get list, get specific milestone, create milestone) Ref.: PyGithub#874
- Loading branch information
1 parent
8f4f40e
commit 228e5e8
Showing
3 changed files
with
103 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
Issues | ||
====== | ||
|
||
Get issue | ||
--------- | ||
|
||
.. code-block:: python | ||
>>> repo = g.get_repo("PyGithub/PyGithub") | ||
>>> repo.get_issue(number=874) | ||
Issue(title="PyGithub example usage", number=874) | ||
Create issue | ||
------------ | ||
|
||
.. code-block:: python | ||
>>> repo = g.get_repo("PyGithub/PyGithub") | ||
>>> repo.create_issue(title="This is a new issue") | ||
Issue(title="This is a new issue", number=XXX) | ||
Create issue with body | ||
---------------------- | ||
|
||
.. code-block:: python | ||
>>> repo = g.get_repo("PyGithub/PyGithub") | ||
>>> repo.create_issue(title="This is a new issue", body="This is the issue body") | ||
Issue(title="This is a new issue", number=XXX) | ||
Create issue with labels | ||
------------------------ | ||
|
||
.. code-block:: python | ||
>>> repo = g.get_repo("PyGithub/PyGithub") | ||
>>> label = repo.get_label("My Label") | ||
>>> repo.create_issue(title="This is a new issue", labels=[label]) | ||
Issue(title="This is a new issue", number=XXX) | ||
Create issue with assignee | ||
-------------------------- | ||
|
||
.. code-block:: python | ||
>>> repo = g.get_repo("PyGithub/PyGithub") | ||
>>> repo.create_issue(title="This is a new issue", assignee="github-username") | ||
Issue(title="This is a new issue", number=XXX) | ||
Create issue with milestone | ||
--------------------------- | ||
|
||
.. code-block:: python | ||
>>> repo = g.get_repo("PyGithub/PyGithub") | ||
>>> milestone = repo.create_milestone("New Issue Milestone") | ||
>>> repo.create_issue(title="This is a new issue", milestone=milestone) | ||
Issue(title="This is a new issue", number=XXX) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
Milestone | ||
========== | ||
|
||
Get Milestone list | ||
------------------ | ||
|
||
.. code-block:: python | ||
>>> repo = g.get_repo('PyGithub/PyGithub') | ||
>>> open_milestones = repo.get_milestones(state='open') | ||
>>> for milestone in open_milestones: | ||
... print(milestone) | ||
... | ||
Milestone(number=1) | ||
Milestone(number=2) | ||
Get Milestone | ||
------------- | ||
|
||
.. code-block:: python | ||
>>> repo = g.get_repo('PyGithub/PyGithub') | ||
>>> repo.get_milestone(number=1) | ||
Milestone(number=1) | ||
Create Milestone | ||
---------------- | ||
|
||
.. code-block:: python | ||
>>> repo = g.get_repo('PyGithub/PyGithub') | ||
>>> repo.create_milestone(title='New Milestone') | ||
Milestone(number=1) | ||
Create Milestone with State and Description | ||
------------------------------------------- | ||
|
||
.. code-block:: python | ||
>>> repo = g.get_repo('PyGithub/PyGithub') | ||
>>> repo.create_milestone(title='New Milestone', state='open', description='Milestone description') | ||
Milestone(number=1) |