Skip to content
This repository has been archived by the owner on May 9, 2018. It is now read-only.

Commit

Permalink
Update compendium.
Browse files Browse the repository at this point in the history
  • Loading branch information
spladug committed Apr 1, 2013
1 parent a87c25e commit 218a54e
Show file tree
Hide file tree
Showing 2 changed files with 174 additions and 132 deletions.
12 changes: 7 additions & 5 deletions csv_to_compendium.py
Expand Up @@ -21,9 +21,10 @@
}


MARKDOWN = {
"description",
"flavor",
CONVERTERS = {
"damage": int,
"description": snudown.markdown,
"flavor": snudown.markdown,
}


Expand All @@ -44,8 +45,9 @@
continue

value = value.strip()
if output_key in MARKDOWN and value:
item_data[output_key] = snudown.markdown(value)
converter = CONVERTERS.get(output_key)
if converter and value:
item_data[output_key] = converter(value)
else:
item_data[output_key] = value or DEFAULTS.get(output_key, "")

Expand Down

0 comments on commit 218a54e

Please sign in to comment.