mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 11:09:23 +01:00
A bit of cleanup work, mostly on the python zegrep portion of debfile
This commit is contained in:
parent
6c898a8757
commit
467688de74
@ -121,13 +121,16 @@ class Debian(callbacks.Privmsg, PeriodicFileDownloader):
|
|||||||
# that).
|
# that).
|
||||||
regexp = privmsgs.getArgs(args).lstrip('^/')
|
regexp = privmsgs.getArgs(args).lstrip('^/')
|
||||||
try:
|
try:
|
||||||
r = re.compile(regexp, re.I)
|
re_obj = re.compile(regexp, re.I)
|
||||||
except re.error, e:
|
except:
|
||||||
irc.error(msg, )
|
irc.error(msg, "Error in filename: %s" % regexp)
|
||||||
return
|
return
|
||||||
if self.usePythonZegrep:
|
if self.usePythonZegrep:
|
||||||
r = gzip.open(self.contents)
|
fd = gzip.open(self.contents)
|
||||||
r = ifilter(imap(lambda line: r.search(line), fd))
|
r = imap(lambda tup: tup[0], \
|
||||||
|
ifilter(lambda tup: tup[0], \
|
||||||
|
imap(lambda line: (re_obj.search(line), line),
|
||||||
|
fd)))
|
||||||
(r, w) = popen2.popen4(['zegrep', regexp, self.contents])
|
(r, w) = popen2.popen4(['zegrep', regexp, self.contents])
|
||||||
packages = sets.Set() # Make packages unique
|
packages = sets.Set() # Make packages unique
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user