From 2afafd2e4c506bf5ae6a39284db09228c1a18bb9 Mon Sep 17 00:00:00 2001 From: "Silas S. Brown" <ssb22@cam.ac.uk> Date: Wed, 30 Mar 2011 10:40:15 +0000 Subject: [PATCH] Gradint update git-svn-id: http://svn.code.sf.net/p/e-guidedog/code/ssb22/gradint@1080 29193198-4895-4776-b068-10539e920549 --- gradint-build/thindown.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gradint-build/thindown.py b/gradint-build/thindown.py index 0a84aa6..9d0824d 100644 --- a/gradint-build/thindown.py +++ b/gradint-build/thindown.py @@ -91,11 +91,12 @@ for l in sys.stdin.xreadlines(): for i in range(len(l)): if not l[i]==" ": indentLevel = i ; break + was_inTripleQuotes = inTripleQuotes if (len(l.split('"""'))%2) == 0: inTripleQuotes = not inTripleQuotes - if indentLevel<0 or indentLevel==len(l) or (revertToIndent>=0 and (indentLevel>revertToIndent or inTripleQuotes)): continue + if indentLevel<0 or indentLevel==len(l) or (revertToIndent>=0 and (indentLevel>revertToIndent or was_inTripleQuotes)): continue revertToIndent = -1 code = (l+"#")[:l.find("#")].strip() - if code in to_omit: # TODO and not inTripleQuotes? + if code in to_omit and not was_inTripleQuotes: print " "*indentLevel+code+" pass # trimmed" revertToIndent = indentLevel omitted[code]=1 -- GitLab