diff options
author | Per Øyvind Karlsen <proyvind@moondrake.org> | 2016-06-29 20:50:58 +0200 |
---|---|---|
committer | Per Øyvind Karlsen <proyvind@moondrake.org> | 2016-06-29 20:50:58 +0200 |
commit | 8f455357509c915198a9af225ea88d1f0fc68a52 (patch) | |
tree | 5b90d2d32598ee810039a057eb6dd06db8b68e22 /MgaRepo/GitHub.py | |
parent | ea3b0a3f51c036238b182ba09d82f0ed94b8bcc3 (diff) | |
download | mgarepo-8f455357509c915198a9af225ea88d1f0fc68a52.tar mgarepo-8f455357509c915198a9af225ea88d1f0fc68a52.tar.gz mgarepo-8f455357509c915198a9af225ea88d1f0fc68a52.tar.bz2 mgarepo-8f455357509c915198a9af225ea88d1f0fc68a52.tar.xz mgarepo-8f455357509c915198a9af225ea88d1f0fc68a52.zip |
implement delete_repository()
Diffstat (limited to 'MgaRepo/GitHub.py')
-rw-r--r-- | MgaRepo/GitHub.py | 8 |
1 files changed, 8 insertions, 0 deletions
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): |