Skip to content

Commit 375f53b

Browse files
committed
Merge tag '0.9.0' into debian
Release v0.9.0
2 parents b785bc3 + 7d64175 commit 375f53b

File tree

99 files changed

+1637
-374
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+1637
-374
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ python:
44
- 2.7
55
- 3.2
66
- 3.3
7+
- 3.4
78
- pypy
89
# command to run tests, e.g. python setup.py test
910
before_script:

AUTHORS.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,7 @@ Contributors
5858
- Vincent Driessen (@nvie)
5959

6060
- Philip Chimento (@ptomato)
61+
62+
- Benjamin Gilbert (@bgilbert)
63+
64+
- Daniel Johnson (@danielj7)

HISTORY.rst

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,49 @@
11
History/Changelog
22
-----------------
33

4+
0.9.0: 2014-05-04
5+
~~~~~~~~~~~~~~~~~
6+
7+
- Add Deployments API
8+
9+
- Add Pages API
10+
11+
- Add support so applications can revoke a `single authorization`_ or `all
12+
authorizations`_ created by the application
13+
14+
- Add the ability for users to ping_ hooks
15+
16+
- Allow users to list a `Repository's collaborators`_
17+
18+
- Allow users to create an empty blob on a Repository
19+
20+
- Update how users can list issues and pull requests. See:
21+
http://developer.github.com/changes/2014-02-28-issue-and-pull-query-enhancements/
22+
This includes breaking changes to ``Repository#iter_pulls``.
23+
24+
- Update methods to handle the `pagination changes`_.
25+
26+
- Fix typo `stargarzers_url`_
27+
28+
- Add ``assets`` attribute to ``Release`` object.
29+
30+
- Fix wrong argument to ``Organization#create_team`` (``permissions`` versus
31+
``permission``)
32+
33+
- Fix Issue Search Result's representation and initialization
34+
35+
- Fix Repository Search Result's initialization
36+
37+
- Allow users to pass a two-factor authentication callback to
38+
``GitHub#authorize``.
39+
40+
.. _single authorization: https://github3py.readthedocs.org/en/latest/github.html#github3.github.GitHub.revoke_authorization
41+
.. _all authorizations: https://github3py.readthedocs.org/en/latest/github.html#github3.github.GitHub.revoke_authorizations
42+
.. _ping: https://github3py.readthedocs.org/en/latest/repos.html?highlight=ping#github3.repos.hook.Hook.ping
43+
.. _Repository's collaborators: https://github3py.readthedocs.org/en/latest/repos.html#github3.repos.repo.Repository.iter_collaborators
44+
.. _pagination changes: https://developer.github.com/changes/2014-03-18-paginating-method-changes/
45+
.. _stargarzers_url: https://github.com/sigmavirus24/github3.py/pull/240
46+
447
0.8.2: 2014-02-11
548
~~~~~~~~~~~~~~~~~
649

docs/gists.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,28 @@ classes should never be instantiated by the user (developer) directly.
1717
Gist Objects
1818
------------
1919

20+
.. module:: github3.gists.gist
21+
2022
.. autoclass:: github3.gists.gist.Gist
2123
:inherited-members:
2224

2325
------
2426

27+
.. module:: github3.gists.comment
28+
2529
.. autoclass:: github3.gists.comment.GistComment
2630
:inherited-members:
2731

2832
------
2933

34+
.. module:: github3.gists.file
35+
3036
.. autoclass:: github3.gists.file.GistFile
3137
:inherited-members:
3238

3339
------
3440

41+
.. module:: github3.gists.history
42+
3543
.. autoclass:: github3.gists.history.GistHistory
3644
:inherited-members:

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ Modules
7474
github
7575
issues
7676
models
77+
notifications
7778
orgs
7879
pulls
7980
repos

docs/issues.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,35 @@ This part of the documentation covers the module which handles :class:`Issue
1414
Issue Objects
1515
-------------
1616

17+
.. module:: github3.issues.issue
18+
1719
.. autoclass:: github3.issues.issue.Issue
1820
:inherited-members:
1921

2022
------
2123

24+
.. module:: github3.issues.comment
25+
2226
.. autoclass:: github3.issues.comment.IssueComment
2327
:inherited-members:
2428

2529
------
2630

31+
.. module:: github3.issues.event
32+
2733
.. autoclass:: github3.issues.event.IssueEvent
2834
:inherited-members:
2935

3036
------
3137

38+
.. module:: github3.issues.milestone
39+
3240
.. autoclass:: github3.issues.milestone.Milestone
3341
:inherited-members:
3442

3543
------
3644

45+
.. module:: github3.issues.label
46+
3747
.. autoclass:: github3.issues.label.Label
3848
:inherited-members:

docs/notifications.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
.. module:: github3
2+
.. module:: github3.notifications
3+
4+
Notifications
5+
=============
6+
7+
This part of the documentation covers the :class:`Thread <Thread>` and
8+
:class:`Subscription <Subscription>` objects.
9+
10+
Notification Objects
11+
--------------------
12+
13+
.. autoclass:: Thread
14+
:inherited-members:
15+
16+
------
17+
18+
.. autoclass:: Subscription
19+
:inherited-members:

docs/repos.rst

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@ Repository
66
This part of the documentation covers:
77

88
- :class:`Repository <github3.repos.repo.Repository>`
9+
- :class:`Asset <github3.repos.release.Asset>`
910
- :class:`Branch <github3.repos.branch.Branch>`
1011
- :class:`Contents <github3.repos.contents.Contents>`
12+
- :class:`Deployment <github3.repos.deployment.Deployment>`
13+
- :class:`DeploymentStatus <github3.repos.deployment.DeploymentStatus>`
1114
- :class:`Hook <github3.repos.hook.Hook>`
15+
- :class:`PagesInfo <github3.repos.pages.PagesInfo>`
16+
- :class:`PagesBuild <github3.repos.pages.PagesBuild>`
17+
- :class:`Release <github3.repos.release.Release>`
1218
- :class:`RepoTag <github3.repos.tag.RepoTag>`
1319
- :class:`RepoComment <github3.repos.comment.RepoComment>`
1420
- :class:`RepoCommit <github3.repos.commit.RepoCommit>`
@@ -31,37 +37,79 @@ sections of the GitHub documentation.
3137
Repository Objects
3238
------------------
3339

40+
.. module:: github3.repos.repo
41+
3442
.. autoclass:: github3.repos.repo.Repository
3543
:inherited-members:
3644

3745
---------
3846

47+
.. module:: github3.repos.branch
48+
3949
.. autoclass:: github3.repos.branch.Branch
4050
:members:
4151

4252
---------
4353

54+
.. module:: github3.repos.contents
55+
4456
.. autoclass:: github3.repos.contents.Contents
4557
:members:
4658

4759
---------
4860

61+
.. module:: github3.repos.deployment
62+
63+
.. autoclass:: github3.repos.deployment.Deployment
64+
:members:
65+
66+
---------
67+
68+
.. autoclass:: github3.repos.deployment.DeploymentStatus
69+
:members:
70+
71+
---------
72+
73+
.. module:: github3.repos.release
74+
4975
.. autoclass:: github3.repos.release.Release
5076
:members:
5177

78+
---------
79+
80+
.. autoclass:: github3.repos.release.Asset
81+
:members:
5282

5383
---------
5484

85+
.. module:: github3.repos.hook
86+
5587
.. autoclass:: github3.repos.hook.Hook
5688
:members:
5789

5890
---------
5991

92+
.. module:: github3.repos.pages
93+
94+
.. autoclass:: github3.repos.pages.PagesInfo
95+
:members:
96+
97+
---------
98+
99+
.. autoclass:: github3.repos.pages.PagesBuild
100+
:members:
101+
102+
---------
103+
104+
.. module:: github3.repos.tag
105+
60106
.. autoclass:: github3.repos.tag.RepoTag
61107
:members:
62108

63109
---------
64110

111+
.. module:: github3.repos.comment
112+
65113
More information about this class can be found in the official documentation
66114
about `comments <http://developer.github.com/v3/repos/comments/>`_.
67115

@@ -70,20 +118,28 @@ about `comments <http://developer.github.com/v3/repos/comments/>`_.
70118

71119
---------
72120

121+
.. module:: github3.repos.commit
122+
73123
.. autoclass:: github3.repos.commit.RepoCommit
74124
:members:
75125

76126
---------
77127

128+
.. module:: github3.repos.comparison
129+
78130
.. autoclass:: github3.repos.comparison.Comparison
79131
:members:
80132

81133
---------
82134

135+
.. module:: github3.repos.status
136+
83137
.. autoclass:: github3.repos.status.Status
84138
:members:
85139

86140
---------
87141

142+
.. module:: github3.repos.stats
143+
88144
.. autoclass:: github3.repos.stats.ContributorStats
89145
:members:

github3/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
__author__ = 'Ian Cordasco'
1515
__license__ = 'Modified BSD'
1616
__copyright__ = 'Copyright 2012-2014 Ian Cordasco'
17-
__version__ = '0.8.2'
17+
__version__ = '0.9.0'
1818
__version_info__ = tuple(int(i) for i in __version__.split('.'))
1919

2020
from github3.api import *

github3/api.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515

1616
def authorize(login, password, scopes, note='', note_url='', client_id='',
17-
client_secret=''):
17+
client_secret='', two_factor_callback=None):
1818
"""Obtain an authorization token for the GitHub API.
1919
2020
:param str login: (required)
@@ -27,9 +27,13 @@ def authorize(login, password, scopes, note='', note_url='', client_id='',
2727
to create a token
2828
:param str client_secret: (optional), 40 character OAuth client secret for
2929
which to create the token
30+
:param func two_factor_callback: (optional), function to call when a
31+
Two-Factor Authentication code needs to be provided by the user.
3032
:returns: :class:`Authorization <Authorization>`
3133
3234
"""
35+
gh = GitHub()
36+
gh.login(two_factor_callback=two_factor_callback)
3337
return gh.authorize(login, password, scopes, note, note_url, client_id,
3438
client_secret)
3539

@@ -177,12 +181,18 @@ def iter_gists(username=None, number=-1, etag=None):
177181
def iter_repo_issues(owner, repository, milestone=None, state=None,
178182
assignee=None, mentioned=None, labels=None, sort=None,
179183
direction=None, since=None, number=-1, etag=None):
180-
"""Iterate over issues on owner/repository.
184+
"""List issues on owner/repository. Only owner and repository are
185+
required.
186+
187+
.. versionchanged:: 0.9.0
188+
189+
- The ``state`` parameter now accepts 'all' in addition to 'open'
190+
and 'closed'.
181191
182192
:param str owner: login of the owner of the repository
183193
:param str repository: name of the repository
184194
:param int milestone: None, '*', or ID of milestone
185-
:param str state: accepted values: ('open', 'closed')
195+
:param str state: accepted values: ('all', 'open', 'closed')
186196
api-default: 'open'
187197
:param str assignee: '*' or login of the user
188198
:param str mentioned: login of the user
@@ -200,7 +210,7 @@ def iter_repo_issues(owner, repository, milestone=None, state=None,
200210
Default: -1 returns all issues
201211
:param str etag: (optional), ETag from a previous request to the same
202212
endpoint
203-
:returns: generator of :class:`Issue <github3.issues.Issue>`
213+
:returns: generator of :class:`Issue <github3.issues.Issue>`\ s
204214
205215
"""
206216
if owner and repository:

github3/auths.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
This module contains the Authorization object.
77
88
"""
9+
from __future__ import unicode_literals
910

1011
from github3.decorators import requires_basic_auth
1112
from github3.models import GitHubCore
@@ -47,15 +48,11 @@ def __init__(self, auth, session=None):
4748
self.id = auth.get('id', 0)
4849
self._api = self._build_url('authorizations', str(self.id))
4950
#: datetime object representing when the authorization was created.
50-
self.created_at = None
51-
if auth.get('created_at'):
52-
self.created_at = self._strptime(auth.get('created_at'))
53-
#: datetime object representing when the authorization was created.
54-
self.updated_at = None
55-
if auth.get('updated_at'):
56-
self.updated_at = self._strptime(auth.get('updated_at'))
51+
self.created_at = self._strptime(auth.get('created_at'))
52+
#: datetime object representing when the authorization was updated.
53+
self.updated_at = self._strptime(auth.get('updated_at'))
5754

58-
def __repr__(self):
55+
def _repr(self):
5956
return '<Authorization [{0}]>'.format(self.name)
6057

6158
def _update_(self, auth):

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy