Which Template() is it? I get the following error?
>>>> from paste.script.templates import Template
>>>>for filename in vars['myurl']:
>>>> if txt in filename:
>>>> source_filename = os.path.join(os.path.dirname(__file__),
>>>> 'my_templates/text.txt_tmpl')
>>>> content = Template(filename=source_filename).substitute(**vars)
>>>> self.ensure_file(filename, content)
File "/home/lucas/tmp/myapp/myapp/__init__.py", line 43, in post
content = Template(filename=source_filename).substitute(**vars)
TypeError: __init__() got an unexpected keyword argument 'filename'
Question 2 In details:
source_filename = os.path.join(os.path.dirname(__file__),
'my_templates/text.txt_tmpl')
Above tells where my template file is correct?
>>>> content = Template(filename=source_filename).substitute(**vars)
This fills in my cheetah template. If I pass a dictionary **vars how
do I reference my list of variables? It seems to me I should be
passing .substitute(**vars,filename). Can I do that?
>>>> self.ensure_file(filename, content)
Filename above should be '+package+/myfile.txt' or
'+package+/DB/myfile.txt' if I want it to appear in under +package+
folder or under DB folder inside the +package+?? or?
Thanks,
Lucas
_______________________________________________
Paste-users mailing list
[email protected]
http://webwareforpython.org/cgi-bin/mailman/listinfo/paste-users