2
2
"""Module containing the GistHistory object."""
3
3
from __future__ import unicode_literals
4
4
5
+ from .. import models
5
6
from .. import users
6
- from ..models import GitHubCore
7
7
8
8
9
- class GistHistory (GitHubCore ):
9
+ class GistHistory (models . GitHubCore ):
10
10
"""This object represents one version (or revision) of a gist.
11
11
12
12
The GitHub API returns the following attributes:
@@ -53,27 +53,12 @@ class GistHistory(GitHubCore):
53
53
54
54
def _update_attributes (self , history ):
55
55
self .url = self ._api = history ['url' ]
56
-
57
- #: SHA of the commit associated with this version
58
56
self .version = history ['version' ]
59
-
60
- #: user who made these changes
61
57
self .user = users .ShortUser (history ['user' ], self )
62
-
63
- #: dict containing the change status; see also: deletions, additions,
64
- #: total
65
58
self .change_status = history ['change_status' ]
66
-
67
- #: number of additions made
68
59
self .additions = self .change_status ['additions' ]
69
-
70
- #: number of deletions made
71
60
self .deletions = self .change_status ['deletions' ]
72
-
73
- #: total number of changes made
74
61
self .total = self .change_status ['total' ]
75
-
76
- #: datetime representation of when the commit was made
77
62
self .committed_at = self ._strptime (history ['committed_at' ])
78
63
79
64
def _repr (self ):
@@ -82,8 +67,10 @@ def _repr(self):
82
67
def gist (self ):
83
68
"""Retrieve the gist at this version.
84
69
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>`
87
74
"""
88
75
from .gist import Gist
89
76
json = self ._json (self ._get (self ._api ), 200 )
0 commit comments