mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 19:01:15 +00:00
Merge some simple class' type stubs back to source (#2570)
This commit is contained in:
@@ -23,8 +23,10 @@
|
||||
# along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
|
||||
# #
|
||||
################################################################################
|
||||
from datetime import datetime
|
||||
|
||||
import github.GithubObject
|
||||
from github.GithubObject import Attribute
|
||||
|
||||
|
||||
class StatsCommitActivity(github.GithubObject.NonCompletableGithubObject):
|
||||
@@ -32,33 +34,24 @@ class StatsCommitActivity(github.GithubObject.NonCompletableGithubObject):
|
||||
This class represents StatsCommitActivities. The reference can be found here https://docs.github.com/en/rest/reference/repos#get-the-last-year-of-commit-activity
|
||||
"""
|
||||
|
||||
def _initAttributes(self) -> None:
|
||||
self._week: Attribute[datetime] = github.GithubObject.NotSet
|
||||
self._total: Attribute[int] = github.GithubObject.NotSet
|
||||
self._days: Attribute[int] = github.GithubObject.NotSet
|
||||
|
||||
@property
|
||||
def week(self):
|
||||
"""
|
||||
:type: datetime.datetime
|
||||
"""
|
||||
def week(self) -> datetime:
|
||||
return self._week.value
|
||||
|
||||
@property
|
||||
def total(self):
|
||||
"""
|
||||
:type: int
|
||||
"""
|
||||
def total(self) -> int:
|
||||
return self._total.value
|
||||
|
||||
@property
|
||||
def days(self):
|
||||
"""
|
||||
:type: list of int
|
||||
"""
|
||||
def days(self) -> int:
|
||||
return self._days.value
|
||||
|
||||
def _initAttributes(self):
|
||||
self._week = github.GithubObject.NotSet
|
||||
self._total = github.GithubObject.NotSet
|
||||
self._days = github.GithubObject.NotSet
|
||||
|
||||
def _useAttributes(self, attributes):
|
||||
def _useAttributes(self, attributes) -> None:
|
||||
if "week" in attributes: # pragma no branch
|
||||
self._week = self._makeTimestampAttribute(attributes["week"])
|
||||
if "total" in attributes: # pragma no branch
|
||||
|
||||
Reference in New Issue
Block a user