PkgInfo: Rename 'archpkg' command to 'archlinux'

This commit is contained in:
James Lu 2015-05-09 17:26:43 -07:00
parent 8d15c8777c
commit c3e62391ef
3 changed files with 10 additions and 10 deletions

View File

@ -50,7 +50,7 @@ Everything else is parsed as HTML using the Beautiful Soup 4 library.
### Arch Linux packages ### Arch Linux packages
``` ```
<GLolol> archpkg bash <GLolol> archlinux bash
<Atlas> Found 8 results: bash-docs - Advanced Bash-Scripting Guide in HTML (10) [any], bash-completion - Programmable completion for the bash shell (2.1) [any], bashdb - A debugger for Bash scripts loosely modeled on the gdb command syntax (4.3_0.9) [any], screenfetch - CLI Bash script to show system/theme info in screenshots (3.6.5) [any], bash - The GNU Bourne Again shell (4.3.030) [i686, x86_64], (1 more message) <Atlas> Found 8 results: bash-docs - Advanced Bash-Scripting Guide in HTML (10) [any], bash-completion - Programmable completion for the bash shell (2.1) [any], bashdb - A debugger for Bash scripts loosely modeled on the gdb command syntax (4.3_0.9) [any], screenfetch - CLI Bash script to show system/theme info in screenshots (3.6.5) [any], bash - The GNU Bourne Again shell (4.3.030) [i686, x86_64], (1 more message)
``` ```

View File

@ -71,7 +71,7 @@ class PkgInfo(callbacks.Plugin):
'debian-archive': 'http://archive.debian.net/'} 'debian-archive': 'http://archive.debian.net/'}
self.unknowndist = _("Unknown distribution. This command only supports " self.unknowndist = _("Unknown distribution. This command only supports "
"package lookup for Debian and Ubuntu. For Arch " "package lookup for Debian and Ubuntu. For Arch "
"Linux packages, see the 'archpkg' and 'archaur' " "Linux packages, see the 'archlinux' and 'archaur' "
"commands. For Linux Mint, use the 'linuxmint' command.") "commands. For Linux Mint, use the 'linuxmint' command.")
def _getDistro(self, release): def _getDistro(self, release):
@ -239,7 +239,7 @@ class PkgInfo(callbacks.Plugin):
vlist = wrap(vlist, ['somethingWithoutSpaces', 'somethingWithoutSpaces', vlist = wrap(vlist, ['somethingWithoutSpaces', 'somethingWithoutSpaces',
getopts({'reverse': ''})]) getopts({'reverse': ''})])
def archpkg(self, irc, msg, args, pkg, opts): def archlinux(self, irc, msg, args, pkg, opts):
"""<package> [--exact] """<package> [--exact]
Looks up <package> in the Arch Linux package repositories. Looks up <package> in the Arch Linux package repositories.
@ -251,7 +251,7 @@ class PkgInfo(callbacks.Plugin):
url = baseurl + urlencode({'name': pkg}) url = baseurl + urlencode({'name': pkg})
else: else:
url = baseurl + urlencode({'q': pkg}) url = baseurl + urlencode({'q': pkg})
self.log.debug("PkgInfo: using url %s for 'archpkg' command", url) self.log.debug("PkgInfo: using url %s for 'archlinux' command", url)
fd = utils.web.getUrl(url) fd = utils.web.getUrl(url)
data = json.loads(fd.decode("utf-8")) data = json.loads(fd.decode("utf-8"))
if data['valid'] and data['results']: if data['valid'] and data['results']:
@ -271,7 +271,7 @@ class PkgInfo(callbacks.Plugin):
list(results))) list(results)))
else: else:
irc.error("No results found.", Raise=True) irc.error("No results found.", Raise=True)
archpkg = wrap(archpkg, ['somethingWithoutSpaces', getopts({'exact': ''})]) archlinux = wrap(archlinux, ['somethingWithoutSpaces', getopts({'exact': ''})])
def archaur(self, irc, msg, args, pkg): def archaur(self, irc, msg, args, pkg):
"""<package> """<package>

View File

@ -47,13 +47,13 @@ class PkgInfoTestCase(PluginTestCase):
self.assertRegexp('vlist debian bash', 'Found [1-9][0-9]* ' self.assertRegexp('vlist debian bash', 'Found [1-9][0-9]* '
'results: (.*?\(.*?\))+') 'results: (.*?\(.*?\))+')
def testArchpkg(self): def testArchLinux(self):
self.assertError('archpkg afdsfbjeiog') self.assertError('archlinux afdsfbjeiog')
self.assertNotError('archpkg bash') self.assertNotError('archlinux bash')
self.assertRegexp('archpkg pacman --exact', self.assertRegexp('archlinux pacman --exact',
'Found 1.*?pacman') 'Found 1.*?pacman')
def testArchaur(self): def testArchAUR(self):
self.assertError('archaur wjoitgjwotgjv') self.assertError('archaur wjoitgjwotgjv')
self.assertRegexp('archaur yaourt', 'Found [1-9][0-9]* results:' self.assertRegexp('archaur yaourt', 'Found [1-9][0-9]* results:'
'.*?yaourt.*?') '.*?yaourt.*?')