mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-29 06:09:23 +01:00
core: Remove useless imports.
This commit is contained in:
parent
72e71edb89
commit
4470805b5f
@ -28,8 +28,6 @@
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
###
|
||||
|
||||
import sys
|
||||
import os.path
|
||||
import dynamicScope
|
||||
|
||||
from . import utils
|
||||
|
@ -41,7 +41,6 @@ import shlex
|
||||
import codecs
|
||||
import getopt
|
||||
import inspect
|
||||
import operator
|
||||
|
||||
if sys.version_info[0] < 3:
|
||||
# cStringIO is buggy with Python 2.6 (
|
||||
|
@ -184,7 +184,6 @@ class Reader(utils.IterableMap):
|
||||
"""Class for reading from a CDB database."""
|
||||
def __init__(self, filename):
|
||||
self.filename = filename
|
||||
import os
|
||||
self.fd = open(filename, 'rb')
|
||||
self.loop = 0
|
||||
self.khash = 0
|
||||
|
@ -34,12 +34,10 @@ Includes wrappers for commands.
|
||||
|
||||
import time
|
||||
import Queue
|
||||
import types
|
||||
import getopt
|
||||
import inspect
|
||||
import threading
|
||||
import multiprocessing #python2.6 or later!
|
||||
import Queue
|
||||
|
||||
try:
|
||||
import resource
|
||||
|
@ -35,12 +35,8 @@ import os
|
||||
import sys
|
||||
import cgi
|
||||
import socket
|
||||
from threading import Event, Thread
|
||||
from cStringIO import StringIO
|
||||
from SocketServer import ThreadingMixIn
|
||||
from threading import Thread
|
||||
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
|
||||
# For testing purposes
|
||||
from SocketServer import StreamRequestHandler
|
||||
|
||||
import supybot.log as log
|
||||
import supybot.conf as conf
|
||||
|
@ -34,11 +34,8 @@ Supybot internationalisation and localisation managment.
|
||||
__all__ = ['PluginInternationalization', 'internationalizeDocstring']
|
||||
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
import time
|
||||
import weakref
|
||||
import threading
|
||||
conf = None
|
||||
# Don't import conf here ; because conf needs this module
|
||||
|
||||
|
@ -34,7 +34,6 @@ import time
|
||||
import operator
|
||||
|
||||
from . import conf, ircutils, log, registry, unpreserve, utils, world
|
||||
from .utils.iter import imap, ilen, ifilter
|
||||
|
||||
def isCapability(capability):
|
||||
return len(capability.split(None, 1)) == 1
|
||||
|
@ -41,7 +41,7 @@ except ImportError:
|
||||
|
||||
from . import conf, ircdb, ircmsgs, ircutils, log, utils, world
|
||||
from .utils.str import rsplit
|
||||
from .utils.iter import imap, chain, cycle
|
||||
from .utils.iter import chain
|
||||
from .utils.structures import queue, smallqueue, RingBuffer
|
||||
|
||||
###
|
||||
@ -481,7 +481,7 @@ class IrcState(IrcCommandDispatcher):
|
||||
converter = self._005converters.get(name, lambda x: x)
|
||||
try:
|
||||
self.supported[name] = converter(value)
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
log.exception('Uncaught exception in 005 converter:')
|
||||
log.error('Name: %s, Converter: %s', name, converter)
|
||||
else:
|
||||
|
@ -741,6 +741,6 @@ def standardSubstitute(irc, msg, text, env=None):
|
||||
return t.safe_substitute(vars)
|
||||
|
||||
if __name__ == '__main__':
|
||||
import sys, doctest
|
||||
import doctest
|
||||
doctest.testmod(sys.modules['__main__'])
|
||||
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
|
||||
|
@ -144,7 +144,7 @@ def close(registry, filename, private=True):
|
||||
else:
|
||||
s = 'CENSORED'
|
||||
fd.write('%s: %s\n' % (name, s))
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
exception('Exception printing value:')
|
||||
fd.close()
|
||||
|
||||
|
@ -508,7 +508,6 @@ httpserver.http_servers = [httpserver.TestSupyHTTPServer()]
|
||||
# Partially stolen from the standard Python library :)
|
||||
def open_http(url, data=None):
|
||||
"""Use HTTP protocol."""
|
||||
import httplib
|
||||
user_passwd = None
|
||||
proxy_passwd= None
|
||||
if isinstance(url, str):
|
||||
|
@ -118,7 +118,7 @@ def flush():
|
||||
for (i, f) in enumerate(flushers):
|
||||
try:
|
||||
f()
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
log.exception('Uncaught exception in flusher #%s (%s):', i, f)
|
||||
|
||||
def debugFlush(s=''):
|
||||
|
Loading…
Reference in New Issue
Block a user