Appie module reference¶
Appie main class¶
-
class
appie.
Appie
(*args, **kwargs)[source]¶ -
add_directory_parser
(inst)¶ Adds a parser instance to match on directory names
Parameters: inst (instance) – parser instance
-
add_file_parser
(inst)¶ Adds a parser instance to match on filenames
Parameters: inst (instance) – parser instance
-
parse
()¶ Parse the full directory tree in self._buildroot
-
parse_file
(d, wd='')¶ Parse a dictionary leaf
Parameters: - d (dict) – the dictionary to parse
- wd (string) – string containing the target directory
-
save_dict
(d, filepath)¶ Save dictionary to json file
Parameters: - d (dict) – the dictionary to save
- filepath (string) – string containing the full target filepath
-
Appie Base Parsers¶
-
class
appie.
AppieBaseParser
[source]¶ The default parser, does nothing but load files prepended with ‘_’ (underscore)
-
parse
(match_key, d, wd, *args, **kwargs)¶ Parses the dictionary d if match_key matches something it wants. Raises StopParsing if it doesn’t allow for for further parsing of its tree.
Parameters: - match_key (str) – filename to match on
- d (dict) – dictionary belonging to match_key
- wd (list) – current working directory as a list
-
-
class
appie.
AppieTextileParser
[source]¶ Simple textile file to html parser
-
parse
(match_key, d, wd, *args, **kwargs)[source]¶ Parses textile files (match_key) with .textile extension to html. Raises AppieExceptStopParsing when a file is matched and parsed.
Parameters: - match_key (str) – filename to match on
- d (dict) – dictionary belonging to match_key
- wd (list) – current working directory as a list
-
Appie Extensions¶
-
class
appie.extensions.
AppieJPGParser
(*args, **kwargs)[source]¶ PNG parser converting JPGs to progressive JPG and a JPG thumb if they are larger than the ‘jpg_size’ setting.
Note: to not parse JPG images and just copy them to the build root use a captital extension (.JPG). The parsers are case sensitive!