make cleanyaml.py get all yaml files in the directory and then run it
parent
a9765b85b7
commit
de1765445e
|
@ -236,7 +236,10 @@ ancestries:
|
||||||
to add your level to the Hit Points you regain from their treatment.
|
to add your level to the Hit Points you regain from their treatment.
|
||||||
feat: null
|
feat: null
|
||||||
name: Hillock Halfling
|
name: Hillock Halfling
|
||||||
- descr: Your ancestors have traveled from place to place for generations, never content to settle down. You gain two additional languages of your choice, chosen from among the common and uncommon languages available to you, and every time you take the Multilingual feat, you gain another new language.
|
- descr: Your ancestors have traveled from place to place for generations, never
|
||||||
|
content to settle down. You gain two additional languages of your choice, chosen
|
||||||
|
from among the common and uncommon languages available to you, and every time
|
||||||
|
you take the Multilingual feat, you gain another new language.
|
||||||
feat: null
|
feat: null
|
||||||
name: Nomadic Halfling
|
name: Nomadic Halfling
|
||||||
- descr: Your ancestors performed many secret acts under the concealing cover of
|
- descr: Your ancestors performed many secret acts under the concealing cover of
|
||||||
|
@ -268,16 +271,16 @@ ancestries:
|
||||||
flavor_text: TODO
|
flavor_text: TODO
|
||||||
flaws: null
|
flaws: null
|
||||||
heritages:
|
heritages:
|
||||||
- descr: Either one of your parents was an elf, or one or both were half-elves. You
|
- descr: Either one of your parents was an elf, or one or both were half-elves.
|
||||||
have pointed ears and other telltale signs of elf heritage. You gain the elf trait
|
You have pointed ears and other telltale signs of elf heritage. You gain the
|
||||||
and low-light vision. In addition, you can select elf, half-elf, and human feats
|
elf trait and low-light vision. In addition, you can select elf, half-elf, and
|
||||||
whenever you gain an ancestry feat.
|
human feats whenever you gain an ancestry feat.
|
||||||
feat: null
|
feat: null
|
||||||
name: Half-Elf
|
name: Half-Elf
|
||||||
- descr: One of your parents was an orc, or one or both were half-orcs. You have a
|
- descr: One of your parents was an orc, or one or both were half-orcs. You have
|
||||||
green tinge to your skin and other indicators of orc heritage. You gain the orc
|
a green tinge to your skin and other indicators of orc heritage. You gain the
|
||||||
trait and low-light vision. In addition, you can select orc, half-orc, and human
|
orc trait and low-light vision. In addition, you can select orc, half-orc, and
|
||||||
feats whenever you gain an ancestry feat.
|
human feats whenever you gain an ancestry feat.
|
||||||
feat: null
|
feat: null
|
||||||
name: Half-Orc
|
name: Half-Orc
|
||||||
- descr: Your ingenuity allows you to train in a wide variety of skills. You become
|
- descr: Your ingenuity allows you to train in a wide variety of skills. You become
|
||||||
|
@ -286,9 +289,9 @@ ancestries:
|
||||||
feat: null
|
feat: null
|
||||||
name: Skilled Heritage
|
name: Skilled Heritage
|
||||||
- descr: Humanity’s versatility and ambition have fueled its ascendance to be the
|
- descr: Humanity’s versatility and ambition have fueled its ascendance to be the
|
||||||
most common ancestry in most nations throughout the world. Select a general feat
|
most common ancestry in most nations throughout the world. Select a general
|
||||||
of your choice for which you meet the prerequisites (as with your ancestry feat,
|
feat of your choice for which you meet the prerequisites (as with your ancestry
|
||||||
you can select this general feat at any point during character creation).
|
feat, you can select this general feat at any point during character creation).
|
||||||
feat: null
|
feat: null
|
||||||
name: Versatile Heritage
|
name: Versatile Heritage
|
||||||
hp: 8
|
hp: 8
|
||||||
|
|
|
@ -2,27 +2,33 @@
|
||||||
# TO CLEAN UP AND ORDER ALL THE YAML
|
# TO CLEAN UP AND ORDER ALL THE YAML
|
||||||
|
|
||||||
import yaml
|
import yaml
|
||||||
|
import glob
|
||||||
|
import os
|
||||||
|
|
||||||
yfiles = [
|
|
||||||
"actions.yaml", "ancestries.yaml", "armor.yaml", "backgrounds.yaml",
|
|
||||||
"basics.yaml", "bulks.yaml", "conditions.yaml", "damage.yaml",
|
|
||||||
"feats-levels-false-matches.yaml", "feats.yaml", "langs.yaml",
|
|
||||||
"monsters.yaml", "requirements.yaml", "senses.yaml", "skills.yaml",
|
|
||||||
"sources.yaml", "spells.yaml", "traits.yaml", "triggers.yaml"
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
||||||
|
# gets all files with a yaml extension in the directory
|
||||||
|
yfiles = []
|
||||||
|
for file in glob.glob("*.yaml"):
|
||||||
|
yfiles.append(file)
|
||||||
|
|
||||||
|
yfiles.sort()
|
||||||
|
print(yfiles)
|
||||||
|
|
||||||
for x in yfiles:
|
for x in yfiles:
|
||||||
print("Doing: {}".format(x))
|
print("Doing: {}".format(x))
|
||||||
with open(x, 'r') as r:
|
with open(x, 'r') as r:
|
||||||
data = yaml.full_load(r)
|
data = yaml.full_load(r)
|
||||||
if x == "feats.yaml":
|
if x == "feats.yaml":
|
||||||
for i in data['feat']:
|
for i in data['feat']:
|
||||||
|
# This is to clean out smart quotes that made it into the
|
||||||
|
# yaml file so it matches the requirements.yaml
|
||||||
if i['requirement'] != None:
|
if i['requirement'] != None:
|
||||||
print("Before: {}".format(i['requirement']))
|
# print("Before: {}".format(i['requirement']))
|
||||||
i['requirement'] = i['requirement'].replace('’', "'")
|
i['requirement'] = i['requirement'].replace('’', "'")
|
||||||
print("After: {}".format(i['requirement']))
|
# print("After: {}".format(i['requirement']))
|
||||||
final = yaml.safe_dump(data, allow_unicode=True)
|
final = yaml.safe_dump(data, allow_unicode=True)
|
||||||
with open(x, 'w') as f:
|
with open(x, 'w') as f:
|
||||||
f.write(final)
|
f.write(final)
|
||||||
|
|
Loading…
Reference in New Issue