comparison piecrust/commands/builtin/scaffolding.py @ 892:c445a3d5d950

internal: Make `createContent` use a dictionary-like object.
author Ludovic Chabant <ludovic@chabant.com>
date Sun, 02 Jul 2017 22:20:32 -0700
parents 58ae026b4c31
children a85b2827ba1a
comparison
equal deleted inserted replaced
891:f13d618cfec6 892:c445a3d5d950
80 tpl_text = ext.getTemplate(app, tpl_name) 80 tpl_text = ext.getTemplate(app, tpl_name)
81 if tpl_text is None: 81 if tpl_text is None:
82 raise Exception("Error loading template: %s" % tpl_name) 82 raise Exception("Error loading template: %s" % tpl_name)
83 83
84 source = ctx.args.source 84 source = ctx.args.source
85 content_item = source.createContent(ctx.args) 85 content_item = source.createContent(vars(ctx.args))
86 86
87 config_tokens = { 87 config_tokens = {
88 '%title%': "Untitled Content", 88 '%title%': "Untitled Content",
89 '%time.today%': time.strftime('%Y/%m/%d'), 89 '%time.today%': time.strftime('%Y/%m/%d'),
90 '%time.now%': time.strftime('%H:%M:%S') 90 '%time.now%': time.strftime('%H:%M:%S')