Fix lint in split.py

This commit is contained in:
Florian Bruhin 2014-11-09 22:15:44 +01:00
parent 326ce91eb7
commit bc009ae624
2 changed files with 9 additions and 1 deletions

View File

@ -103,6 +103,7 @@ foo\ bar/foo bar/foo\ bar/
áéíóú/áéíóú/áéíóú/
"""
class SplitTests(unittest.TestCase):
"""Test split."""

View File

@ -42,15 +42,22 @@ class ShellLexer:
self.escape = '\\'
self.escapedquotes = '"'
self.keep = False
self.quoted = None
self.escapedstate = None
self.token = None
self.state = None
self.reset()
def reset(self):
"""Reset the statemachine state to the defaults."""
self.quoted = False
self.escapedstate = ' '
self.token = ''
self.state = ' '
def __iter__(self):
def __iter__(self): # noqa
"""Read a raw token from the input stream."""
# pylint: disable=too-many-branches,too-many-statements
self.reset()
for nextchar in self.string:
log.shlexer.vdebug("in state {!r} I see character: {!r}".format(