Moved _urlRe to webutils as urlRe.

This commit is contained in:
Jeremy Fincher 2004-01-04 11:18:53 +00:00
parent 61eb55fa57
commit 669ac8995f
2 changed files with 4 additions and 2 deletions

View File

@ -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

View File

@ -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: