comparison venv/lib/python2.7/site-packages/github/Comparison.py @ 0:d67268158946 draft

planemo upload commit a3f181f5f126803c654b3a66dd4e83a48f7e203b
author bcclaywell
date Mon, 12 Oct 2015 17:43:33 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:d67268158946
1 # -*- coding: utf-8 -*-
2
3 # ########################## Copyrights and license ############################
4 # #
5 # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
6 # Copyright 2012 Zearin <zearin@gonk.net> #
7 # Copyright 2013 AKFish <akfish@gmail.com> #
8 # Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net> #
9 # #
10 # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ #
11 # #
12 # PyGithub is free software: you can redistribute it and/or modify it under #
13 # the terms of the GNU Lesser General Public License as published by the Free #
14 # Software Foundation, either version 3 of the License, or (at your option) #
15 # any later version. #
16 # #
17 # PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
18 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
19 # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
20 # details. #
21 # #
22 # You should have received a copy of the GNU Lesser General Public License #
23 # along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
24 # #
25 # ##############################################################################
26
27 import github.GithubObject
28
29 import github.Commit
30 import github.File
31
32
33 class Comparison(github.GithubObject.CompletableGithubObject):
34 """
35 This class represents Comparisons as returned for example by http://developer.github.com/v3/todo
36 """
37
38 @property
39 def ahead_by(self):
40 """
41 :type: integer
42 """
43 self._completeIfNotSet(self._ahead_by)
44 return self._ahead_by.value
45
46 @property
47 def base_commit(self):
48 """
49 :type: :class:`github.Commit.Commit`
50 """
51 self._completeIfNotSet(self._base_commit)
52 return self._base_commit.value
53
54 @property
55 def behind_by(self):
56 """
57 :type: integer
58 """
59 self._completeIfNotSet(self._behind_by)
60 return self._behind_by.value
61
62 @property
63 def commits(self):
64 """
65 :type: list of :class:`github.Commit.Commit`
66 """
67 self._completeIfNotSet(self._commits)
68 return self._commits.value
69
70 @property
71 def diff_url(self):
72 """
73 :type: string
74 """
75 self._completeIfNotSet(self._diff_url)
76 return self._diff_url.value
77
78 @property
79 def files(self):
80 """
81 :type: list of :class:`github.File.File`
82 """
83 self._completeIfNotSet(self._files)
84 return self._files.value
85
86 @property
87 def html_url(self):
88 """
89 :type: string
90 """
91 self._completeIfNotSet(self._html_url)
92 return self._html_url.value
93
94 @property
95 def merge_base_commit(self):
96 """
97 :type: :class:`github.Commit.Commit`
98 """
99 self._completeIfNotSet(self._merge_base_commit)
100 return self._merge_base_commit.value
101
102 @property
103 def patch_url(self):
104 """
105 :type: string
106 """
107 self._completeIfNotSet(self._patch_url)
108 return self._patch_url.value
109
110 @property
111 def permalink_url(self):
112 """
113 :type: string
114 """
115 self._completeIfNotSet(self._permalink_url)
116 return self._permalink_url.value
117
118 @property
119 def status(self):
120 """
121 :type: string
122 """
123 self._completeIfNotSet(self._status)
124 return self._status.value
125
126 @property
127 def total_commits(self):
128 """
129 :type: integer
130 """
131 self._completeIfNotSet(self._total_commits)
132 return self._total_commits.value
133
134 @property
135 def url(self):
136 """
137 :type: string
138 """
139 self._completeIfNotSet(self._url)
140 return self._url.value
141
142 def _initAttributes(self):
143 self._ahead_by = github.GithubObject.NotSet
144 self._base_commit = github.GithubObject.NotSet
145 self._behind_by = github.GithubObject.NotSet
146 self._commits = github.GithubObject.NotSet
147 self._diff_url = github.GithubObject.NotSet
148 self._files = github.GithubObject.NotSet
149 self._html_url = github.GithubObject.NotSet
150 self._merge_base_commit = github.GithubObject.NotSet
151 self._patch_url = github.GithubObject.NotSet
152 self._permalink_url = github.GithubObject.NotSet
153 self._status = github.GithubObject.NotSet
154 self._total_commits = github.GithubObject.NotSet
155 self._url = github.GithubObject.NotSet
156
157 def _useAttributes(self, attributes):
158 if "ahead_by" in attributes: # pragma no branch
159 self._ahead_by = self._makeIntAttribute(attributes["ahead_by"])
160 if "base_commit" in attributes: # pragma no branch
161 self._base_commit = self._makeClassAttribute(github.Commit.Commit, attributes["base_commit"])
162 if "behind_by" in attributes: # pragma no branch
163 self._behind_by = self._makeIntAttribute(attributes["behind_by"])
164 if "commits" in attributes: # pragma no branch
165 self._commits = self._makeListOfClassesAttribute(github.Commit.Commit, attributes["commits"])
166 if "diff_url" in attributes: # pragma no branch
167 self._diff_url = self._makeStringAttribute(attributes["diff_url"])
168 if "files" in attributes: # pragma no branch
169 self._files = self._makeListOfClassesAttribute(github.File.File, attributes["files"])
170 if "html_url" in attributes: # pragma no branch
171 self._html_url = self._makeStringAttribute(attributes["html_url"])
172 if "merge_base_commit" in attributes: # pragma no branch
173 self._merge_base_commit = self._makeClassAttribute(github.Commit.Commit, attributes["merge_base_commit"])
174 if "patch_url" in attributes: # pragma no branch
175 self._patch_url = self._makeStringAttribute(attributes["patch_url"])
176 if "permalink_url" in attributes: # pragma no branch
177 self._permalink_url = self._makeStringAttribute(attributes["permalink_url"])
178 if "status" in attributes: # pragma no branch
179 self._status = self._makeStringAttribute(attributes["status"])
180 if "total_commits" in attributes: # pragma no branch
181 self._total_commits = self._makeIntAttribute(attributes["total_commits"])
182 if "url" in attributes: # pragma no branch
183 self._url = self._makeStringAttribute(attributes["url"])