PluginDownloaded: add nanotube-bitcoin repository and check a plugin exists before downloading the tarball

This commit is contained in:
Valentin Lorentz 2011-04-28 14:20:36 +02:00
parent 72600e54af
commit 8fe3e77428
2 changed files with 40 additions and 28 deletions

View File

@ -169,33 +169,38 @@ class GithubRepository(GitRepository):
repositories = {
'ProgVal': GithubRepository(
'ProgVal',
'Supybot-plugins'
),
'quantumlemur': GithubRepository(
'quantumlemur',
'Supybot-plugins',
),
'stepnem': GithubRepository(
'stepnem',
'supybot-plugins',
),
'gsf-snapshot': GithubRepository(
'gsf',
'supybot-plugins',
'Supybot-plugins-20060723',
),
'gsf-edsu': GithubRepository(
'gsf',
'supybot-plugins',
'edsu-plugins',
),
'gsf': GithubRepository(
'gsf',
'supybot-plugins',
'plugins',
),
'ProgVal': GithubRepository(
'ProgVal',
'Supybot-plugins'
),
'quantumlemur': GithubRepository(
'quantumlemur',
'Supybot-plugins',
),
'stepnem': GithubRepository(
'stepnem',
'supybot-plugins',
),
'gsf-snapshot': GithubRepository(
'gsf',
'supybot-plugins',
'Supybot-plugins-20060723',
),
'gsf-edsu': GithubRepository(
'gsf',
'supybot-plugins',
'edsu-plugins',
),
'gsf': GithubRepository(
'gsf',
'supybot-plugins',
'plugins',
),
'nanotube-bitcoin': GithubRepository(
'nanotube',
'supybot-bitcoin-'
'marketmonitor',
),
}
class PluginDownloader(callbacks.Plugin):
@ -237,6 +242,8 @@ class PluginDownloader(callbacks.Plugin):
'This repository does not exist or is not known by '
'this bot.'
))
elif plugin not in repositories[repository].getPluginList():
irc.error(_('This plugin does not exist in this repository.'))
else:
try:
repositories[repository].install(plugin)

View File

@ -79,7 +79,7 @@ class PluginDownloaderTestCase(PluginTestCase):
self.assertNotError('plugindownloader install stepnem Freenode')
self._testPluginInstalled('Freenode')
def testGsf(self):
def testInstallGsf(self):
self.assertNotError('plugindownloader install gsf-snapshot Debian')
self._testPluginInstalled('Debian')
self.assertError('plugindownloader install gsf-snapshot Anagram')
@ -95,4 +95,9 @@ class PluginDownloaderTestCase(PluginTestCase):
self.assertError('plugindownloader install gsf Anagram')
self.assertError('plugindownloader install gsf Debian')
def testInstallNanotubeBitcoin(self):
self.assertNotError('plugindownloader install nanotube-bitcoin GPG')
self._testPluginInstalled('GPG')
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79: