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

@ -196,6 +196,11 @@ repositories = {
'supybot-plugins', 'supybot-plugins',
'plugins', 'plugins',
), ),
'nanotube-bitcoin': GithubRepository(
'nanotube',
'supybot-bitcoin-'
'marketmonitor',
),
} }
class PluginDownloader(callbacks.Plugin): class PluginDownloader(callbacks.Plugin):
@ -237,6 +242,8 @@ class PluginDownloader(callbacks.Plugin):
'This repository does not exist or is not known by ' 'This repository does not exist or is not known by '
'this bot.' 'this bot.'
)) ))
elif plugin not in repositories[repository].getPluginList():
irc.error(_('This plugin does not exist in this repository.'))
else: else:
try: try:
repositories[repository].install(plugin) repositories[repository].install(plugin)

View File

@ -79,7 +79,7 @@ class PluginDownloaderTestCase(PluginTestCase):
self.assertNotError('plugindownloader install stepnem Freenode') self.assertNotError('plugindownloader install stepnem Freenode')
self._testPluginInstalled('Freenode') self._testPluginInstalled('Freenode')
def testGsf(self): def testInstallGsf(self):
self.assertNotError('plugindownloader install gsf-snapshot Debian') self.assertNotError('plugindownloader install gsf-snapshot Debian')
self._testPluginInstalled('Debian') self._testPluginInstalled('Debian')
self.assertError('plugindownloader install gsf-snapshot Anagram') 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 Anagram')
self.assertError('plugindownloader install gsf Debian') 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: # vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79: