From 8f455357509c915198a9af225ea88d1f0fc68a52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20=C3=98yvind=20Karlsen?= Date: Wed, 29 Jun 2016 20:50:58 +0200 Subject: implement delete_repository() --- MgaRepo/GitHub.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'MgaRepo') diff --git a/MgaRepo/GitHub.py b/MgaRepo/GitHub.py index 6d00d0f..d0bf998 100644 --- a/MgaRepo/GitHub.py +++ b/MgaRepo/GitHub.py @@ -22,6 +22,14 @@ class GitHub(object): repository = self._organization.create_repo(pkgname, **kwargs) return repository + def delete_repository(self, pkgname, **kwargs): + repository = self.repository_exists(pkgname) + if repository: + print("deleting repository %s" % repository.full_name) + repository.delete() + return True + raise Error("repository %s doesn't exist!" % (self._organization.login+"/"+pkgname)) + # workaround pygithub bug @staticmethod def __get_stats_commit_activity(self): -- cgit v1.2.1