From 22a35f41bf9c404d3532611f5929143d04b10010 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 24 Feb 2020 17:50:56 -0800 Subject: [PATCH] move variables to top --- jc/parsers/ls.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/jc/parsers/ls.py b/jc/parsers/ls.py index 5686ff5c..ec0dd6f1 100644 --- a/jc/parsers/ls.py +++ b/jc/parsers/ls.py @@ -218,6 +218,10 @@ def parse(data, raw=False, quiet=False): jc.utils.compatibility(__name__, info.compatible) raw_output = [] + warned = False + parent = '' + next_is_parent = False + new_section = False linedata = data.splitlines() @@ -226,9 +230,6 @@ def parse(data, raw=False, quiet=False): if re.match('^total [0-9]+', linedata[0]): linedata.pop(0) - parent = '' - next_is_parent = False - # Look for parent line if glob or -R is used if not re.match('^[-dclpsbDCMnP?]([-r][-w][-xsS]){2}([-r][-w][-xtT])[+]?', linedata[0]) \ and linedata[0].endswith(':'): @@ -236,9 +237,6 @@ def parse(data, raw=False, quiet=False): # Pop following total line linedata.pop(0) - warned = False - new_section = False - if linedata: # Check if -l was used to parse extra data if re.match('^[-dclpsbDCMnP?]([-r][-w][-xsS]){2}([-r][-w][-xtT])[+]?', linedata[0]):