Fix lint in split.py
This commit is contained in:
parent
326ce91eb7
commit
bc009ae624
@ -103,6 +103,7 @@ foo\ bar/foo bar/foo\ bar/
|
|||||||
áéíóú/áéíóú/áéíóú/
|
áéíóú/áéíóú/áéíóú/
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
class SplitTests(unittest.TestCase):
|
class SplitTests(unittest.TestCase):
|
||||||
|
|
||||||
"""Test split."""
|
"""Test split."""
|
||||||
|
@ -42,15 +42,22 @@ class ShellLexer:
|
|||||||
self.escape = '\\'
|
self.escape = '\\'
|
||||||
self.escapedquotes = '"'
|
self.escapedquotes = '"'
|
||||||
self.keep = False
|
self.keep = False
|
||||||
|
self.quoted = None
|
||||||
|
self.escapedstate = None
|
||||||
|
self.token = None
|
||||||
|
self.state = None
|
||||||
|
self.reset()
|
||||||
|
|
||||||
def reset(self):
|
def reset(self):
|
||||||
|
"""Reset the statemachine state to the defaults."""
|
||||||
self.quoted = False
|
self.quoted = False
|
||||||
self.escapedstate = ' '
|
self.escapedstate = ' '
|
||||||
self.token = ''
|
self.token = ''
|
||||||
self.state = ' '
|
self.state = ' '
|
||||||
|
|
||||||
def __iter__(self):
|
def __iter__(self): # noqa
|
||||||
"""Read a raw token from the input stream."""
|
"""Read a raw token from the input stream."""
|
||||||
|
# pylint: disable=too-many-branches,too-many-statements
|
||||||
self.reset()
|
self.reset()
|
||||||
for nextchar in self.string:
|
for nextchar in self.string:
|
||||||
log.shlexer.vdebug("in state {!r} I see character: {!r}".format(
|
log.shlexer.vdebug("in state {!r} I see character: {!r}".format(
|
||||||
|
Loading…
Reference in New Issue
Block a user