mirror of
https://github.com/RGBCube/GitHubWrapper
synced 2025-05-17 06:25:10 +00:00
Small fixes
This commit is contained in:
parent
db9f385801
commit
dddc0d410a
3 changed files with 36 additions and 16 deletions
|
@ -256,10 +256,12 @@ class Repository(APIObject):
|
|||
|
||||
@property
|
||||
def open_issues(self) -> int:
|
||||
""":class:`int`: The number of open issues on the repository."""
|
||||
return self._response.get('open_issues')
|
||||
|
||||
@property
|
||||
def forks(self) -> int:
|
||||
""":class:`int`: The number of forks of the repository."""
|
||||
return self._response.get('forks')
|
||||
|
||||
@property
|
||||
|
@ -275,7 +277,15 @@ class Repository(APIObject):
|
|||
) # type: ignore
|
||||
|
||||
async def add_file(self, filename: str, message: str, content: str, branch: Optional[str] = None) -> None:
|
||||
"""Adds a file to the repository."""
|
||||
"""Adds a file to the repository.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
filename: :class:`str` The name of the file.
|
||||
message: :class:`str` The commit message.
|
||||
content: :class:`str` The content of the file.
|
||||
branch: :class:`str` The branch to add the file to, defaults to the default branch.
|
||||
"""
|
||||
|
||||
if branch is None:
|
||||
branch = self.default_branch
|
||||
|
@ -450,6 +460,10 @@ class Gist(APIObject):
|
|||
"""TODO: document this."""
|
||||
return self._response
|
||||
|
||||
async def delete(self):
|
||||
"""Delete the gist."""
|
||||
await self._http.delete_gist(self.id)
|
||||
|
||||
|
||||
# === Organization stuff ===#
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue