springheel.parsemeta module¶
Parse metadata files.
-
springheel.parsemeta.
dictizeMeta
(m: list, file_name: str) → dict¶ Convert the plain metadata into a dictionary.
- Parameters
- mlist
A list of lines with colon-separated metadata.
- file_namestr
The path to the metadata file.
- Returns
- dict
The dictionary-fied metadata.
-
springheel.parsemeta.
getMetaCom
(meta_raw: list, translated_strings: dict) → Tuple[list, list]¶ Separate the metadata from formatting info and commentary.
- Parameters
- meta_rawlist
Lines from the metadata file.
- translated_stringsdict
The translation file contents for this site.
- Returns
- meta_nllist
Metadata lines with key: value pairs.
- commentslist
HTML-escaped creator commentary lines.
-
springheel.parsemeta.
parseMetadata
(file_name: str, translated_strings: dict, json_mode: bool) → Tuple[dict, str, list]¶ Read a comic strip metadata file.
- Parameters
- file_namestr
The path to the metadata file.
- translated_stringsdict
The translation file contents for this site.
- json_modebool
Whether to load the metadata file as JSON (True) or plain text (False).
- Returns
- metadict
A dictionary of strip metadata.
- commentarystr
Creator commentary formatted as HTML paragraphs.
- clist
Raw commentary block.
-
springheel.parsemeta.
readJsonMeta
(file_name: str, translated_strings: dict) → dict¶ Retrieve a metadata file in JSON format.
- Parameters
- file_namestr
The path to the metadata file.
- translated_stringsdict
The translation file contents for this site.
- Returns
- dict
A dictionary of strip metadata.
-
springheel.parsemeta.
readMeta
(file_name: str) → List[str]¶ Retrieve a metadata file.
- Parameters
- file_namestr
The path to the metadata file.
- Returns
- list of str
Lines from the metadata file.