Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding JSON writing feature and error summarization #72

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docstrings
  • Loading branch information
Tyler Kobil committed Feb 1, 2021
commit ee7153e364bb77ee08f040709b276614e0ed4dbd
5 changes: 3 additions & 2 deletions pyx12/x12json_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def __del__(self):

def seg(self, seg_node, seg_data, last_seg=False):
"""
Generate XML for the segment data and matching map node
Generate JSON for the segment data and matching map node

@param seg_node: Map Node
@type seg_node: L{node<map_if.x12_node>}
Expand Down Expand Up @@ -105,5 +105,6 @@ def seg(self, seg_node, seg_data, last_seg=False):
else:
raise EngineError('Node must be a either an element or a composite')
self.writer.pop() # end segment
self.visited.append(parent.id)
if parent.id not in self.visited:
self.visited.append(parent.id)
self.last_path = cur_path
4 changes: 2 additions & 2 deletions pyx12/x12n_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ def x12n_document(param, src_file, fd_997, fd_html,
@type fd_html: file descriptor
@param fd_xmldoc: XML output document
@type fd_xmldoc: file descriptor
@param fd_jsondoc: JSON output document (outputs to single line)
@type fd_jsondoc: file descriptor
@rtype: boolean
"""
logger = logging.getLogger('pyx12')
Expand Down Expand Up @@ -239,11 +241,9 @@ def x12n_document(param, src_file, fd_997, fd_html,
del html

if fd_xmldoc:
# fd_xmldoc.writer._write("tlyer")
del xmldoc

if fd_jsondoc:
# fd_jsondoc.writer._write("tlyer")
del fd_jsondoc

#visit_debug = pyx12.error_debug.error_debug_visitor(sys.stdout)
Expand Down