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
```
<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)
```

View File

@ -71,7 +71,7 @@ class PkgInfo(callbacks.Plugin):
'debian-archive': 'http://archive.debian.net/'}
self.unknowndist = _("Unknown distribution. This command only supports "
"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.")
def _getDistro(self, release):
@ -239,7 +239,7 @@ class PkgInfo(callbacks.Plugin):
vlist = wrap(vlist, ['somethingWithoutSpaces', 'somethingWithoutSpaces',
getopts({'reverse': ''})])
def archpkg(self, irc, msg, args, pkg, opts):
def archlinux(self, irc, msg, args, pkg, opts):
"""<package> [--exact]
Looks up <package> in the Arch Linux package repositories.
@ -251,7 +251,7 @@ class PkgInfo(callbacks.Plugin):
url = baseurl + urlencode({'name': pkg})
else:
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)
data = json.loads(fd.decode("utf-8"))
if data['valid'] and data['results']:
@ -271,7 +271,7 @@ class PkgInfo(callbacks.Plugin):
list(results)))
else:
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):
"""<package>

View File

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