pyx12.error_html

Generates HTML error output

Attributes

Classes

Functions

seg_str(seg, seg_term, ele_term, subele_term[, eol])

Join a list of elements

escape_html_chars(str_val)

Escape special HTML characters, including quotes, so the result is safe in

Module Contents

pyx12.error_html.logger[source]
class pyx12.error_html.error_html(errh, fd, term=('~', '*', '~', '\n'))[source]
Parameters:
  • fd (file descriptor) – target file

  • term (tuple(string, string, string, string)) – tuple of x12 terminators used

  • errh (Any)

Bug: GS errors are re-printing at the GE level

errh: Any[source]
fd: TextIO[source]
seg_term: str[source]
ele_term: str[source]
subele_term: str[source]
eol: str[source]
last_line: int[source]
loop_info: str | None[source]
header()[source]
Return type:

None

footer()[source]
Return type:

None

loop(loop_node)[source]
Parameters:

loop_node (Any)

Return type:

None

gen_info(info_str)[source]
Parameters:

info_str (str)

Return type:

None

gen_seg(seg_data, src, err_node_list)[source]

Find error seg for this segment. Find any skipped error values. ID pos of bad value. :param seg_data: data segment instance

Parameters:
Return type:

None

pyx12.error_html.seg_str(seg, seg_term, ele_term, subele_term, eol='')[source]

Join a list of elements :param seg: List of elements :type seg: list[string|list[string]] :param seg_term: Segment terminator character :type seg_term: string :param ele_term: Element terminator character :type ele_term: string :param subele_term: Sub-element terminator character :type subele_term: string :param eol: End of line character :type eol: string :return: formatted segment :rtype: string

Parameters:
Return type:

str

pyx12.error_html.escape_html_chars(str_val)[source]

Escape special HTML characters, including quotes, so the result is safe in both element text and attribute contexts. Spaces are replaced with   after escaping to preserve column alignment in the rendered report.

Parameters:

str_val (str | None)

Return type:

str | None