pydiffx.sections#

Section-related definitions.

This is mostly useful internally for diff generation and parsing.

Module Attributes

PREAMBLE_SECTIONS

A set of all preamble sections.

META_SECTIONS

A set of all meta sections.

CONTENT_SECTIONS

A set of all content sections.

VALID_SECTION_STATES

A mapping of section IDs to sections that may appear next in the file.

Classes

Section()

Valid section IDs in a DiffX file.

class pydiffx.sections.Section#

Bases: object

Valid section IDs in a DiffX file.

MAIN = 'diffx'#

The ID of the main DiffX section.

MAIN_PREAMBLE = '.preamble'#

The ID of the main DiffX preamble section.

MAIN_META = '.meta'#

The ID of the main DiffX metadata section.

CHANGE = '.change'#

The ID of a change section.

CHANGE_PREAMBLE = '..preamble'#

The ID of a change’s preamble section.

CHANGE_META = '..meta'#

The ID of a change’s metadata section.

FILE = '..file'#

The ID of a file section.

FILE_META = '...meta'#

The ID of a file’s metadata section.

FILE_DIFF = '...diff'#

The ID of a file’s diff section.

pydiffx.sections.PREAMBLE_SECTIONS = {'..preamble', '.preamble'}#

A set of all preamble sections.

pydiffx.sections.META_SECTIONS = {'...meta', '..meta', '.meta'}#

A set of all meta sections.

pydiffx.sections.CONTENT_SECTIONS = {'...diff', '...meta', '..meta', '..preamble', '.meta', '.preamble'}#

A set of all content sections.

pydiffx.sections.VALID_SECTION_STATES = {'...diff': {'..file', '.change'}, '...meta': {'...diff', '..file', '.change'}, '..file': {'...meta'}, '..meta': {'..file', '.change'}, '..preamble': {'..file', '..meta'}, '.change': {'..file', '..meta', '..preamble'}, '.meta': {'.change'}, '.preamble': {'.change', '.meta'}, 'diffx': {'.change', '.meta', '.preamble'}}#

A mapping of section IDs to sections that may appear next in the file.