pepys_import.file.highlighter package

Subpackages

Submodules

pepys_import.file.highlighter.highlighter module

class pepys_import.file.highlighter.highlighter.HighlightedFile(filename: str, number_of_lines=None, datafile=None)[source]

Bases: object

class that can load/tokenize a datafile, record changes to the file, then export a highlighted version of the file that indicates extraction

chars_debug()[source]

Debug method, to check contents of chars

create_lines(file_contents, lines_list)[source]

Create individual Line objects for each line, with appropriate references to the character array

export(filename: str, include_key=False)[source]

Provide highlighted summary for this file Args: filename (str): The name of the destination for the HTML output include_key (bool): Whether to include a key at the bottom of the output showing what each colour refers to

fill_char_array_if_needed()[source]
limited_contents()[source]
limited_lines()[source]

Return a list of Line objects for each line in the file, producing only self.number_of_lines objects (to limit length of output for very large files)

lines()[source]

Slice the file into lines and return a list of Line objects

not_limited_lines()[source]

Return a list of Line objects for each line in the file

reinitialise(filename, datafile)[source]

Re-initialise the highlighted file object, to set a new filename as the source of data to be highlighted.

Designed to be called with a new filename from within _load_this_file in an importer if the original file needs transforming before being processed and highlighted.

set_usages_for_slice(start, end, usage)[source]

Module contents