From 66bad99eaaad27de8b2964b1e45f1d0f4625a84f Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Wed, 28 Jul 2004 06:02:09 +0000 Subject: [PATCH] Let's make sure getUrls doesn't return duplicates. --- plugins/URL.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/URL.py b/plugins/URL.py index a18e9509c..58d1a36af 100644 --- a/plugins/URL.py +++ b/plugins/URL.py @@ -41,6 +41,7 @@ import supybot.plugins as plugins import os import re +import sets import time import getopt import urllib2 @@ -119,10 +120,12 @@ class URLDB(object): self.filename, utils.exnToString(e)) return [] try: + urls = sets.Set() for line in fd: line = line.strip() (url, nick) = line.split() - if p(url, nick): + if url not in urls and p(url, nick): + urls.add(url) L.append(url) L.reverse() return L