Skip to content
Snippets Groups Projects
Commit 4596a16f authored by Mohamed, Fawzi Roberto (fawzi)'s avatar Mohamed, Fawzi Roberto (fawzi)
Browse files

Merge branch 'fix-mainFunction-outF' into 'master'

fix issue where json would be printed to stdout even though outF is another file

While we are at it, removed unnecessary global declarations and add what I presume were missing return statements

Since I am unsure how to properly test these things I submit it for review.

See merge request !1
parents 5125809d 1178878a
Branches
Tags
1 merge request!1fix issue where json would be printed to stdout even though outF is another file
......@@ -936,9 +936,7 @@ class SimpleParser(object):
self.skipped = 0
self.superContext = superContext
self.annotateFile = None
global highlightmode
self.matchHighlighter = MatchHighlighter(highlightmode)
global annotate
if annotate:
annofilename=fIn.fIn.name + ".annotate"
logger.info("writing annotated input to " + annofilename)
......@@ -960,9 +958,9 @@ class SimpleParser(object):
for s,gIndex in reversed(list(cNow.sections.items())):
self.backend.closeSection(s, gIndex)
cNow.startEnd = ParsingContext.End
True
return True
else:
False
return False
def contextPop(self):
cNow = self.context.pop()
......@@ -1184,7 +1182,7 @@ def mainFunction(mainFileDescription,
# Initialize the backend where the final results are printed after they are
# possibly filtered by the caching ActiveBackend.
if superBackend is None:
jsonBackend = JsonParseEventsWriterBackend(metaInfoEnv, sys.stdout)
jsonBackend = JsonParseEventsWriterBackend(metaInfoEnv, outF)
else:
jsonBackend = superBackend
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment