8000 tests pass, fixes #248 · staticdev/github4.py@8ac6b27 · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on May 22, 2021. It is now read-only.

Commit 8ac6b27

Browse files
committed
tests pass, fixes sigmavirus24#248
1 parent 0eec5f6 commit 8ac6b27

40 files changed

+158
-158
lines changed

github3/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
__version__ = '0.9.1'
1818
__version_info__ = tuple(int(i) for i in __version__.split('.'))
1919

20-
from github3.api import *
21-
from github3.github import GitHub, GitHubEnterprise, GitHubStatus
22-
from github3.models import GitHubError
20+
from .api import *
21+
from .github import GitHub, GitHubEnterprise, GitHubStatus
22+
from .models import GitHubError
2323

2424
# flake8: noqa

github3/auths.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"""
99
from __future__ import unicode_literals
1010

11-
from github3.decorators import requires_basic_auth
12-
from github3.models import GitHubCore
11+
from .decorators import requires_basic_auth
12+
from .models import GitHubCore
1313

1414

1515
class Authorization(GitHubCore):

github3/decorators.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def auth_wrapper(self, *args, **kwargs):
3737
if auth:
3838
return func(self, *args, **kwargs)
3939
else:
40-
from github3.models import GitHubError
40+
from .models import GitHubError
4141
# Mock a 401 response
4242
r = generate_fake_error_response(
4343
'{"message": "Requires authentication"}'
@@ -58,7 +58,7 @@ def auth_wrapper(self, *args, **kwargs):
5858
if hasattr(self, '_session') and self._session.auth:
5959
return func(self, *args, **kwargs)
6060
else:
61-
from github3.models import GitHubError
61+
from .models import GitHubError
6262
# Mock a 401 response
6363
r = generate_fake_error_response(
6464
'{"message": "Requires username/password authentication"}'
@@ -80,7 +80,7 @@ def auth_wrapper(self, *args, **kwargs):
8080
if client_id and client_secret:
8181
return func(self, *args, **kwargs)
8282
else:
83-
from github3.models import GitHubError
83+
from .models import GitHubError
8484
# Mock a 401 response
8585
r = generate_fake_error_response(
8686
'{"message": "Requires username/password authentication"}'

github3/events.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"""
99
from __future__ import unicode_literals
1010

11-
from github3.models import GitHubObject
11+
from .models import GitHubObject
1212

1313

1414
class Event(GitHubObject):
@@ -31,8 +31,8 @@ class Event(GitHubObject):
3131

3232
def __init__(self, event):
3333
super(Event, self).__init__(event)
34-
from github3.users import User
35-
from github3.orgs import Organization
34+
from .users import User
35+
from .orgs import Organization
3636
#: :class:`User <github3.users.User>` object representing the actor.
3737
self.actor = User(event.get('actor')) if event.get('actor') else None
3838
#: datetime object representing when the event was created.
@@ -75,36 +75,36 @@ def is_public(self):
7575

7676

7777
def _commitcomment(payload):
78-
from github3.repos.comment import RepoComment
78+
from .repos.comment import RepoComment
7979
if payload.get('comment'):
8080
payload['comment'] = RepoComment(payload['comment'], None)
8181
return payload
8282

8383

8484
def _follow(payload):
85-
from github3.users import User
85+
from .users import User
8686
if payload.get('target'):
8787
payload['target'] = User(payload['target'], None)
8888
return payload
8989

9090

9191
def _forkev(payload):
92-
from github3.repos import Repository
92+
from .repos import Repository
9393
if payload.get('forkee'):
9494
payload['forkee'] = Repository(payload['forkee'], None)
9595
return payload
9696

9797

9898
def _gist(payload):
99-
from github3.gists import Gist
99+
from .gists import Gist
100100
if payload.get('gist'):
101101
payload['gist'] = Gist(payload['gist'], None)
102102
return payload
103103

104104

105105
def _issuecomm(payload):
106-
from github3.issues import Issue
107-
from github3.issues.comment import IssueComment
106+
from .issues import Issue
107+
from .issues.comment import IssueComment
108108
if payload.get('issue'):
109109
payload['issue'] = Issue(payload['issue'], None)
110110
if payload.get('comment'):
@@ -113,45 +113,45 @@ def _issuecomm(payload):
113113

114114

115115
def _issueevent(payload):
116-
from github3.issues import Issue
116+
from .issues import Issue
117117
if payload.get('issue'):
118118
payload['issue'] = Issue(payload['issue'], None)
119119
return payload
120120

121121

122122
def _member(payload):
123-
from github3.users import User
123+
from .users import User
124124
if payload.get('member'):
125125
payload['member'] = User(payload['member'], None)
126126
return payload
127127

128128

129129
def _pullreqev(payload):
130-
from github3.pulls import PullRequest
130+
from .pulls import PullRequest
131131
if payload.get('pull_request'):
132132
payload['pull_request'] = PullRequest(payload['pull_request'], None)
133133
return payload
134134

135135

136136
def _pullreqcomm(payload):
137-
from github3.pulls import ReviewComment
137+
from .pulls import ReviewComment
138138
if payload.get('comment'):
139139
payload['comment'] = ReviewComment(payload['comment'], None)
140140
return payload
141141

142142

143143
def _release(payload):
144-
from github3.repos.release import Release
144+
from .repos.release import Release
145145
release = payload.get('release')
146146
if release:
147147
payload['release'] = Release(release)
148148
return payload
149149

150150

151151
def _team(payload):
152-
from github3.orgs import Team
153-
from github3.repos import Repository
154-
from github3.users import User
152+
from .orgs import Team
153+
from .repos import Repository
154+
from .users import User
155155
if payload.get('team'):
156156
payload['team'] = Team(payload['team'], None)
157157
if payload.get('repo'):

github3/gists/comment.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"""
99
from __future__ import unicode_literals
1010

11-
from github3.models import BaseComment
12-
from github3.users import User
11+
from ..models import BaseComment
12+
from ..users import User
1313

1414

1515
class GistComment(BaseComment):

github3/gists/file.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"""
88
from __future__ import unicode_literals
99

10-
from github3.models import GitHubObject
10+
from ..models import GitHubObject
1111

1212

1313
class GistFile(GitHubObject):

github3/gists/gist.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
from __future__ import unicode_literals
1010

1111
from json import dumps
12-
from github3.models import GitHubCore
13-
from github3.decorators import requires_auth
14-
from github3.gists.comment import GistComment
15-
from github3.gists.file import GistFile
16-
from github3.gists.history import GistHistory
17-
from github3.users import User
12+
from ..models import GitHubCore
13+
from ..decorators import requires_auth
14+
from .comment import GistComment
15+
from .file import GistFile
16+
from .history import GistHistory
17+
from ..users import User
1818

1919

2020
class Gist(GitHubCore):

github3/gists/history.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"""
99
from __future__ import unicode_literals
1010

11-
from github3.models import 10000 GitHubCore
12-
from github3.users import User
11+
from ..models import GitHubCore
12+
from ..users import User
1313

1414

1515
class GistHistory(GitHubCore):
@@ -63,6 +63,6 @@ def get_gist(self):
6363
:returns: :class:`Gist <github3.gists.gist.Gist>`
6464
6565
"""
66-
from github3.gists.gist import Gist
66+
from .gist import Gist
6767
json = self._json(self._get(self._api), 200)
6868
return Gist(json, self)

github3/git.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111

1212
from json import dumps
1313
from base64 import b64decode
14-
from github3.models import GitHubObject, GitHubCore, BaseCommit
15-
from github3.users import User
16-
from github3.decorators import requires_auth
14+
from .models import GitHubObject, GitHubCore, BaseCommit
15+
from .users import User
16+
from .decorators import requires_auth
1717

1818

1919
class Blob(GitHubObject):

github3/github.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@
88
"""
99
from __future__ import unicode_literals
1010

11-
from github3.auths import Authorization
12-
from github3.decorators import (requires_auth, requires_basic_auth,
11+
from .auths import Authorization
12+
from .decorators import (requires_auth, requires_basic_auth,
1313
requires_app_credentials)
14-
from github3.events import Event
15-
from github3.gists import Gist
16-
from github3.issues import Issue, issue_params
17-
from github3.models import GitHubCore
18-
from github3.orgs import Organization, Team
19-
from github3.repos import Repository
20-
from github3.search import (CodeSearchResult, IssueSearchResult,
14+
from .events import Event
15+
from .gists import Gist
16+
from .issues import Issue, issue_params
17+
from .models import GitHubCore
18+
from .orgs import Organization, Team
19+
from .repos import Repository
20+
from .search import (CodeSearchResult, IssueSearchResult,
2121
RepositorySearchResult, UserSearchResult)
22-
from github3.structs import SearchIterator
23-
from github3.users import User, Key
24-
from github3.notifications import Thread
22+
from .structs import SearchIterator
23+
from .users import User, Key
24+
from .notifications import Thread
2525
from uritemplate import URITemplate
2626

2727

@@ -1459,8 +1459,8 @@ class GitHubEnterprise(GitHub):
14591459
14601460
There is no need to provide the end of the url (e.g., /api/v3/), that will
14611461
be taken care of by us.
1462-
1463-
If you have a self signed SSL for your local github enterprise you can
1462+
1463+
If you have a self signed SSL for your local github enterprise you can
14641464
override the validation by passing `verify=False`.
14651465
"""
14661466
def __init__(self, url, login='', password='', token='', verify=True):

github3/issues/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
See also: http://developer.github.com/v3/issues/
88
"""
99

10-
from github3.utils import timestamp_parameter
10+
from ..utils import timestamp_parameter
1111
from .issue import Issue
1212

1313
__all__ = [Issue]

github3/issues/comment.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# -*- coding: utf-8 -*-
22
from __future__ import unicode_literals
33

4-
from github3.models import BaseComment
5-
from github3.users import User
4+
from ..models import BaseComment
5+
from ..users import User
66

77

88
class IssueComment(BaseComment):

github3/issues/event.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# -*- coding: utf-8 -*-
22
from __future__ import unicode_literals
33

4-
from github3.models import GitHubCore
5-
from github3.users import User
4+
from ..models import GitHubCore
5+
from ..users import User
66

77

88
class IssueEvent(GitHubCore):
@@ -36,7 +36,7 @@ def __init__(self, event, session=None):
3636
#: :class:`Issue <github3.issues.Issue>` where this comment was made.
3737
self.issue = event.get('issue')
3838
if self.issue:
39-
from github3.issues import Issue
39+
from .issue import Issue
4040
self.issue = Issue(self.issue, self)
4141

4242
#: :class:`User <github3.users.User>` who caused this event.

github3/issues/issue.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33

44
from re import match
55
from json import dumps
6-
from github3.decorators import requires_auth
7-
from github3.issues.comment import IssueComment
8-
from github3.issues.event import IssueEvent
9-
from github3.issues.label import Label
10-
from github3.issues.milestone import Milestone
11-
from github3.models import GitHubCore
12-
from github3.users import User
6+
from ..decorators import requires_auth
7+
from .comment import IssueComment
8+
from .event import IssueEvent
9+
from .label import Label
10+
from .milestone import Milestone
11+
from ..models import GitHubCore
12+
from ..users import User
1313
from uritemplate import URITemplate
1414

1515

github3/issues/label.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
from __future__ import unicode_literals
33

44
from json import dumps
5-
from github3.decorators import requires_auth
6-
from github3.models import GitHubCore
5+
from ..decorators import requires_auth
6+
from ..models import GitHubCore
77

88

99
class Label(GitHubCore):

github3/issues/milestone.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
from __future__ import unicode_literals
33

44
from json import dumps
5-
from github3.decorators import requires_auth
6-
from github3.issues.label import Label
7-
from github3.models import GitHubCore
8-
from github3.users import User
5+
from ..decorators import requires_auth
6+
from .label import Label
7+
from ..models import GitHubCore
8+
from ..users import User
99

1010

1111
class Milestone(GitHubCore):

github3/models.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
from json import dumps
1212
from requests.compat import urlparse, is_py2
13-
from github3.decorators import requires_auth
14-
from github3.session import GitHubSession
15-
from github3.utils import UTC
13+
from .decorators import requires_auth
14+
from .session import GitHubSession
15+
from .utils import UTC
1616
from datetime import datetime
1717
from logging import getLogger
1818

@@ -31,7 +31,7 @@ def __init__(self, json):
3131
self.last_modified = json.pop('Last-Modified', None)
3232
self._uniq = json.get('url', None)
3333
self._json_data = json
34-
34+
3535
def to_json(self):
3636
"""Return the json representing this object."""
3737
return self._json_data
@@ -169,7 +169,7 @@ def _iter(self, count, url, cls, params=None, etag=None):
169169
:param params dict: (optional) Parameters for the request
170170
:param str etag: (optional), ETag from the last call
171171
"""
172-
from github3.structs import GitHubIterator
172+
from .structs import GitHubIterator
173173
return GitHubIterator(count, url, cls, self, params, etag)
174174

175175
@property

0 commit comments

Comments
 (0)
0