cece.parser

The parser reads the files and metadata from the file system, and builds a list of files to write out to the file system.

Functions

cece.parser._get_breadcrumbs(path)[source]

A utility method for getting the breadcrumb links from a path. They are built by repeatedly taking the dirname of the path.

For example, "category1/category2/variant1/variant2" would produce:

[
    "category1",
    "category1/category2",
    "category1/category2/variant1",
    "category1/category2/variant1/variant2"
]

Classes

class cece.parser.ParsingException(path, message)[source]

A custom exception that is thrown when there are errors parsing the files.

Parameters:
  • path (string) – The path of the file that raised the exception
  • message (string) – The error message
class cece.parser.Parser(config)[source]

The parser object.

Parameters:config (dict) – The configuration
parse()[source]

Parse the files and cache the parsed result.

Returns:The parsed files, as a dictionary
_load_folder(meta, path)[source]

Load the contents of a folder into the cache.

Parameters:
  • meta (dict) – The meta data for the folder
  • path (string) – The path of the folder
_load_guide(meta, path)[source]

Load the contents of the guide into the cache.

Parameters:
  • meta (dict) – The meta data for the guide
  • path (string) – The path to the guide folder
_load_dirs(root_dir)[source]

Load a directory and its children.

Parameters:root_dir (string) – The path to the root dir to parse