From a961fee1c36b9ac886732101008804add073f9ae Mon Sep 17 00:00:00 2001 From: Sei Lisa Date: Thu, 12 Jan 2017 01:57:40 +0100 Subject: [PATCH] Minor formatting fix for calculator. Don't output a newline before a list constant if in calculator mode. While we're there, make a comparison more compact. --- lslopt/lsloutput.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lslopt/lsloutput.py b/lslopt/lsloutput.py index 2d00d03..f5501d4 100644 --- a/lslopt/lsloutput.py +++ b/lslopt/lsloutput.py @@ -151,14 +151,11 @@ class outscript(object): ret += ']' self.listmode = False return ret - ret = '\n' + ret = '' if lslcommon.IsCalc else '\n' first = True self.indentlevel += 1 for entry in value: - if not first: - ret += self.dent() + ', ' - else: - ret += self.dent() + '[ ' + ret += self.dent() + ('[ ' if first else ', ') self.listmode = True ret += self.Value2LSL(entry) + '\n' self.listmode = False