Mercurial > repos > bcclaywell > argo_navis
comparison venv/lib/python2.7/site-packages/github/StatsCommitActivity.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 2013 Vincent Jacques <vincent@vincent-jacques.net> # | |
| 6 # # | |
| 7 # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # | |
| 8 # # | |
| 9 # PyGithub is free software: you can redistribute it and/or modify it under # | |
| 10 # the terms of the GNU Lesser General Public License as published by the Free # | |
| 11 # Software Foundation, either version 3 of the License, or (at your option) # | |
| 12 # any later version. # | |
| 13 # # | |
| 14 # PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY # | |
| 15 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # | |
| 16 # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more # | |
| 17 # details. # | |
| 18 # # | |
| 19 # You should have received a copy of the GNU Lesser General Public License # | |
| 20 # along with PyGithub. If not, see <http://www.gnu.org/licenses/>. # | |
| 21 # # | |
| 22 # ############################################################################## | |
| 23 | |
| 24 import github.GithubObject | |
| 25 | |
| 26 | |
| 27 class StatsCommitActivity(github.GithubObject.NonCompletableGithubObject): | |
| 28 """ | |
| 29 This class represents statistics of commit activity. The reference can be found here http://developer.github.com/v3/repos/statistics/#get-the-last-year-of-commit-activity-data | |
| 30 """ | |
| 31 | |
| 32 @property | |
| 33 def week(self): | |
| 34 """ | |
| 35 :type: datetime.datetime | |
| 36 """ | |
| 37 return self._week.value | |
| 38 | |
| 39 @property | |
| 40 def total(self): | |
| 41 """ | |
| 42 :type: int | |
| 43 """ | |
| 44 return self._total.value | |
| 45 | |
| 46 @property | |
| 47 def days(self): | |
| 48 """ | |
| 49 :type: list of int | |
| 50 """ | |
| 51 return self._days.value | |
| 52 | |
| 53 def _initAttributes(self): | |
| 54 self._week = github.GithubObject.NotSet | |
| 55 self._total = github.GithubObject.NotSet | |
| 56 self._days = github.GithubObject.NotSet | |
| 57 | |
| 58 def _useAttributes(self, attributes): | |
| 59 if "week" in attributes: # pragma no branch | |
| 60 self._week = self._makeTimestampAttribute(attributes["week"]) | |
| 61 if "total" in attributes: # pragma no branch | |
| 62 self._total = self._makeIntAttribute(attributes["total"]) | |
| 63 if "days" in attributes: # pragma no branch | |
| 64 self._days = self._makeListOfIntsAttribute(attributes["days"]) |
