On Dec 14, 2007, at 12:14 AM, Max Ischenko wrote:

> Hello,
>
> Would it be OK to add default file encoding declaration (utf8)  
> to .py/.mako files that PasteScript generates? It won't hurt anyone  
> but help those who doesn't code in ascii and may be even catch a  
> few unicode errors.
>
> Should I submit a patch?
>

Our PasteScript template doesn't generate any .mako files, but it's  
easy enough to add a mako.input_encoding = 'utf-8' template option to  
enable utf-8 coding for all mako files.

I'm not sure I think it's worth the effort to add (and maintain)  
support for this, but I suppose we could integrate it if a patch was  
provided (but probably at a later date, see below).

It would have to be optional, as unfortunately not everyone wants to  
default to the utf-8 encoding. Along the lines of:

paster create -t pylons helloworld source_encoding=utf-8

Then the paster controller command should support the same option:

paster controller hello source_encoding=utf-8

Note that paster controller doesn't know anything about VAR=VALUE  
options yet.

We have plans to revamp the project template pretty soon, probably  
for 0.9.7. What we want to do is add more options to the template  
creation process (the big one being SQLAlchemy support, and possibly  
others) and conditionally generate lines of code depending on those  
options. We do a little bit of conditional code generation now, but  
we need to do a lot more of it to provide optional SQLAlchemy support.

So to make that easier we'll be moving our paster template to a  
different templating language with better support for conditionals --  
possibly Tempita or Mako (since we already depend on Mako).

--
Philip Jenvey



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-devel" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-devel?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to