Skip to content
Snippets Groups Projects
Commit 7d641752 authored by Ian Cordasco's avatar Ian Cordasco
Browse files

Merge remote-tracking branch 'origin/develop'

parents aa0b457c 2ebe4466
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -4,6 +4,7 @@ python:
- 2.7
- 3.2
- 3.3
- 3.4
- pypy
# command to run tests, e.g. python setup.py test
before_script:
Loading
Loading
Loading
Loading
@@ -58,3 +58,7 @@ Contributors
- Vincent Driessen (@nvie)
 
- Philip Chimento (@ptomato)
- Benjamin Gilbert (@bgilbert)
- Daniel Johnson (@danielj7)
History/Changelog
-----------------
 
0.9.0: 2014-05-04
~~~~~~~~~~~~~~~~~
- Add Deployments API
- Add Pages API
- Add support so applications can revoke a `single authorization`_ or `all
authorizations`_ created by the application
- Add the ability for users to ping_ hooks
- Allow users to list a `Repository's collaborators`_
- Allow users to create an empty blob on a Repository
- Update how users can list issues and pull requests. See:
http://developer.github.com/changes/2014-02-28-issue-and-pull-query-enhancements/
This includes breaking changes to ``Repository#iter_pulls``.
- Update methods to handle the `pagination changes`_.
- Fix typo `stargarzers_url`_
- Add ``assets`` attribute to ``Release`` object.
- Fix wrong argument to ``Organization#create_team`` (``permissions`` versus
``permission``)
- Fix Issue Search Result's representation and initialization
- Fix Repository Search Result's initialization
- Allow users to pass a two-factor authentication callback to
``GitHub#authorize``.
.. _single authorization: https://github3py.readthedocs.org/en/latest/github.html#github3.github.GitHub.revoke_authorization
.. _all authorizations: https://github3py.readthedocs.org/en/latest/github.html#github3.github.GitHub.revoke_authorizations
.. _ping: https://github3py.readthedocs.org/en/latest/repos.html?highlight=ping#github3.repos.hook.Hook.ping
.. _Repository's collaborators: https://github3py.readthedocs.org/en/latest/repos.html#github3.repos.repo.Repository.iter_collaborators
.. _pagination changes: https://developer.github.com/changes/2014-03-18-paginating-method-changes/
.. _stargarzers_url: https://github.com/sigmavirus24/github3.py/pull/240
0.8.2: 2014-02-11
~~~~~~~~~~~~~~~~~
 
Loading
Loading
Loading
Loading
@@ -17,20 +17,28 @@ classes should never be instantiated by the user (developer) directly.
Gist Objects
------------
 
.. module:: github3.gists.gist
.. autoclass:: github3.gists.gist.Gist
:inherited-members:
 
------
 
.. module:: github3.gists.comment
.. autoclass:: github3.gists.comment.GistComment
:inherited-members:
 
------
 
.. module:: github3.gists.file
.. autoclass:: github3.gists.file.GistFile
:inherited-members:
 
------
 
.. module:: github3.gists.history
.. autoclass:: github3.gists.history.GistHistory
:inherited-members:
Loading
Loading
@@ -74,6 +74,7 @@ Modules
github
issues
models
notifications
orgs
pulls
repos
Loading
Loading
Loading
Loading
@@ -14,25 +14,35 @@ This part of the documentation covers the module which handles :class:`Issue
Issue Objects
-------------
 
.. module:: github3.issues.issue
.. autoclass:: github3.issues.issue.Issue
:inherited-members:
 
------
 
.. module:: github3.issues.comment
.. autoclass:: github3.issues.comment.IssueComment
:inherited-members:
 
------
 
.. module:: github3.issues.event
.. autoclass:: github3.issues.event.IssueEvent
:inherited-members:
 
------
 
.. module:: github3.issues.milestone
.. autoclass:: github3.issues.milestone.Milestone
:inherited-members:
 
------
 
.. module:: github3.issues.label
.. autoclass:: github3.issues.label.Label
:inherited-members:
.. module:: github3
.. module:: github3.notifications
Notifications
=============
This part of the documentation covers the :class:`Thread <Thread>` and
:class:`Subscription <Subscription>` objects.
Notification Objects
--------------------
.. autoclass:: Thread
:inherited-members:
------
.. autoclass:: Subscription
:inherited-members:
Loading
Loading
@@ -6,9 +6,15 @@ Repository
This part of the documentation covers:
 
- :class:`Repository <github3.repos.repo.Repository>`
- :class:`Asset <github3.repos.release.Asset>`
- :class:`Branch <github3.repos.branch.Branch>`
- :class:`Contents <github3.repos.contents.Contents>`
- :class:`Deployment <github3.repos.deployment.Deployment>`
- :class:`DeploymentStatus <github3.repos.deployment.DeploymentStatus>`
- :class:`Hook <github3.repos.hook.Hook>`
- :class:`PagesInfo <github3.repos.pages.PagesInfo>`
- :class:`PagesBuild <github3.repos.pages.PagesBuild>`
- :class:`Release <github3.repos.release.Release>`
- :class:`RepoTag <github3.repos.tag.RepoTag>`
- :class:`RepoComment <github3.repos.comment.RepoComment>`
- :class:`RepoCommit <github3.repos.commit.RepoCommit>`
Loading
Loading
@@ -31,37 +37,79 @@ sections of the GitHub documentation.
Repository Objects
------------------
 
.. module:: github3.repos.repo
.. autoclass:: github3.repos.repo.Repository
:inherited-members:
 
---------
 
.. module:: github3.repos.branch
.. autoclass:: github3.repos.branch.Branch
:members:
 
---------
 
.. module:: github3.repos.contents
.. autoclass:: github3.repos.contents.Contents
:members:
 
---------
 
.. module:: github3.repos.deployment
.. autoclass:: github3.repos.deployment.Deployment
:members:
---------
.. autoclass:: github3.repos.deployment.DeploymentStatus
:members:
---------
.. module:: github3.repos.release
.. autoclass:: github3.repos.release.Release
:members:
 
---------
.. autoclass:: github3.repos.release.Asset
:members:
 
---------
 
.. module:: github3.repos.hook
.. autoclass:: github3.repos.hook.Hook
:members:
 
---------
 
.. module:: github3.repos.pages
.. autoclass:: github3.repos.pages.PagesInfo
:members:
---------
.. autoclass:: github3.repos.pages.PagesBuild
:members:
---------
.. module:: github3.repos.tag
.. autoclass:: github3.repos.tag.RepoTag
:members:
 
---------
 
.. module:: github3.repos.comment
More information about this class can be found in the official documentation
about `comments <http://developer.github.com/v3/repos/comments/>`_.
 
Loading
Loading
@@ -70,20 +118,28 @@ about `comments <http://developer.github.com/v3/repos/comments/>`_.
 
---------
 
.. module:: github3.repos.commit
.. autoclass:: github3.repos.commit.RepoCommit
:members:
 
---------
 
.. module:: github3.repos.comparison
.. autoclass:: github3.repos.comparison.Comparison
:members:
 
---------
 
.. module:: github3.repos.status
.. autoclass:: github3.repos.status.Status
:members:
 
---------
 
.. module:: github3.repos.stats
.. autoclass:: github3.repos.stats.ContributorStats
:members:
Loading
Loading
@@ -14,7 +14,7 @@ __title__ = 'github3'
__author__ = 'Ian Cordasco'
__license__ = 'Modified BSD'
__copyright__ = 'Copyright 2012-2014 Ian Cordasco'
__version__ = '0.8.2'
__version__ = '0.9.0'
__version_info__ = tuple(int(i) for i in __version__.split('.'))
 
from github3.api import *
Loading
Loading
Loading
Loading
@@ -14,7 +14,7 @@ gh = GitHub()
 
 
def authorize(login, password, scopes, note='', note_url='', client_id='',
client_secret=''):
client_secret='', two_factor_callback=None):
"""Obtain an authorization token for the GitHub API.
 
:param str login: (required)
Loading
Loading
@@ -27,9 +27,13 @@ def authorize(login, password, scopes, note='', note_url='', client_id='',
to create a token
:param str client_secret: (optional), 40 character OAuth client secret for
which to create the token
:param func two_factor_callback: (optional), function to call when a
Two-Factor Authentication code needs to be provided by the user.
:returns: :class:`Authorization <Authorization>`
 
"""
gh = GitHub()
gh.login(two_factor_callback=two_factor_callback)
return gh.authorize(login, password, scopes, note, note_url, client_id,
client_secret)
 
Loading
Loading
@@ -177,12 +181,18 @@ def iter_gists(username=None, number=-1, etag=None):
def iter_repo_issues(owner, repository, milestone=None, state=None,
assignee=None, mentioned=None, labels=None, sort=None,
direction=None, since=None, number=-1, etag=None):
"""Iterate over issues on owner/repository.
"""List issues on owner/repository. Only owner and repository are
required.
.. versionchanged:: 0.9.0
- The ``state`` parameter now accepts 'all' in addition to 'open'
and 'closed'.
 
:param str owner: login of the owner of the repository
:param str repository: name of the repository
:param int milestone: None, '*', or ID of milestone
:param str state: accepted values: ('open', 'closed')
:param str state: accepted values: ('all', 'open', 'closed')
api-default: 'open'
:param str assignee: '*' or login of the user
:param str mentioned: login of the user
Loading
Loading
@@ -200,7 +210,7 @@ def iter_repo_issues(owner, repository, milestone=None, state=None,
Default: -1 returns all issues
:param str etag: (optional), ETag from a previous request to the same
endpoint
:returns: generator of :class:`Issue <github3.issues.Issue>`
:returns: generator of :class:`Issue <github3.issues.Issue>`\ s
 
"""
if owner and repository:
Loading
Loading
Loading
Loading
@@ -6,6 +6,7 @@ github3.auths
This module contains the Authorization object.
 
"""
from __future__ import unicode_literals
 
from github3.decorators import requires_basic_auth
from github3.models import GitHubCore
Loading
Loading
@@ -47,15 +48,11 @@ class Authorization(GitHubCore):
self.id = auth.get('id', 0)
self._api = self._build_url('authorizations', str(self.id))
#: datetime object representing when the authorization was created.
self.created_at = None
if auth.get('created_at'):
self.created_at = self._strptime(auth.get('created_at'))
#: datetime object representing when the authorization was created.
self.updated_at = None
if auth.get('updated_at'):
self.updated_at = self._strptime(auth.get('updated_at'))
self.created_at = self._strptime(auth.get('created_at'))
#: datetime object representing when the authorization was updated.
self.updated_at = self._strptime(auth.get('updated_at'))
 
def __repr__(self):
def _repr(self):
return '<Authorization [{0}]>'.format(self.name)
 
def _update_(self, auth):
Loading
Loading
Loading
Loading
@@ -40,7 +40,7 @@ def requires_auth(func):
from github3.models import GitHubError
# Mock a 401 response
r = generate_fake_error_response(
'{"message": "Requires authentication"}'.encode()
'{"message": "Requires authentication"}'
)
raise GitHubError(r)
return auth_wrapper
Loading
Loading
@@ -61,18 +61,40 @@ def requires_basic_auth(func):
from github3.models import GitHubError
# Mock a 401 response
r = generate_fake_error_response(
('{"message": "Requires username/password authentication"}'
).encode()
'{"message": "Requires username/password authentication"}'
)
raise GitHubError(r)
return auth_wrapper
 
 
def requires_app_credentials(func):
"""Require client_id and client_secret to be associated.
This is used to note and enforce which methods require a client_id and
client_secret to be used.
"""
@wraps(func)
def auth_wrapper(self, *args, **kwargs):
client_id, client_secret = self._session.retrieve_client_credentials()
if client_id and client_secret:
return func(self, *args, **kwargs)
else:
from github3.models import GitHubError
# Mock a 401 response
r = generate_fake_error_response(
'{"message": "Requires username/password authentication"}'
)
raise GitHubError(r)
return auth_wrapper
def generate_fake_error_response(msg, status_code=401, encoding='utf-8'):
r = Response()
r.status_code = status_code
r.encoding = encoding
r.raw = RequestsStringIO(msg)
r.raw = RequestsStringIO(msg.encode())
r._content_consumed = True
r._content = r.raw.read()
return r
Loading
Loading
Loading
Loading
@@ -6,6 +6,7 @@ github3.events
This module contains the class(es) related to Events
 
"""
from __future__ import unicode_literals
 
from github3.models import GitHubObject
 
Loading
Loading
@@ -55,7 +56,7 @@ class Event(GitHubObject):
#: Indicates whether the Event is public or not.
self.public = event.get('public')
 
def __repr__(self):
def _repr(self):
return '<Event [{0}]>'.format(self.type[:-5])
 
@staticmethod
Loading
Loading
Loading
Loading
@@ -6,6 +6,7 @@ github3.gists.comment
Module containing the logic for a GistComment
 
"""
from __future__ import unicode_literals
 
from github3.models import BaseComment
from github3.users import User
Loading
Loading
@@ -38,5 +39,5 @@ class GistComment(BaseComment):
if comment.get('user'):
self.user = User(comment.get('user'), self) # (No coverage)
 
def __repr__(self):
def _repr(self):
return '<Gist Comment [{0}]>'.format(self.user.login)
Loading
Loading
@@ -5,6 +5,7 @@ github3.gists.file
 
Module containing the logic for the GistFile object.
"""
from __future__ import unicode_literals
 
from github3.models import GitHubObject
 
Loading
Loading
@@ -34,5 +35,5 @@ class GistFile(GitHubObject):
#: The content of the file.
self.content = attributes.get('content')
 
def __repr__(self):
def _repr(self):
return '<Gist File [{0}]>'.format(self.name)
Loading
Loading
@@ -6,6 +6,8 @@ github3.gists.gist
This module contains the Gist class alone for simplicity.
 
"""
from __future__ import unicode_literals
from json import dumps
from github3.models import GitHubCore
from github3.decorators import requires_auth
Loading
Loading
@@ -74,14 +76,15 @@ class Gist(GitHubCore):
 
owner = data.get('owner')
#: :class:`User <github3.users.User>` object representing the owner of
# the gist.
#: the gist.
self.owner = User(owner, self) if owner else None
 
self._files = [GistFile(data['files'][f]) for f in data['files']]
#: Number of files in this gist.
self.files = len(self._files)
 
#: History of this gist, list of :class:`GistHistory <GistHistory>`
#: History of this gist, list of
#: :class:`GistHistory <github3.gists.history.GistHistory>`
self.history = [GistHistory(h, self) for h in data.get('history', [])]
 
## New urls
Loading
Loading
@@ -98,7 +101,7 @@ class Gist(GitHubCore):
def __str__(self):
return self.id
 
def __repr__(self):
def _repr(self):
return '<Gist [{0}]>'.format(self.id)
 
def _update_(self, data):
Loading
Loading
@@ -196,7 +199,7 @@ class Gist(GitHubCore):
url = self._build_url('comments', base_url=self._api)
return self._iter(int(number), url, GistComment, etag=etag)
 
def iter_commits(self, number=-1):
def iter_commits(self, number=-1, etag=None):
"""Iter over the commits on this gist.
 
These commits will be requested from the API and should be the same as
Loading
Loading
@@ -204,9 +207,15 @@ class Gist(GitHubCore):
 
.. versionadded:: 0.6
 
.. versionchanged:: 0.9
Added param ``etag``.
:param int number: (optional), number of commits to iterate over.
Default: -1 will iterate over all commits associated with this
gist.
:param str etag: (optional), ETag from a previous request to this
endpoint.
:returns: generator of
:class:`GistHistory <github3.gists.history.GistHistory>`
 
Loading
Loading
@@ -222,13 +231,22 @@ class Gist(GitHubCore):
"""
return iter(self._files)
 
def iter_forks(self):
def iter_forks(self, number=-1, etag=None):
"""Iterator of forks of this gist.
 
.. versionchanged:: 0.9
Added params ``number`` and ``etag``.
:param int number: (optional), number of forks to iterate over.
Default: -1 will iterate over all forks of this gist.
:param str etag: (optional), ETag from a previous request to this
endpoint.
:returns: generator of :class:`Gist <Gist>`
 
"""
return iter(self._forks) # (No coverage)
url = self._build_url('forks', base_url=self._api)
return self._iter(int(number), url, Gist, etag=etag)
 
@requires_auth
def star(self):
Loading
Loading
Loading
Loading
@@ -6,6 +6,7 @@ github3.gists.history
Module containing the logic for the GistHistory object.
 
"""
from __future__ import unicode_literals
 
from github3.models import GitHubCore
from github3.users import User
Loading
Loading
@@ -53,7 +54,7 @@ class GistHistory(GitHubCore):
#: datetime representation of when the commit was made
self.committed_at = self._strptime(history.get('committed_at'))
 
def __repr__(self):
def _repr(self):
return '<Gist History [{0}]>'.format(self.version)
 
def get_gist(self):
Loading
Loading
Loading
Loading
@@ -7,6 +7,7 @@ This module contains all the classes relating to Git Data.
 
See also: http://developer.github.com/v3/git/
"""
from __future__ import unicode_literals
 
from json import dumps
from base64 import b64decode
Loading
Loading
@@ -43,7 +44,7 @@ class Blob(GitHubObject):
#: SHA1 of the blob
self.sha = blob.get('sha')
 
def __repr__(self):
def _repr(self):
return '<Blob [{0:.10}]>'.format(self.sha)
 
 
Loading
Loading
@@ -75,7 +76,7 @@ class Commit(BaseCommit):
super(Commit, self).__init__(commit, session)
 
#: dict containing at least the name, email and date the commit was
# created
#: created
self.author = commit.get('author', {}) or {}
# If GH returns nil/None then make sure author is a dict
self._author_name = self.author.get('name', '')
Loading
Loading
@@ -91,7 +92,7 @@ class Commit(BaseCommit):
if commit.get('tree'):
self.tree = Tree(commit.get('tree'), self._session)
 
def __repr__(self):
def _repr(self):
return '<Commit [{0}:{1}]>'.format(self._author_name, self.sha)
 
def author_as_User(self):
Loading
Loading
@@ -128,7 +129,7 @@ class Reference(GitHubCore):
#: :class:`GitObject <GitObject>` the reference points to
self.object = GitObject(ref.get('object', {}))
 
def __repr__(self):
def _repr(self):
return '<Reference [{0}]>'.format(self.ref)
 
def _update_(self, ref):
Loading
Loading
@@ -169,7 +170,7 @@ class GitObject(GitData):
#: The type of object.
self.type = obj.get('type')
 
def __repr__(self):
def _repr(self):
return '<Git Object [{0}]>'.format(self.sha)
 
 
Loading
Loading
@@ -192,7 +193,7 @@ class Tag(GitData):
#: :class:`GitObject <GitObject>` for the tag
self.object = GitObject(tag.get('object', {}))
 
def __repr__(self):
def _repr(self):
return '<Tag [{0}]>'.format(self.tag)
 
 
Loading
Loading
@@ -209,7 +210,7 @@ class Tree(GitData):
#: list of :class:`Hash <Hash>` objects
self.tree = [Hash(t) for t in tree.get('tree', [])]
 
def __repr__(self):
def _repr(self):
return '<Tree [{0}]>'.format(self.sha)
 
def recurse(self):
Loading
Loading
@@ -245,5 +246,5 @@ class Hash(GitHubObject):
#: URL of this object in the GitHub API
self.url = info.get('url')
 
def __repr__(self):
def _repr(self):
return '<Hash [{0}]>'.format(self.sha)
Loading
Loading
@@ -6,11 +6,11 @@ github3.github
This module contains the main GitHub session object.
 
"""
from __future__ import unicode_literals
 
from json import dumps
from requests import session
from github3.auths import Authorization
from github3.decorators import requires_auth, requires_basic_auth
from github3.decorators import (requires_auth, requires_basic_auth,
requires_app_credentials)
from github3.events import Event
from github3.gists import Gist
from github3.issues import Issue, issue_params
Loading
Loading
@@ -56,7 +56,7 @@ class GitHub(GitHubCore):
elif login and password:
self.login(login, password)
 
def __repr__(self):
def _repr(self):
if self._session.auth:
return '<GitHub [{0[0]}]>'.format(self._session.auth)
return '<GitHub at 0x{0:x}>'.format(id(self))
Loading
Loading
@@ -103,19 +103,23 @@ class GitHub(GitHubCore):
:returns: :class:`Authorization <Authorization>`
"""
json = None
auth = self._session.auth or (login and password)
# TODO: Break this behaviour in 1.0 (Don't rely on self._session.auth)
auth = None
if self._session.auth:
auth = self._session.auth
elif login and password:
auth = (login, password)
if auth:
url = self._build_url('authorizations')
data = {'note': note, 'note_url': note_url,
'client_id': client_id, 'client_secret': client_secret}
if scopes:
data['scopes'] = scopes
if self._session.auth:
with self._session.temporary_basic_auth(*auth):
json = self._json(self._post(url, data=data), 201)
else:
ses = session()
ses.auth = (login, password)
json = self._json(ses.post(url, data=dumps(data)), 201)
return Authorization(json, self) if json else None
 
def check_authorization(self, access_token):
Loading
Loading
@@ -176,10 +180,13 @@ class GitHub(GitHubCore):
formatted
:param str assignee: (optional), Login of person to assign
the issue to
:param str milestone: (optional), Which milestone to assign
the issue to
:param int milestone: (optional), id number of the milestone to
attribute this issue to (e.g. ``m`` is a :class:`Milestone
<github3.issues.Milestone>` object, ``m.number`` is what you pass
here.)
:param list labels: (optional), List of label names.
:returns: :class:`Issue <github3.issues.Issue>`
:returns: :class:`Issue <github3.issues.Issue>` if successful, else
None
"""
repo = None
if owner and repository and title:
Loading
Loading
@@ -581,10 +588,15 @@ class GitHub(GitHubCore):
direction='', since=None, number=-1, etag=None):
"""List all of the authenticated user's (and organization's) issues.
 
.. versionchanged:: 0.9.0
- The ``state`` parameter now accepts 'all' in addition to 'open'
and 'closed'.
:param str filter: accepted values:
('assigned', 'created', 'mentioned', 'subscribed')
api-default: 'assigned'
:param str state: accepted values: ('open', 'closed')
:param str state: accepted values: ('all', 'open', 'closed')
api-default: 'open'
:param str labels: comma-separated list of label names, e.g.,
'bug,ui,@high'
Loading
Loading
@@ -613,10 +625,15 @@ class GitHub(GitHubCore):
"""List only the authenticated user's issues. Will not list
organization's issues
 
.. versionchanged:: 0.9.0
- The ``state`` parameter now accepts 'all' in addition to 'open'
and 'closed'.
:param str filter: accepted values:
('assigned', 'created', 'mentioned', 'subscribed')
api-default: 'assigned'
:param str state: accepted values: ('open', 'closed')
:param str state: accepted values: ('all', 'open', 'closed')
api-default: 'open'
:param str labels: comma-separated list of label names, e.g.,
'bug,ui,@high'
Loading
Loading
@@ -646,10 +663,15 @@ class GitHub(GitHubCore):
"""List issues on owner/repository. Only owner and repository are
required.
 
.. versionchanged:: 0.9.0
- The ``state`` parameter now accepts 'all' in addition to 'open'
and 'closed'.
:param str owner: login of the owner of the repository
:param str repository: name of the repository
:param int milestone: None, '*', or ID of milestone
:param str state: accepted values: ('open', 'closed')
:param str state: accepted values: ('all', 'open', 'closed')
api-default: 'open'
:param str assignee: '*' or login of the user
:param str mentioned: login of the user
Loading
Loading
@@ -1017,6 +1039,43 @@ class GitHub(GitHubCore):
json = self._json(self._get(url), 200)
return Repository(json, self) if json else None
 
@requires_app_credentials
def revoke_authorization(self, access_token):
"""Revoke specified authorization for an OAuth application.
Revoke all authorization tokens created by your application. This will
only work if you have already called ``set_client_id``.
:param str access_token: (required), the access_token to revoke
:returns: bool -- True if successful, False otherwise
"""
client_id, client_secret = self._session.retrieve_client_credentials()
url = self._build_url('applications', str(client_id), 'tokens',
access_token)
with self._session.temporary_basic_auth(client_id, client_secret):
response = self._delete(url, params={'client_id': None,
'client_secret': None})
return self._boolean(response, 204, 404)
@requires_app_credentials
def revoke_authorizations(self):
"""Revoke all authorizations for an OAuth application.
Revoke all authorization tokens created by your application. This will
only work if you have already called ``set_client_id``.
:param str client_id: (required), the client_id of your application
:returns: bool -- True if successful, False otherwise
"""
client_id, client_secret = self._session.retrieve_client_credentials()
url = self._build_url('applications', str(client_id), 'tokens')
with self._session.temporary_basic_auth(client_id, client_secret):
response = self._delete(url, params={'client_id': None,
'client_secret': None})
return self._boolean(response, 204, 404)
def search_code(self, query, sort=None, order=None, per_page=None,
text_match=False, number=-1, etag=None):
"""Find code via the code search API.
Loading
Loading
@@ -1405,7 +1464,7 @@ class GitHubEnterprise(GitHub):
super(GitHubEnterprise, self).__init__(login, password, token)
self._session.base_url = url.rstrip('/') + '/api/v3'
 
def __repr__(self):
def _repr(self):
return '<GitHub Enterprise [0.url]>'.format(self)
 
@requires_auth
Loading
Loading
@@ -1434,7 +1493,7 @@ class GitHubStatus(GitHubCore):
super(GitHubStatus, self).__init__({})
self._session.base_url = 'https://status.github.com'
 
def __repr__(self):
def _repr(self):
return '<GitHub Status>'
 
def _recipe(self, *args):
Loading
Loading
Loading
Loading
@@ -15,10 +15,10 @@ __all__ = [Issue]
 
def issue_params(filter, state, labels, sort, direction, since):
params = {}
if filter in ('assigned', 'created', 'mentioned', 'subscribed'):
if filter in ('assigned', 'created', 'mentioned', 'subscribed', 'all'):
params['filter'] = filter
 
if state in ('open', 'closed'):
if state in ('open', 'closed', 'all'):
params['state'] = state
 
if labels:
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment