mirror of
https://github.com/jlu5/PyLink.git
synced 2024-12-25 04:02:45 +01:00
wrap* funcs: convert input args to a list, so that pop(0) always works
This commit is contained in:
parent
ba330bbfac
commit
d4b4cfb32e
@ -876,6 +876,7 @@ class Irc():
|
|||||||
|
|
||||||
last_prefix = '+'
|
last_prefix = '+'
|
||||||
orig_modes = modes.copy()
|
orig_modes = modes.copy()
|
||||||
|
modes = list(modes)
|
||||||
while modes:
|
while modes:
|
||||||
# PyLink mode lists come in the form [('+t', None), ('-b', '*!*@someone'), ('+l', 3)]
|
# PyLink mode lists come in the form [('+t', None), ('-b', '*!*@someone'), ('+l', 3)]
|
||||||
# The +/- part is optional depending on context, and should either:
|
# The +/- part is optional depending on context, and should either:
|
||||||
|
2
utils.py
2
utils.py
@ -492,6 +492,8 @@ def wrapArguments(prefix, args, length, separator=' '):
|
|||||||
|
|
||||||
buf = prefix
|
buf = prefix
|
||||||
|
|
||||||
|
args = list(args)
|
||||||
|
|
||||||
while args:
|
while args:
|
||||||
assert len(prefix+args[0]) <= length, \
|
assert len(prefix+args[0]) <= length, \
|
||||||
"wrapArguments: Argument %r is too long for the given length %s" % (args[0], length)
|
"wrapArguments: Argument %r is too long for the given length %s" % (args[0], length)
|
||||||
|
Loading…
Reference in New Issue
Block a user