From bc009ae624511dcdafcb420a5f85cba370ef24a9 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 9 Nov 2014 22:15:44 +0100 Subject: [PATCH] Fix lint in split.py --- qutebrowser/test/utils/test_split.py | 1 + qutebrowser/utils/split.py | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/qutebrowser/test/utils/test_split.py b/qutebrowser/test/utils/test_split.py index c5e2ea551..5a1aa7516 100644 --- a/qutebrowser/test/utils/test_split.py +++ b/qutebrowser/test/utils/test_split.py @@ -103,6 +103,7 @@ foo\ bar/foo bar/foo\ bar/ áéíóú/áéíóú/áéíóú/ """ + class SplitTests(unittest.TestCase): """Test split.""" diff --git a/qutebrowser/utils/split.py b/qutebrowser/utils/split.py index 6a49c2275..1cc02056f 100644 --- a/qutebrowser/utils/split.py +++ b/qutebrowser/utils/split.py @@ -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(