New "limit" config variable, and some module fixes.

This commit is contained in:
Sean B. Palmer
2008-03-31 16:17:32 +01:00
parent fb2cd452e9
commit 286d4a8497
10 changed files with 48 additions and 23 deletions

View File

@@ -21,7 +21,8 @@ def head(phenny, input):
else: uri, header = uri, None
if not uri and hasattr(phenny, 'last_seen_uri'):
uri = phenny.last_seen_uri
try: uri = phenny.last_seen_uri[input.sender]
except KeyError: return phenny.say('?')
try: info = web.head(uri)
except IOError: return phenny.say("Can't connect to %s" % uri)
@@ -67,9 +68,9 @@ def f_title(self, origin, match, args):
uri = (uri or '').encode('utf-8')
if not uri and hasattr(self, 'last_seen_uri'):
uri = self.last_seen_uri.get('#swhack')
uri = self.last_seen_uri.get(origin.sender)
if not uri:
return phenny.msg(origin.sender, 'I need a URI to give the title of...')
return self.msg(origin.sender, 'I need a URI to give the title of...')
if not ':' in uri:
uri = 'http://' + uri
@@ -145,7 +146,7 @@ def noteuri(phenny, input):
if not hasattr(phenny.bot, 'last_seen_uri'):
phenny.bot.last_seen_uri = {}
phenny.bot.last_seen_uri[input.sender] = uri
noteuri.rule = r'.*(http://[^<> "]+)[,.]?'
noteuri.rule = r'.*(http://[^<> "\x01]+)[,.]?'
noteuri.priority = 'low'
if __name__ == '__main__':