On Tue, Jul 15, 2008 at 9:15 PM, Ian Bicking <[EMAIL PROTECTED]> wrote:
> Lukasz Szybalski wrote:
>>
>> On Fri, Jul 11, 2008 at 2:18 PM, Ian Bicking <[EMAIL PROTECTED]> wrote:
>>>
>>> Lukasz Szybalski wrote:
>>>>
>>>> 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'
>>>
>>> Like I said, I don't remember how to instantiate Cheetah templates.
>>>
>>
>>  from Cheetah.Template import Template
>>  content = Template(file=source_filename,searchList=[vars])
>>
>>
>>>>>>>>  self.ensure_file(filename, content)
>>
>> But I guess this self.ensure_file should be
>> command.ensure_file in post command.
>>
>> def post(self, command, output_dir, vars):
>>   ....
>>   command.ensure_file(filename, content)
>>
>> but I get this error:
>>  File "/var/lib/python-support/python2.5/paste/script/create_distro.py",
>> line 125, in command
>>    template, output_dir, vars)
>>  File "/var/lib/python-support/python2.5/paste/script/create_distro.py",
>> line 167, in create_template
>>    template.run(self, output_dir, vars)
>>  File "/var/lib/python-support/python2.5/paste/script/templates.py",
>> line 58, in run
>>    self.post(command, output_dir, vars)
>>  File "/home/lucas/tmp/myapp/myapp/__init__.py", line 46, in post
>>    command.ensure_file(filename, content)
>>  File "/var/lib/python-support/python2.5/paste/script/command.py",
>> line 438, in ensure_file
>>    content.splitlines(),
>> AttributeError: '_home_lucas_tmp_myapp_myapp_myapp_temp' object has no
>> attribute 'splitlines'
>>
>>
>>
>> Any idea why?
>
> You need to pass it a string object.

Thanks. Can't believe it was that easy.


Is there a reason Im getting this description????


A. HISTORY OF THE SOFTWARE
==========================

Python was created in the early 1990s by Guido van Rossum at Stichting
Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands
as a successor of a language called ABC.  Guido remains Python's
principal author, although it includes many contributions from others.

In 1995, Guido continued his work on Python at the Corporation for
National Research Initiatives (CNRI, see http://www.cnri.reston.va.us)
in Reston, Virginia where he released several versions of the
software.

In May 2000, Guido and the Python core development team moved to
BeOpen.com to form the BeOpen PythonLabs team.  In October of the same
year, the PythonLabs team moved to Digital Creations (now Zope
Corporation, see http://www.zope.com).  In 2001, the Python Software
Foundation (PSF, see http://www.python.org/psf/) was formed, a
non-profit organization created specifically to own Python-related
Intellectual Property.  Zope Corporation is a sponsoring member of
the PSF.

All Python releases are Open Source (see http://www.opensource.org for
Hit Return for more, or q (and Return) to quit: q

_______________________________________________
Paste-users mailing list
[email protected]
http://webwareforpython.org/cgi-bin/mailman/listinfo/paste-users

Reply via email to