Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita2ee875

Browse files
committed
Make a few changes I forgot I needed to make.
1 parent58a2278 commita2ee875

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

‎github3/event.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Event(GitHubCore):
1515
section of the GitHub API.
1616
"""
1717
def__init__(self,event,session=None):
18-
super(Event,self).__init__(session)
18+
super(Event,self).__init__(event,session)
1919
from .userimportUser
2020
from .orgimportOrganization
2121
self._created=self._strptime(event.get('created_at'))

‎github3/gist.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,14 @@ class Gist(GitHubCore):
7575
"""
7676

7777
def__init__(self,data,session=None):
78-
super(Gist,self).__init__(session)
79-
78+
super(Gist,self).__init__(data,session)
8079
self._update_(data)
8180

8281
def__repr__(self):
8382
return'<Gist [%s]>'%self._id
8483

8584
def_update_(self,data):
85+
self._json_data=data
8686
# The gist identifier
8787
self._id=data.get('id')
8888
self._desc=data.get('description')
@@ -112,6 +112,7 @@ def _update_(self, data):
112112
forfileindata['files']:
113113
self._files.append(GistFile(data['files'][file]))
114114

115+
@GitHubCore.requires_auth
115116
defcreate_comment(self,body):
116117
"""Create a comment on this gist.
117118

‎github3/git.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class GitData(GitHubCore):
4848
common items among other Git Data objects.
4949
"""
5050
def__init__(self,data,session=None):
51-
super(GitData,self).__init__(session)
51+
super(GitData,self).__init__(data,session)
5252
self._sha=data.get('sha')
5353
self._api=data.get('url')
5454

‎github3/github.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
classGitHub(GitHubCore):
2222
"""Stores all the session information."""
23-
def__init__(self):
23+
def__init__(self,login='',password=''):
2424
super(GitHub,self).__init__({})
2525
# Only accept JSON responses
2626
self._session.headers.update(
@@ -30,6 +30,8 @@ def __init__(self):
3030
# Identify who we are
3131
self._session.config['base_headers'].update(
3232
{'User-Agent':'github3.py/pre-alpha'})
33+
ifloginandpassword:
34+
self.login(login,password)
3335

3436
def__repr__(self):
3537
return'<GitHub at 0x%x>'%id(self)
@@ -723,7 +725,7 @@ def unwatch(self, login, repo):
723725
classAuthorization(GitHubCore):
724726
"""The :class:`Authorization <Authorization>` object."""
725727
def__init__(self,auth,session):
726-
super(Authorization,self).__init__(session)
728+
super(Authorization,self).__init__(auth,session)
727729
self._update_(auth)
728730

729731
def__repr__(self):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp