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