mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-04 08:59:23 +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()
|
db.commit()
|
||||||
return db
|
return db
|
||||||
|
|
||||||
_urlRe = re.compile(r"(\w+://[^\])>\s]+)", re.I)
|
|
||||||
def doPrivmsg(self, irc, msg):
|
def doPrivmsg(self, irc, msg):
|
||||||
channel = msg.args[0]
|
channel = msg.args[0]
|
||||||
db = self.getDb(channel)
|
db = self.getDb(channel)
|
||||||
@ -162,7 +161,7 @@ class URL(callbacks.PrivmsgCommandAndRegexp,
|
|||||||
text = ircmsgs.unAction(msg)
|
text = ircmsgs.unAction(msg)
|
||||||
else:
|
else:
|
||||||
text = msg.args[1]
|
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)
|
r = self.configurables.get('non-snarfing-regexp', channel)
|
||||||
if r and r.search(url):
|
if r and r.search(url):
|
||||||
continue
|
continue
|
||||||
|
@ -33,12 +33,15 @@ __revision__ = "$Id$"
|
|||||||
|
|
||||||
import fix
|
import fix
|
||||||
|
|
||||||
|
import re
|
||||||
import socket
|
import socket
|
||||||
import urllib2
|
import urllib2
|
||||||
|
|
||||||
class WebError(Exception):
|
class WebError(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
urlRe = re.compile(r"(\w+://[^\])>\s]+)", re.I)
|
||||||
|
|
||||||
def getUrlFd(url):
|
def getUrlFd(url):
|
||||||
"""Gets a file-like object for a url."""
|
"""Gets a file-like object for a url."""
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user