3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-25 04:02:45 +01:00

NetworkCoreWUtils: strip off leading and trailing quotes from parse_modes

This commit is contained in:
James Lu 2017-10-10 22:23:42 -07:00
parent 762ec3a0eb
commit aeaee491f3

View File

@ -560,6 +560,13 @@ class PyLinkNetworkCoreWithUtils(PyLinkNetworkCore):
args = args.split()
assert args, 'No valid modes were supplied!'
# Strip off matching quotes from argparse and friends. We don't use str.strip()
# because that might remove quotes that actually belong at the end of a string
# (e.g. text filter args)
if args.startswith(("'", '"')) and args.endswith(("'", '"')):
args = args[1:-1]
usermodes = not self.is_channel(target)
prefix = ''
modestring = args[0]