Add command line utility to validate YAML
This commit is contained in:
parent
f1338e5970
commit
4ebb08f68e
2 changed files with 35 additions and 12 deletions
24
validate_yaml.py
Executable file
24
validate_yaml.py
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/python3
|
||||
"""Load YAML data to ensure validity."""
|
||||
|
||||
import os
|
||||
|
||||
import agenda.conference
|
||||
import agenda.travel
|
||||
import agenda.trip
|
||||
|
||||
config = __import__("config.default", fromlist=[""])
|
||||
|
||||
data_dir = config.PERSONAL_DATA
|
||||
|
||||
trip_list = agenda.trip.build_trip_list(data_dir)
|
||||
print(len(trip_list), "trips")
|
||||
|
||||
flights = agenda.travel.parse_yaml("flights", data_dir)
|
||||
print(len(flights), "flights")
|
||||
|
||||
trains = agenda.travel.parse_yaml("trains", data_dir)
|
||||
print(len(trains), "trains")
|
||||
|
||||
conferences = agenda.conference.get_list(os.path.join(data_dir, "conferences.yaml"))
|
||||
print(len(conferences), "conferences")
|
||||
Loading…
Add table
Add a link
Reference in a new issue