mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 19:19:32 +01:00
Moved _urlRe to webutils as urlRe.
This commit is contained in:
parent
61eb55fa57
commit
669ac8995f
@ -147,7 +147,6 @@ class URL(callbacks.PrivmsgCommandAndRegexp,
|
||||
db.commit()
|
||||
return db
|
||||
|
||||
_urlRe = re.compile(r"(\w+://[^\])>\s]+)", re.I)
|
||||
def doPrivmsg(self, irc, msg):
|
||||
channel = msg.args[0]
|
||||
db = self.getDb(channel)
|
||||
@ -162,7 +161,7 @@ class URL(callbacks.PrivmsgCommandAndRegexp,
|
||||
text = ircmsgs.unAction(msg)
|
||||
else:
|
||||
text = msg.args[1]
|
||||
for url in self._urlRe.findall(text):
|
||||
for url in webutils.urlRe.findall(text):
|
||||
r = self.configurables.get('non-snarfing-regexp', channel)
|
||||
if r and r.search(url):
|
||||
continue
|
||||
|
@ -33,12 +33,15 @@ __revision__ = "$Id$"
|
||||
|
||||
import fix
|
||||
|
||||
import re
|
||||
import socket
|
||||
import urllib2
|
||||
|
||||
class WebError(Exception):
|
||||
pass
|
||||
|
||||
urlRe = re.compile(r"(\w+://[^\])>\s]+)", re.I)
|
||||
|
||||
def getUrlFd(url):
|
||||
"""Gets a file-like object for a url."""
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user