chiptools.core.preprocessor module

class chiptools.core.preprocessor.Preprocessor[source]

Bases: object

Preprocessor class to handle file preprocessor execution.

classmethod get_file_data(path)[source]

Return the file data as a list of lines.

classmethod process(path, processor_path)[source]

Execute the preprocessor on the given file, return True on success

classmethod set_file_data(path, fileData)[source]

Update the file with the new file data.

chiptools.core.preprocessor.get_preprocessor(path)[source]

Import the Python script supplied by the path and return a handle to a preprocessor function from the import. It is expected that the file to be imported contains a function called ‘process’ that accepts a list of file data and a file path. If these conditions are not met this function will return None.