mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-23 10:34:19 +01:00
*finally* got the Debian.incoming globbing fixed. fnmatch.fnmatch is wonky
This commit is contained in:
parent
7e7343d968
commit
14ec774fe8
@ -253,11 +253,10 @@ class Debian(callbacks.Privmsg,
|
|||||||
arg = '_%s.' % arg
|
arg = '_%s.' % arg
|
||||||
archPredicate = lambda s, arg=arg: (arg in s)
|
archPredicate = lambda s, arg=arg: (arg in s)
|
||||||
predicates.append(archPredicate)
|
predicates.append(archPredicate)
|
||||||
globs = privmsgs.getArgs(rest)
|
globs = privmsgs.getArgs(rest).split()
|
||||||
for glob in globs:
|
for glob in globs:
|
||||||
if '?' not in glob and '*' not in glob:
|
glob = glob.replace('*', '.*').replace('?', '.?')
|
||||||
glob = '*%s*' % glob
|
predicates.append(re.compile(r'.*%s.*' % glob).search)
|
||||||
predicates.append(lambda s: fnmatch.fnmatch(s, glob))
|
|
||||||
packages = []
|
packages = []
|
||||||
try:
|
try:
|
||||||
fd = webutils.getUrlFd('http://incoming.debian.org/')
|
fd = webutils.getUrlFd('http://incoming.debian.org/')
|
||||||
@ -268,7 +267,7 @@ class Debian(callbacks.Privmsg,
|
|||||||
m = self._incomingRe.search(line)
|
m = self._incomingRe.search(line)
|
||||||
if m:
|
if m:
|
||||||
name = m.group(1)
|
name = m.group(1)
|
||||||
if all(lambda p: p(name), predicates):
|
if all(None, imap(lambda p: p(name), predicates)):
|
||||||
realname = rsplit(name, '_', 1)[0]
|
realname = rsplit(name, '_', 1)[0]
|
||||||
packages.append(realname)
|
packages.append(realname)
|
||||||
if len(packages) == 0:
|
if len(packages) == 0:
|
||||||
|
Loading…
Reference in New Issue
Block a user