Mercurial > repos > bcclaywell > argo_navis
comparison venv/lib/python2.7/site-packages/github/Download.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 | |
30 class Download(github.GithubObject.CompletableGithubObject): | |
31 """ | |
32 This class represents Downloads as returned for example by http://developer.github.com/v3/todo | |
33 """ | |
34 | |
35 @property | |
36 def accesskeyid(self): | |
37 """ | |
38 :type: string | |
39 """ | |
40 self._completeIfNotSet(self._accesskeyid) | |
41 return self._accesskeyid.value | |
42 | |
43 @property | |
44 def acl(self): | |
45 """ | |
46 :type: string | |
47 """ | |
48 self._completeIfNotSet(self._acl) | |
49 return self._acl.value | |
50 | |
51 @property | |
52 def bucket(self): | |
53 """ | |
54 :type: string | |
55 """ | |
56 self._completeIfNotSet(self._bucket) | |
57 return self._bucket.value | |
58 | |
59 @property | |
60 def content_type(self): | |
61 """ | |
62 :type: string | |
63 """ | |
64 self._completeIfNotSet(self._content_type) | |
65 return self._content_type.value | |
66 | |
67 @property | |
68 def created_at(self): | |
69 """ | |
70 :type: datetime.datetime | |
71 """ | |
72 self._completeIfNotSet(self._created_at) | |
73 return self._created_at.value | |
74 | |
75 @property | |
76 def description(self): | |
77 """ | |
78 :type: string | |
79 """ | |
80 self._completeIfNotSet(self._description) | |
81 return self._description.value | |
82 | |
83 @property | |
84 def download_count(self): | |
85 """ | |
86 :type: integer | |
87 """ | |
88 self._completeIfNotSet(self._download_count) | |
89 return self._download_count.value | |
90 | |
91 @property | |
92 def expirationdate(self): | |
93 """ | |
94 :type: datetime.datetime | |
95 """ | |
96 self._completeIfNotSet(self._expirationdate) | |
97 return self._expirationdate.value | |
98 | |
99 @property | |
100 def html_url(self): | |
101 """ | |
102 :type: string | |
103 """ | |
104 self._completeIfNotSet(self._html_url) | |
105 return self._html_url.value | |
106 | |
107 @property | |
108 def id(self): | |
109 """ | |
110 :type: integer | |
111 """ | |
112 self._completeIfNotSet(self._id) | |
113 return self._id.value | |
114 | |
115 @property | |
116 def mime_type(self): | |
117 """ | |
118 :type: string | |
119 """ | |
120 self._completeIfNotSet(self._mime_type) | |
121 return self._mime_type.value | |
122 | |
123 @property | |
124 def name(self): | |
125 """ | |
126 :type: string | |
127 """ | |
128 self._completeIfNotSet(self._name) | |
129 return self._name.value | |
130 | |
131 @property | |
132 def path(self): | |
133 """ | |
134 :type: string | |
135 """ | |
136 self._completeIfNotSet(self._path) | |
137 return self._path.value | |
138 | |
139 @property | |
140 def policy(self): | |
141 """ | |
142 :type: string | |
143 """ | |
144 self._completeIfNotSet(self._policy) | |
145 return self._policy.value | |
146 | |
147 @property | |
148 def prefix(self): | |
149 """ | |
150 :type: string | |
151 """ | |
152 self._completeIfNotSet(self._prefix) | |
153 return self._prefix.value | |
154 | |
155 @property | |
156 def redirect(self): | |
157 """ | |
158 :type: bool | |
159 """ | |
160 self._completeIfNotSet(self._redirect) | |
161 return self._redirect.value | |
162 | |
163 @property | |
164 def s3_url(self): | |
165 """ | |
166 :type: string | |
167 """ | |
168 self._completeIfNotSet(self._s3_url) | |
169 return self._s3_url.value | |
170 | |
171 @property | |
172 def signature(self): | |
173 """ | |
174 :type: string | |
175 """ | |
176 self._completeIfNotSet(self._signature) | |
177 return self._signature.value | |
178 | |
179 @property | |
180 def size(self): | |
181 """ | |
182 :type: integer | |
183 """ | |
184 self._completeIfNotSet(self._size) | |
185 return self._size.value | |
186 | |
187 @property | |
188 def url(self): | |
189 """ | |
190 :type: string | |
191 """ | |
192 self._completeIfNotSet(self._url) | |
193 return self._url.value | |
194 | |
195 def delete(self): | |
196 """ | |
197 :calls: `DELETE /repos/:owner/:repo/downloads/:id <http://developer.github.com/v3/repos/downloads>`_ | |
198 :rtype: None | |
199 """ | |
200 headers, data = self._requester.requestJsonAndCheck( | |
201 "DELETE", | |
202 self.url | |
203 ) | |
204 | |
205 def _initAttributes(self): | |
206 self._accesskeyid = github.GithubObject.NotSet | |
207 self._acl = github.GithubObject.NotSet | |
208 self._bucket = github.GithubObject.NotSet | |
209 self._content_type = github.GithubObject.NotSet | |
210 self._created_at = github.GithubObject.NotSet | |
211 self._description = github.GithubObject.NotSet | |
212 self._download_count = github.GithubObject.NotSet | |
213 self._expirationdate = github.GithubObject.NotSet | |
214 self._html_url = github.GithubObject.NotSet | |
215 self._id = github.GithubObject.NotSet | |
216 self._mime_type = github.GithubObject.NotSet | |
217 self._name = github.GithubObject.NotSet | |
218 self._path = github.GithubObject.NotSet | |
219 self._policy = github.GithubObject.NotSet | |
220 self._prefix = github.GithubObject.NotSet | |
221 self._redirect = github.GithubObject.NotSet | |
222 self._s3_url = github.GithubObject.NotSet | |
223 self._signature = github.GithubObject.NotSet | |
224 self._size = github.GithubObject.NotSet | |
225 self._url = github.GithubObject.NotSet | |
226 | |
227 def _useAttributes(self, attributes): | |
228 if "accesskeyid" in attributes: # pragma no branch | |
229 self._accesskeyid = self._makeStringAttribute(attributes["accesskeyid"]) # pragma no cover (was covered only by create_download, which has been removed) | |
230 if "acl" in attributes: # pragma no branch | |
231 self._acl = self._makeStringAttribute(attributes["acl"]) # pragma no cover (was covered only by create_download, which has been removed) | |
232 if "bucket" in attributes: # pragma no branch | |
233 self._bucket = self._makeStringAttribute(attributes["bucket"]) # pragma no cover (was covered only by create_download, which has been removed) | |
234 if "content_type" in attributes: # pragma no branch | |
235 self._content_type = self._makeStringAttribute(attributes["content_type"]) | |
236 if "created_at" in attributes: # pragma no branch | |
237 self._created_at = self._makeDatetimeAttribute(attributes["created_at"]) | |
238 if "description" in attributes: # pragma no branch | |
239 self._description = self._makeStringAttribute(attributes["description"]) | |
240 if "download_count" in attributes: # pragma no branch | |
241 self._download_count = self._makeIntAttribute(attributes["download_count"]) | |
242 if "expirationdate" in attributes: # pragma no branch | |
243 self._expirationdate = self._makeDatetimeAttribute(attributes["expirationdate"]) # pragma no cover (was covered only by create_download, which has been removed) | |
244 if "html_url" in attributes: # pragma no branch | |
245 self._html_url = self._makeStringAttribute(attributes["html_url"]) | |
246 if "id" in attributes: # pragma no branch | |
247 self._id = self._makeIntAttribute(attributes["id"]) | |
248 if "mime_type" in attributes: # pragma no branch | |
249 self._mime_type = self._makeStringAttribute(attributes["mime_type"]) # pragma no cover (was covered only by create_download, which has been removed) | |
250 if "name" in attributes: # pragma no branch | |
251 self._name = self._makeStringAttribute(attributes["name"]) | |
252 if "path" in attributes: # pragma no branch | |
253 self._path = self._makeStringAttribute(attributes["path"]) # pragma no cover (was covered only by create_download, which has been removed) | |
254 if "policy" in attributes: # pragma no branch | |
255 self._policy = self._makeStringAttribute(attributes["policy"]) # pragma no cover (was covered only by create_download, which has been removed) | |
256 if "prefix" in attributes: # pragma no branch | |
257 self._prefix = self._makeStringAttribute(attributes["prefix"]) # pragma no cover (was covered only by create_download, which has been removed) | |
258 if "redirect" in attributes: # pragma no branch | |
259 self._redirect = self._makeBoolAttribute(attributes["redirect"]) # pragma no cover (was covered only by create_download, which has been removed) | |
260 if "s3_url" in attributes: # pragma no branch | |
261 self._s3_url = self._makeStringAttribute(attributes["s3_url"]) # pragma no cover (was covered only by create_download, which has been removed) | |
262 if "signature" in attributes: # pragma no branch | |
263 self._signature = self._makeStringAttribute(attributes["signature"]) # pragma no cover (was covered only by create_download, which has been removed) | |
264 if "size" in attributes: # pragma no branch | |
265 self._size = self._makeIntAttribute(attributes["size"]) | |
266 if "url" in attributes: # pragma no branch | |
267 self._url = self._makeStringAttribute(attributes["url"]) |