Removed some more unused imports.

This commit is contained in:
Jeremy Fincher 2005-02-04 03:11:02 +00:00
parent a656fd0693
commit e6beec2989
10 changed files with 9 additions and 22 deletions

View File

@ -1,5 +1,5 @@
###
# Copyright (c) 2004, Jeremiah Fincher
# Copyright (c) 2004-2005, Jeremiah Fincher
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without

View File

@ -29,8 +29,6 @@
import os
import csv
import sets
from itertools import imap
import supybot.conf as conf
import supybot.utils as utils
@ -38,7 +36,6 @@ from supybot.commands import *
import supybot.plugins as plugins
import supybot.ircmsgs as ircmsgs
import supybot.ircutils as ircutils
import supybot.registry as registry
import supybot.callbacks as callbacks
class SqliteKarmaDB(object):

View File

@ -27,7 +27,6 @@
# POSSIBILITY OF SUCH DAMAGE.
###
import sets
import time
import supybot.conf as conf

View File

@ -29,7 +29,6 @@
import re
import time
import string
import supybot.log as log
import supybot.conf as conf

View File

@ -40,11 +40,9 @@ import supybot
import re
import copy
import sets
import time
import shlex
import getopt
import string
import inspect
import operator
from cStringIO import StringIO
@ -1307,7 +1305,7 @@ class PrivmsgRegexp(Privmsg):
self.log.info('%s not running due to msg.isError.', self.name())
return
for (r, name) in self.res:
spans = sets.Set()
spans = set()
for m in r.finditer(msg.args[1]):
# There's a bug in finditer: http://www.python.org/sf/817234
if m.span() in spans:
@ -1320,7 +1318,7 @@ class PrivmsgRegexp(Privmsg):
class PrivmsgCommandAndRegexp(Privmsg):
"""Same as Privmsg, except allows the user to also include regexp-based
callbacks. All regexp-based callbacks must be specified in a sets.Set
callbacks. All regexp-based callbacks must be specified in a set
(or list) attribute "regexps".
"""
flags = re.I

View File

@ -34,7 +34,6 @@ the same as) DJB's CDB <http://cr.yp.to/cdb.html>.
import os
import sys
import sets
import struct
import os.path
import cPickle as pickle
@ -289,7 +288,7 @@ class ReaderWriter(utils.IterableMap):
self._readJournal()
self._openFiles()
self.adds = {}
self.removals = sets.Set()
self.removals = set()
def _openFiles(self):
self.cdb = Reader(self.filename)
@ -310,7 +309,7 @@ class ReaderWriter(utils.IterableMap):
self.journal.flush()
def _readJournal(self):
removals = sets.Set()
removals = set()
adds = {}
try:
fd = file(self.journalName, 'r')
@ -415,7 +414,7 @@ class ReaderWriter(utils.IterableMap):
has_key = __contains__
def iteritems(self):
already = sets.Set()
already = set()
for (key, value) in self.cdb.iteritems():
if key in self.removals or key in already:
continue

View File

@ -31,7 +31,6 @@ import os
import sys
import time
import socket
import string
import supybot.cdb as cdb
import supybot.utils as utils

View File

@ -30,9 +30,7 @@
from __future__ import division
import os
import sets
import time
import string
import operator
import supybot.log as log
@ -113,7 +111,7 @@ def unWildcardHostmask(hostmask):
return hostmask.translate(utils.str.chars, '!@*?')
_invert = invertCapability
class CapabilitySet(sets.Set):
class CapabilitySet(set):
"""A subclass of set handling basic capability stuff."""
def __init__(self, capabilities=()):
self.__parent = super(CapabilitySet, self)
@ -643,7 +641,7 @@ class UsersDictionary(utils.IterableMap):
try:
self._hostmaskCache[id].add(s)
except KeyError:
self._hostmaskCache[id] = sets.Set([s])
self._hostmaskCache[id] = set([s])
return id
elif len(ids) == 0:
raise KeyError, s

View File

@ -36,7 +36,6 @@ object (which, as you'll read later, is quite...full-featured :))
import re
import time
import string
import supybot.conf as conf
import supybot.utils as utils

View File

@ -29,7 +29,6 @@
import re
import os
import sets
import time
import string
import textwrap
@ -607,7 +606,7 @@ class SpaceSeparatedListOfStrings(SpaceSeparatedListOf):
Value = String
class SpaceSeparatedSetOfStrings(SpaceSeparatedListOfStrings):
List = sets.Set
List = set
class CommaSeparatedListOfStrings(SeparatedListOf):
Value = String