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. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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