polytracker.mapping

This module maps input byte offsets to output byte offsets

mapping classes

FileCavities

class polytracker.mapping.FileCavities(argument_parser: ArgumentParser)

Bases: Command

__init__(argument_parser: ArgumentParser)
extension_types: Optional[List[Type[CommandExtension]]] = None

An auto-populated list of eny extensions to this command.

property full_name: str
help: str = 'finds input byte offsets that do not affect any output byte offsets'

Help string for this command.

name: str = 'cavities'

The name of this plugin.

parent: Optional['Plugin']

The parent of this plugin, if it is a sub-plugin.

parent_parsers: Tuple[ArgumentParser, ...] = ()

An optional sequence of parent argument parsers from which to parse options.

run(args)

Callback for when the command is run.

Parameters:

args – The result of parsing the commandline arguments set up by Command.__init_arguments__().

subcommand_types: Optional[List[Type[Subcommand]]] = None

An auto-populated list of subcommands of this command.

subparser: Optional[Any] = None

A subparser, auto-populated if subcommand_types is not None.

InputOutputMapping

class polytracker.mapping.InputOutputMapping(f: TDFile)

Bases: object

__init__(f: TDFile)
dfs_walk(label: int, seen: Optional[Set[int]] = None) Iterator[Tuple[int, TDNode]]
file_cavities() Dict[Path, List[Tuple[int, int]]]
mapping() Dict[Tuple[Path, int], Set[Tuple[Path, int]]]
marker_to_ranges(m: bytes) List[Tuple[int, int]]

MapInputsToOutputs

class polytracker.mapping.MapInputsToOutputs(argument_parser: ArgumentParser)

Bases: Command

__init__(argument_parser: ArgumentParser)
extension_types: Optional[List[Type[CommandExtension]]] = None

An auto-populated list of eny extensions to this command.

property full_name: str
help: str = 'generate a mapping of input byte offsets to output byte offsets'

Help string for this command.

name: str = 'mapping'

The name of this plugin.

parent: Optional['Plugin']

The parent of this plugin, if it is a sub-plugin.

parent_parsers: Tuple[ArgumentParser, ...] = ()

An optional sequence of parent argument parsers from which to parse options.

run(args)

Callback for when the command is run.

Parameters:

args – The result of parsing the commandline arguments set up by Command.__init_arguments__().

subcommand_types: Optional[List[Type[Subcommand]]] = None

An auto-populated list of subcommands of this command.

subparser: Optional[Any] = None

A subparser, auto-populated if subcommand_types is not None.

mapping functions

ascii

polytracker.mapping.ascii(b: bytes) str