From 09025b97b34d9694d43a40f16a7641ff7e91ba36 Mon Sep 17 00:00:00 2001 From: Trim21 Date: Fri, 18 Aug 2023 03:41:02 +0800 Subject: [PATCH] Merge `Permissions` type stub back to source (#2648) Co-authored-by: Enrico Minack --- github/Permissions.py | 44 ++++++++++++++---------------------------- github/Permissions.pyi | 18 ----------------- 2 files changed, 14 insertions(+), 48 deletions(-) delete mode 100644 github/Permissions.pyi diff --git a/github/Permissions.py b/github/Permissions.py index af493894..a136d901 100644 --- a/github/Permissions.py +++ b/github/Permissions.py @@ -27,17 +27,23 @@ # along with PyGithub. If not, see . # # # ################################################################################ - from typing import Any, Dict -import github.GithubObject +from github.GithubObject import Attribute, NonCompletableGithubObject, NotSet -class Permissions(github.GithubObject.NonCompletableGithubObject): +class Permissions(NonCompletableGithubObject): """ This class represents Permissions """ + def _initAttributes(self) -> None: + self._admin: Attribute[bool] = NotSet + self._maintain: Attribute[bool] = NotSet + self._pull: Attribute[bool] = NotSet + self._push: Attribute[bool] = NotSet + self._triage: Attribute[bool] = NotSet + def __repr__(self) -> str: return self.get__repr__( { @@ -50,47 +56,25 @@ class Permissions(github.GithubObject.NonCompletableGithubObject): ) @property - def admin(self): - """ - :type: bool - """ + def admin(self) -> bool: return self._admin.value @property - def maintain(self): - """ - :type: bool - """ + def maintain(self) -> bool: return self._maintain.value @property - def pull(self): - """ - :type: bool - """ + def pull(self) -> bool: return self._pull.value @property - def push(self): - """ - :type: bool - """ + def push(self) -> bool: return self._push.value @property - def triage(self): - """ - :type: bool - """ + def triage(self) -> bool: return self._triage.value - def _initAttributes(self) -> None: - self._admin = github.GithubObject.NotSet - self._maintain = github.GithubObject.NotSet - self._pull = github.GithubObject.NotSet - self._push = github.GithubObject.NotSet - self._triage = github.GithubObject.NotSet - def _useAttributes(self, attributes: Dict[str, Any]) -> None: if "admin" in attributes: # pragma no branch self._admin = self._makeBoolAttribute(attributes["admin"]) diff --git a/github/Permissions.pyi b/github/Permissions.pyi deleted file mode 100644 index 80776421..00000000 --- a/github/Permissions.pyi +++ /dev/null @@ -1,18 +0,0 @@ -from typing import Any, Dict - -from github.GithubObject import NonCompletableGithubObject - -class Permissions(NonCompletableGithubObject): - def __repr__(self) -> str: ... - def _initAttributes(self) -> None: ... - def _useAttributes(self, attributes: Dict[str, Any]) -> None: ... - @property - def admin(self) -> bool: ... - @property - def maintain(self) -> bool: ... - @property - def pull(self) -> bool: ... - @property - def push(self) -> bool: ... - @property - def triage(self) -> bool: ...