pepys_import.file.highlighter package¶
Subpackages¶
- pepys_import.file.highlighter.support package
- Submodules
- pepys_import.file.highlighter.support.char module
- pepys_import.file.highlighter.support.color_picker module
- pepys_import.file.highlighter.support.combine module
- pepys_import.file.highlighter.support.export module
- pepys_import.file.highlighter.support.line module
- pepys_import.file.highlighter.support.test_utils module
- pepys_import.file.highlighter.support.token module
- pepys_import.file.highlighter.support.usages module
- Module contents
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
- 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
- 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)
- 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.