summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2019-09-15 15:30:15 +0200
committerElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2019-09-15 15:30:15 +0200
commit47904917efccafeb29013d040305b78c1b36e821 (patch)
tree350a668826f02ccd5592c202503ba69928722281
parent4c291a3710486eab6edd97b5e0619241f5909173 (diff)
Improvements in the export command
-rw-r--r--lesana/command.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/lesana/command.py b/lesana/command.py
index 15be857..3a3db55 100644
--- a/lesana/command.py
+++ b/lesana/command.py
@@ -275,17 +275,15 @@ class Export(Command):
for entry in results:
try:
template = collection.get_template(self.args.template)
- rendered = template.render(entry=entry)
- data = ruamel.yaml.load(
- template.render(entry=entry),
- ruamel.yaml.RoundTripLoader
- )
+ rendered = template.render(entry=entry, **entry.data)
except TemplatingError as e:
+ logging.error("Error converting entry: {}".format(entry))
logging.error("{}".format(e))
sys.exit(1)
try:
data = ruamel.yaml.load(rendered, ruamel.yaml.RoundTripLoader)
except ruamel.yaml.YAMLError as e:
+ logging.error("Error converting entry: {}".format(entry))
logging.error("{}".format(e))
sys.exit(1)
e = Entry(destination, data=data)