mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-11 12:42:34 +01:00
PyChecker updates.
This commit is contained in:
parent
3f5cac26b8
commit
6bd8d43c28
@ -41,14 +41,7 @@ __revision__ = "$Id$"
|
||||
import supybot.fix as fix
|
||||
|
||||
import re
|
||||
import copy
|
||||
import sets
|
||||
import time
|
||||
import random
|
||||
import socket
|
||||
import string
|
||||
import fnmatch
|
||||
import operator
|
||||
import textwrap
|
||||
from itertools import imap
|
||||
from cStringIO import StringIO as sio
|
||||
@ -216,7 +209,6 @@ def separateModes(args):
|
||||
assert modes[0] in '+-', 'Invalid args: %r' % args
|
||||
args = list(args[1:])
|
||||
ret = []
|
||||
length = len(modes)
|
||||
for c in modes:
|
||||
if c in '+-':
|
||||
last = c
|
||||
|
@ -403,7 +403,8 @@ def sortBy(f, L):
|
||||
def sorted(iterable, cmp=None, key=None, reversed=False):
|
||||
L = list(iterable)
|
||||
if key is not None:
|
||||
sortBy(key, L, cmp=cmp)
|
||||
assert cmp is not None, 'Can\'t use both cmp and key.'
|
||||
sortBy(key, L)
|
||||
else:
|
||||
L.sort(cmp)
|
||||
if reversed:
|
||||
@ -568,7 +569,6 @@ def getSocket(host):
|
||||
else:
|
||||
raise socket.error, 'Something wonky happened.'
|
||||
|
||||
_ipchars = string.digits + '.'
|
||||
def isIP(s):
|
||||
"""Returns whether or not a given string is an IPV4 address.
|
||||
|
||||
@ -726,7 +726,7 @@ def transactionalFile(*args, **kwargs):
|
||||
return AtomicFile(*args, **kwargs)
|
||||
|
||||
if __name__ == '__main__':
|
||||
import sys, doctest
|
||||
import doctest
|
||||
doctest.testmod(sys.modules['__main__'])
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user