feat: unwatch all repos

This commit is contained in:
张泊明518370910136 2024-10-02 14:14:24 -04:00
parent f9b6409e53
commit cae195a4b5
GPG Key ID: CA088E6D9284F870
3 changed files with 15 additions and 4 deletions

View File

@ -40,6 +40,10 @@ pytest -svv
archive all repos in gitea organization
### `unwatch-all-repos`
unwatch all repos in gitea organization
### `check-issues`
check the existence of issue by title on gitea
@ -124,7 +128,3 @@ upload assignment grades to canvas from grade file (GRADE.txt by default), read
## License
MIT
## Compile
- case 0: 0

View File

@ -128,6 +128,11 @@ def archive_all_repos() -> None:
tea.pot.gitea.archive_all_repos()
@app.command("unwatch-all-repos", help="unwatch all repos in gitea organization")
def unwatch_all_repos() -> None:
tea.pot.gitea.unwatch_all_repos()
@app.command("get-no-collaborator-repos", help="list all repos with no collaborators")
def get_no_collaborator_repos() -> None:
tea.pot.gitea.get_no_collaborator_repos()

View File

@ -415,6 +415,12 @@ class Gitea:
self.org_name, repo.name, body={"archived": True}
)
def unwatch_all_repos(self) -> None:
for repo in list_all(self.organization_api.org_list_repos, self.org_name):
self.repository_api.user_current_delete_subscription(
self.org_name, repo.name
)
def get_all_teams(self) -> Dict[str, List[str]]:
res: Dict[str, List[str]] = {}
for team in list_all(self.organization_api.org_list_teams, self.org_name):