From 72ba55f248ea858331f2cccec129d2f0862834f1 Mon Sep 17 00:00:00 2001 From: Timothy Crosley Date: Fri, 2 Feb 2018 06:47:21 -0800 Subject: Current progress --- isort/isort.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/isort/isort.py b/isort/isort.py index 567a2fdd..34325c6b 100644 --- a/isort/isort.py +++ b/isort/isort.py @@ -622,14 +622,26 @@ class SortImports(object): next_construct = "" self._in_quote = False tail = self.out_lines[imports_tail:] + quote_started = False + start_of_quote = False for index, line in enumerate(tail): + if self._in_quote: + if not quote_started: + start_of_quote = True + quote_started = True + else: + start_of_quote = False + elif quote_started: + quote_started = False + start_of_quote = False + if not self._skip_line(line) and line.strip(): if line.strip().startswith("#") and len(tail) > (index + 1) and tail[index + 1].strip(): continue next_construct = line break - else: + elif start_of_quote: parts = line.split() if len(parts) >=3 and parts[1] == '=' and (parts[2].startswith('"') or parts[2].startswith("'")): next_construct = line -- cgit v1.2.1