Skip to content
Snippets Groups Projects
Commit 17a0955e authored by Lauri Himanen's avatar Lauri Himanen
Browse files

Added function to print out the JSON header and footer to the backend for...

Added function to print out the JSON header and footer to the backend for parsers that don't use SimpleMatchers.
parent 35ed135c
No related branches found
No related tags found
No related merge requests found
......@@ -346,6 +346,14 @@ class AbstractBaseParser(with_metaclass(ABCMeta, object)):
default_units=self.parser_context.default_units,
metainfo_units=self.parser_context.metainfo_units)
def print_json_header(self):
self.super_backend.fileOut.write("[")
uri = "file://" + self.parser_context.main_file
self.backend.startedParsingSession(uri, self.parser_context.parser_info)
def print_json_footer(self):
self.super_backend.fileOut.write("]]\n")
@abstractmethod
def parse(self):
"""Used to do the actual parsing. Inside this function you should push
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment