This part of the documentation covers the module which handles Issues and their related objects:
The Issue object. It structures and handles the data returned via the Issues section of the GitHub API.
Two issue instances can be checked like so:
i1 == i2
i1 != i2
And is equivalent to:
i1.id == i2.id
i1.id != i2.id
Add labels to this issue.
| Parameters: | args (str) – (required), names of the labels you wish to add |
|---|---|
| Returns: | list of Labels |
Assigns user login to this issue. This is a short cut for issue.edit.
| Parameters: | login (str) – username of the person to assign this issue to |
|---|---|
| Returns: | bool |
Body (description) of the issue.
HTML formatted body of the issue.
Plain text formatted body of the issue.
Close this issue.
| Returns: | bool |
|---|
datetime object representing when the issue was closed.
Get a single comment by its id.
The catch here is that id is NOT a simple number to obtain. If you were to look at the comments on issue #15 in sigmavirus24/Todo.txt-python, the first comment’s id is 4150787.
| Parameters: | id_num (int) – (required), comment id, see example above |
|---|---|
| Returns: | IssueComment |
Number of comments on this issue.
Create a comment on this issue.
| Parameters: | body (str) – (required), comment body |
|---|---|
| Returns: | IssueComment |
datetime object representing when the issue was created.
Edit this issue.
| Parameters: |
|
|---|---|
| Returns: | bool |
| [1] | Milestone numbering starts at 1, i.e. the first milestone you create is 1, the second is 2, etc. |
Return an instance of cls formed from json.
URL to view the issue at GitHub.
Unique ID for the issue.
Checks if the issue is closed.
| Returns: | bool |
|---|
Iterate over the comments on this issue.
| Parameters: | number (int) – (optional), number of comments to iterate over |
|---|---|
| Returns: | iterator of IssueComment |
Iterate over events associated with this issue only.
| Parameters: | number (int) – (optional), number of events to return. Default: -1 returns all events available. |
|---|---|
| Returns: | generator of IssueEvents |
Returns the list of Labels on this issue.
Milestone this issue was assigned to.
Issue number (e.g. #15)
Dictionary URLs for the pull request (if they exist)
Number of requests before GitHub imposes a ratelimit.
Re-retrieve the information for this object and returns the refreshed instance.
| Parameters: | conditional (bool) – If True, then we will search for a stored header (‘Last-Modified’, or ‘ETag’) on the object and send that as described in the Conditional Requests section of the docs |
|---|---|
| Returns: | self |
The reasoning for the return value is the following example:
repos = [r.refresh() for r in g.iter_repos('kennethreitz')]
Without the return value, that would be an array of None‘s and you would otherwise have to do:
repos = [r for i in g.iter_repos('kennethreitz')]
[r.refresh() for r in repos]
Which is really an anti-pattern.
Changed in version 0.5.
Remove all labels from this issue.
| Returns: | an empty list if successful |
|---|
Removes label name from this issue.
| Parameters: | name (str) – (required), name of the label to remove |
|---|---|
| Returns: | bool |
Re-open a closed issue.
| Returns: | bool |
|---|
Replace all labels on this issue with labels.
| Parameters: | labels (list) – label names |
|---|---|
| Returns: | bool |
Returns (‘owner’, ‘repository’) this issue was filed on.
State of the issue, e.g., open, closed
Title of the issue.
Return the json representing this object.
datetime object representing the last time the issue was updated.
The IssueComment object. This structures and handles the comments on issues specifically.
Two comment instances can be checked like so:
c1 == c2
c1 != c2
And is equivalent to:
c1.id == c2.id
c1.id != c2.id
See also: http://developer.github.com/v3/issues/comments/
Delete this comment.
| Returns: | bool |
|---|
Edit this comment.
| Parameters: | body (str) – (required), new body of the comment, Markdown formatted |
|---|---|
| Returns: | bool |
Return an instance of cls formed from json.
Number of requests before GitHub imposes a ratelimit.
Re-retrieve the information for this object and returns the refreshed instance.
| Parameters: | conditional (bool) – If True, then we will search for a stored header (‘Last-Modified’, or ‘ETag’) on the object and send that as described in the Conditional Requests section of the docs |
|---|---|
| Returns: | self |
The reasoning for the return value is the following example:
repos = [r.refresh() for r in g.iter_repos('kennethreitz')]
Without the return value, that would be an array of None‘s and you would otherwise have to do:
repos = [r for i in g.iter_repos('kennethreitz')]
[r.refresh() for r in repos]
Which is really an anti-pattern.
Changed in version 0.5.
Return the json representing this object.
The IssueEvent object. This specifically deals with events described in the Issues>Events section of the GitHub API.
Two event instances can be checked like so:
e1 == e2
e1 != e2
And is equivalent to:
e1.commit_id == e2.commit_id
e1.commit_id != e2.commit_id
Number of comments
SHA of the commit.
datetime object representing when the event was created.
The type of event, e.g., closed
Return an instance of cls formed from json.
Issue where this comment was made.
Dictionary of links for the pull request
Number of requests before GitHub imposes a ratelimit.
Re-retrieve the information for this object and returns the refreshed instance.
| Parameters: | conditional (bool) – If True, then we will search for a stored header (‘Last-Modified’, or ‘ETag’) on the object and send that as described in the Conditional Requests section of the docs |
|---|---|
| Returns: | self |
The reasoning for the return value is the following example:
repos = [r.refresh() for r in g.iter_repos('kennethreitz')]
Without the return value, that would be an array of None‘s and you would otherwise have to do:
repos = [r for i in g.iter_repos('kennethreitz')]
[r.refresh() for r in repos]
Which is really an anti-pattern.
Changed in version 0.5.
Return the json representing this object.
The Milestone object. This is a small class to handle information about milestones on repositories and issues.
See also: http://developer.github.com/v3/issues/milestones/
The number of closed issues associated with this milestone.
datetime object representing when the milestone was created.
Delete this milestone.
| Returns: | bool |
|---|
Description of this milestone.
datetime representing when this milestone is due.
Return an instance of cls formed from json.
Iterate over the labels for every issue associated with this milestone.
| Parameters: | number (int) – (optional), number of labels to return. Default: -1 returns all available labels. |
|---|---|
| Returns: | generator of Labels |
Identifying number associated with milestone.
Number of issues associated with this milestone which are still
Number of requests before GitHub imposes a ratelimit.
Re-retrieve the information for this object and returns the refreshed instance.
| Parameters: | conditional (bool) – If True, then we will search for a stored header (‘Last-Modified’, or ‘ETag’) on the object and send that as described in the Conditional Requests section of the docs |
|---|---|
| Returns: | self |
The reasoning for the return value is the following example:
repos = [r.refresh() for r in g.iter_repos('kennethreitz')]
Without the return value, that would be an array of None‘s and you would otherwise have to do:
repos = [r for i in g.iter_repos('kennethreitz')]
[r.refresh() for r in repos]
Which is really an anti-pattern.
Changed in version 0.5.
State of the milestone, e.g., open or closed.
Title of the milestone, e.g., 0.2.
Return the json representing this object.
Update this milestone.
state, description, and due_on are optional
| Parameters: |
|
|---|---|
| Returns: | bool |
The Label object. Succintly represents a label that exists in a repository.
See also: http://developer.github.com/v3/issues/labels/
Color of the label, e.g., 626262
Delete this label.
| Returns: | bool |
|---|
Return an instance of cls formed from json.
Name of the label, e.g., ‘bug’
Number of requests before GitHub imposes a ratelimit.
Re-retrieve the information for this object and returns the refreshed instance.
| Parameters: | conditional (bool) – If True, then we will search for a stored header (‘Last-Modified’, or ‘ETag’) on the object and send that as described in the Conditional Requests section of the docs |
|---|---|
| Returns: | self |
The reasoning for the return value is the following example:
repos = [r.refresh() for r in g.iter_repos('kennethreitz')]
Without the return value, that would be an array of None‘s and you would otherwise have to do:
repos = [r for i in g.iter_repos('kennethreitz')]
[r.refresh() for r in repos]
Which is really an anti-pattern.
Changed in version 0.5.
Return the json representing this object.
Update this label.
| Parameters: |
|
|---|---|
| Returns: | bool |