Merge some simple class' type stubs back to source (#2570)

This commit is contained in:
Trim21
2023-07-11 15:57:16 +02:00
committed by GitHub
parent 61f9ae6c4b
commit 8bdfc3a0d7
38 changed files with 302 additions and 711 deletions
+11 -18
View File
@@ -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