10000 Clean up gists imports and GistHistory docstrings · pythonthings/github3.py@58eef77 · GitHub
[go: up one dir, main page]

Skip to content

Commit 58eef77

Browse files
committed
Clean up gists imports and GistHistory docstrings
1 parent b21bd44 commit 58eef77

File tree

3 files changed

+11
-24
lines changed

3 files changed

+11
-24
lines changed

github3/gists/file.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
"""Module containing the GistFile object."""
33
from __future__ import unicode_literals
44

5-
from ..models import GitHubCore
5+
from .. import models
66

77

8-
class _GistFile(GitHubCore):
8+
class _GistFile(models.GitHubCore):
99
"""Base for GistFile classes."""
1010

1111
def _update_attributes(self, gistfile):

github3/gists/gist.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44

55
from json import dumps
66

7+
from .. import models
78
from .. import users
89

9-
from ..models import GitHubCore
1010
from ..decorators import requires_auth
1111
from . import comment
1212
from . import file as gistfile
1313
from . import history
1414

1515

16-
class _Gist(GitHubCore):
16+
class _Gist(models.GitHubCore):
1717
"""This object holds all the information returned by Github about a gist.
1818
1919
With it you can comment on or fork the gist (assuming you are
@@ -309,7 +309,7 @@ class ShortGist(_Gist):
309309
class_name = 'ShortGist'
310310

311311

312-
class GistFork(GitHubCore):
312+
class GistFork(models.GitHubCore):
313313
"""This object represents a forked Gist.
314314
315315
This has a subset of attributes of a

github3/gists/history.py

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
"""Module containing the GistHistory object."""
33
from __future__ import unicode_literals
44

5+
from .. import models
56
from .. import users
6-
from ..models import GitHubCore
77

88

9-
class GistHistory(GitHubCore):
9+
class GistHistory(models.GitHubCore):
1010
"""This object represents one version (or revision) of a gist.
1111
1212
The GitHub API returns the following attributes:
@@ -53,27 +53,12 @@ class GistHistory(GitHubCore):
5353

5454
def _update_attributes(self, history):
5555
self.url = self._api = history['url']
56-
57-
#: SHA of the commit associated with this version
5856
self.version = history['version']
59-
60-
#: user who made these changes
6157
self.user = users.ShortUser(history['user'], self)
62-
63-
#: dict containing the change status; see also: deletions, additions,
64-
#: total
6558
self.change_status = history['change_status']
66-
67-
#: number of additions made
6859
self.additions = self.change_status['additions']
69-
70-
#: number of deletions made
7160
self.deletions = self.change_status['deletions']
72-
73-
#: total number of changes made
7461
self.total = self.change_status['total']
75-
76-
#: datetime representation of when the commit was made
7762
self.committed_at = self._strptime(history['committed_at'])
7863

7964
def _repr(self):
@@ -82,8 +67,10 @@ def _repr(self):
8267
def gist(self):
8368
"""Retrieve the gist at this version.
8469
85-
:returns: the gist at this point in history or ``None``
86-
:rtype: :class:`Gist <github3.gists.gist.Gist>`
70+
:returns:
71+
the gist at this point in history or ``None``
72+
:rtype:
73+
:class:`Gist <github3.gists.gist.Gist>`
8774
"""
8875
from .gist import Gist
8976
json = self._json(self._get(self._api), 200)

0 commit comments

Comments
 (0)
0