pyx12.error_visitor

Visitor - Visits an error_handler composite

Classes

error_visitor

Params: fd - target file

Functions

ascii_only(value)

Replace non-ASCII codepoints with ? (0x3F).

Module Contents

pyx12.error_visitor.ascii_only(value)[source]

Replace non-ASCII codepoints with ? (0x3F).

The X12 997/999 acknowledgement output is ASCII-by-spec, but the input file may contain non-ASCII bytes that bubble through validation as bad_value payloads on element-level errors. The visitor must sanitize before writing them into IK404/AK4-04, otherwise the ack itself would carry the bad bytes (and the X12Writer’s ASCII encode would crash on file output).

? is in the X12 basic charset, so the substitute is always valid in any IK404/AK4-04 context.

Parameters:

value (str)

Return type:

str

class pyx12.error_visitor.error_visitor(fd)[source]

Params: fd - target file

Parameters:

fd (Any)

visit_root_pre(errh)[source]
Parameters:

errh (L{error_handler.err_handler}) – Error handler

Return type:

None

visit_root_post(errh)[source]
Parameters:

errh (L{error_handler.err_handler}) – Error handler

Return type:

None

visit_isa_pre(err_isa)[source]
Parameters:

err_isa (Any)

Return type:

None

visit_isa_post(err_isa)[source]

Params: err_isa - error_isa instance

Parameters:

err_isa (Any)

Return type:

None

visit_gs_pre(err_gs)[source]
Parameters:

err_gs (Any)

Return type:

None

visit_gs_post(err_gs)[source]

Params: err_gs - error_gs instance

Parameters:

err_gs (Any)

Return type:

None

visit_st_pre(err_st)[source]
Parameters:

err_st (Any)

Return type:

None

visit_st_post(err_st)[source]

Params: err_st - error_st instance

Parameters:

err_st (Any)

Return type:

None

visit_seg(err_seg)[source]

Params: err_seg - error_seg instance

Parameters:

err_seg (Any)

Return type:

None

visit_ele(err_ele)[source]

Params: err_ele - error_ele instance

Parameters:

err_ele (Any)

Return type:

None