Re: Wiki page for Documentation Suggestions

2007-11-29 Thread Christoph Haas

On Thu, Nov 29, 2007 at 09:02:31AM +0200, Max Ischenko wrote:
 On 11/29/07, Christoph Haas [EMAIL PROTECTED] wrote:
 
 But Pylons is moving. And people find out interesting things and develop
 nifty ideas every day. We discuss them on IRC but in this case I'd love
 to have a planet pylons. thinkingThe planet software would be a
 possible
 choice for an aggregator./thinking
 
 
 Well, if you're worried that interesting bits of information could be lost 
 than
 a  weekly/bi-weekly newsletter could be a better tool.

So people would send their findings and opinions to the newsletter team
who then aggregate it to a newsletter that is sent to this list? Not
sure if that's the spirit I'm thinking of. :)

/2ยข

Cheers
 Christoph

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



formencode invalid exception

2007-11-29 Thread Anil

I am using Formencode and it seems that it throws an uuencoded Invalid
exception and flup seems to have problems with it. I don't notice it
on another server with the same code and same version of Pylons/flup.

Whats the best way to fix this? If I should encode the form error
message to utf-8, where and how should I do that?


type 'exceptions.AssertionError'  Python 2.5.1: /usr/local/bin/python2.5
Thu Nov 29 11:32:34 2007

A problem occurred in a Python script. Here is the sequence of
function calls leading up to the error, in the order they occurred.
 /opt/abc/build/bdist.freebsd-6.2-RELEASE-amd64/egg/flup/server/scgi_base.py
in run(self=flup.server.scgi_base.Request object at 0x8d9f82c)
  183
  184 try:
  185 self._conn.server.handler(self)
  186 except:
  187 self.logger.exception('Exception caught from handler')
 /opt/abc/build/bdist.freebsd-6.2-RELEASE-amd64/egg/flup/server/scgi_base.py
in handler(self=flup.server.scgi.WSGIServer object at 0x849e8ec,
request=flup.server.scgi_base.Request object at 0x8d9f82c)
  458 for data in result:
  459 if data:
  460 write(data)
  461 if not headers_sent:
  462 write('') # in case body was empty
 /opt/abc/build/bdist.freebsd-6.2-RELEASE-amd64/egg/flup/server/scgi_base.py
in write(data=Invalid(u'Please enter an email address',))
  400
  401 def write(data):
  402 assert type(data) is str, 'write() argument must be string'
  403 assert headers_set, 'write() before start_response()'
  404

type 'exceptions.AssertionError': write() argument must be string

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



Re: [FE-discuss] formencode invalid exception

2007-11-29 Thread Ian Bicking

Anil wrote:
 I am using Formencode and it seems that it throws an uuencoded Invalid
 exception and flup seems to have problems with it. I don't notice it
 on another server with the same code and same version of Pylons/flup.
 
 Whats the best way to fix this? If I should encode the form error
 message to utf-8, where and how should I do that?

This is probably a flup bug, as it should handle unicode exceptions 
properly.

Of course generally you catch Invalid exceptions and handle them.  But 
flup should handle it more gracefully when you don't.

I've copied Allan, the flup author, on this.

 
 type 'exceptions.AssertionError'Python 2.5.1: /usr/local/bin/python2.5
 Thu Nov 29 11:32:34 2007
 
 A problem occurred in a Python script. Here is the sequence of
 function calls leading up to the error, in the order they occurred.
  /opt/abc/build/bdist.freebsd-6.2-RELEASE-amd64/egg/flup/server/scgi_base.py
 in run(self=flup.server.scgi_base.Request object at 0x8d9f82c)
   183
   184 try:
   185 self._conn.server.handler(self)
   186 except:
   187 self.logger.exception('Exception caught from handler')
  /opt/abc/build/bdist.freebsd-6.2-RELEASE-amd64/egg/flup/server/scgi_base.py
 in handler(self=flup.server.scgi.WSGIServer object at 0x849e8ec,
 request=flup.server.scgi_base.Request object at 0x8d9f82c)
   458 for data in result:
   459 if data:
   460 write(data)
   461 if not headers_sent:
   462 write('') # in case body was empty
  /opt/abc/build/bdist.freebsd-6.2-RELEASE-amd64/egg/flup/server/scgi_base.py
 in write(data=Invalid(u'Please enter an email address',))
   400
   401 def write(data):
   402 assert type(data) is str, 'write() argument must be string'
   403 assert headers_set, 'write() before start_response()'
   404
 
 type 'exceptions.AssertionError': write() argument must be string

-- 
Ian Bicking : [EMAIL PROTECTED] : http://blog.ianbicking.org

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



Re: [FE-discuss] formencode invalid exception

2007-11-29 Thread Anil

I have:
def reset(self):
 Reset password for email given in POST arguments 
from formencode import validators

mail_validator = validators.Email(not_empty=True)
try:
mail = request.params.get(mail)
mail_validator.to_python(mail)
except validators.Invalid, e:
return e

Which is called through a AJAX h.submit_to_remote call, which updates
a DIV element with the e.


Actually, I sent an email to Allan before, and he sent:

The application/framework is responsible for all encoding/decoding,
according to the WSGI spec:

http://www.python.org/dev/peps/pep-0333/#unicode-issues

The WSGI interface only supports plain strings.

- Allan



On Nov 29, 2007 11:56 AM, Ian Bicking [EMAIL PROTECTED] wrote:
 Anil wrote:
  I am using Formencode and it seems that it throws an uuencoded Invalid
  exception and flup seems to have problems with it. I don't notice it
  on another server with the same code and same version of Pylons/flup.
 
  Whats the best way to fix this? If I should encode the form error
  message to utf-8, where and how should I do that?

 This is probably a flup bug, as it should handle unicode exceptions
 properly.

 Of course generally you catch Invalid exceptions and handle them.  But
 flup should handle it more gracefully when you don't.

 I've copied Allan, the flup author, on this.


 
  type 'exceptions.AssertionError'Python 2.5.1: /usr/local/bin/python2.5
  Thu Nov 29 11:32:34 2007
 
  A problem occurred in a Python script. Here is the sequence of
  function calls leading up to the error, in the order they occurred.
   /opt/abc/build/bdist.freebsd-6.2-RELEASE-amd64/egg/flup/server/scgi_base.py
  in run(self=flup.server.scgi_base.Request object at 0x8d9f82c)
183
184 try:
185 self._conn.server.handler(self)
186 except:
187 self.logger.exception('Exception caught from handler')
   /opt/abc/build/bdist.freebsd-6.2-RELEASE-amd64/egg/flup/server/scgi_base.py
  in handler(self=flup.server.scgi.WSGIServer object at 0x849e8ec,
  request=flup.server.scgi_base.Request object at 0x8d9f82c)
458 for data in result:
459 if data:
460 write(data)
461 if not headers_sent:
462 write('') # in case body was empty
   /opt/abc/build/bdist.freebsd-6.2-RELEASE-amd64/egg/flup/server/scgi_base.py
  in write(data=Invalid(u'Please enter an email address',))
400
401 def write(data):
402 assert type(data) is str, 'write() argument must be 
  string'
403 assert headers_set, 'write() before start_response()'
404
 
  type 'exceptions.AssertionError': write() argument must be string

 --
 Ian Bicking : [EMAIL PROTECTED] : http://blog.ianbicking.org


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



Re: [FE-discuss] formencode invalid exception

2007-11-29 Thread Ian Bicking

Anil wrote:
 I have:
 def reset(self):
  Reset password for email given in POST arguments 
 from formencode import validators
 
 mail_validator = validators.Email(not_empty=True)
 try:
 mail = request.params.get(mail)
 mail_validator.to_python(mail)
 except validators.Invalid, e:
 return e
 
 Which is called through a AJAX h.submit_to_remote call, which updates
 a DIV element with the e.
 
 
 Actually, I sent an email to Allan before, and he sent:
 
 The application/framework is responsible for all encoding/decoding,
 according to the WSGI spec:
 
 http://www.python.org/dev/peps/pep-0333/#unicode-issues
 
 The WSGI interface only supports plain strings.

Ah... I thought the exception was from the flup error handler trying to 
format the exception somehow.

Probably whatever calls reset() should do return 
unicode(self.reset()).encode('utf8')

-- 
Ian Bicking : [EMAIL PROTECTED] : http://blog.ianbicking.org

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



Re: egg-info

2007-11-29 Thread Philip Jenvey


On Nov 27, 2007, at 5:00 PM, Mike Orr wrote:


 Is it necessary to put the egg-info directory in version control?
 Every time i run python setup.py develop it updates those files,
 which I have to keep checking in.  Are they necessary for a production
 system given that python setup.py develop seems to recreate them
 fine if they're missing?


The production ini template currently resides in the .egg-info  
directory, and it needs to be versioned controlled.

This is sucky: the template should just reside in the root directory  
of the project, so folks don't have to worry about revision  
controlling the egg-info dir. IIRC PasteScript hardcodes the template  
location there.

There's also a paster_plugins.txt in there that can break things if  
it's not maintained. But this is really a bug (of a different nature)  
-- the file belongs there, but rerunning setup.py egg_info should  
recreate it. There's an open ticket about it:

http://pylonshq.com/project/pylonshq/ticket/282


--
Philip Jenvey



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



Re: Wiki page for Documentation Suggestions

2007-11-29 Thread Ches Martin

Thanks to all for feedback and contributions. I should also note that
Ian Bicking added some bits before most of you probably got there, so
it's not all me.

On Nov 28, 4:28 pm, Mike Orr [EMAIL PROTECTED] wrote:

 One meta-issue is that the Pylons Cookbook space has become the
 dumping ground for everything because it's the only space everybody
 has guaranteed write access.  There are topics such as this, improving
 the Pylons core, etc, that aren't really Cookbook material.

 Likewise, the Pylons Community space has tutorials which arguably
 *are* Cookbook material.  It has never been made clear what the Pylons
 Community space is for.  Is it for marketing/branding/website topics?
 Is it a miscellaneous space for community members to put anything in?

I agree on all points. I think the need to get some of those things
moved to the right places has been acknowledged, but the wider need
for clarification is a good point.

On Nov 28, 5:09 pm, Christoph Haas [EMAIL PROTECTED] wrote:

 Web:http://workaround.org/pylons/beginning-pylons.html
 Mercurial:http://workaround.org/cgi-bin/hg-beginning-pylons

I found your cheatsheet when I first came to Pylons, and it's great.
Hadn't seen this though, that's quite a comprehensive introductory
article (or well on the way). Planning a little evangelism talk for
the local user group soon, and you've covered most of what was in my
initial outline.

 (No, I wouldn't want to write it online in the wiki. A traditional text
 editor and a good repository system is what I need to work. Confluence
 just got me mad.)

It might be for the good of all if we cooked up a little tool to
submit your VC commits via XML-RPC. ;-)

 The worst thing is planet.debian.org where fellow Debian
 developers bore me to death and later claim that the information
 has been published by blogging it there hidden underneath a pile
 of soporific personal spam. Argh!

Geez, that is bad. The usefulness does kind of depend on people being
judicious about what they give the 'pylons' tag to, I guess... That
was a sudden brainstorm, but I do think it would be cool as a resource
*and* an example Pylons site in production, if hosting resources were
made available from somewhere. Doesn't hurt that in feedparser Python
has the best lib around for the purpose.

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



Re: egg-info

2007-11-29 Thread Philip Jenvey


On Nov 29, 2007, at 3:41 PM, Philip Jenvey wrote:


 This is sucky: the template should just reside in the root directory
 of the project, so folks don't have to worry about revision
 controlling the egg-info dir. IIRC PasteScript hardcodes the template
 location there.


Oh, but of course the problem with having the production template in  
the root directory is running paster setup-app project on an  
installed project wouldn't have the template on hand -- it needs to  
be installed along with the project. Hmm..

--
Philip Jenvey



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



Wiki spaces

2007-11-29 Thread Mike Orr

On Nov 29, 2007 9:14 PM, Ches Martin [EMAIL PROTECTED] wrote:
 On Nov 28, 4:28 pm, Mike Orr [EMAIL PROTECTED] wrote:

  One meta-issue is that the Pylons Cookbook space has become the
  dumping ground for everything because it's the only space everybody
  has guaranteed write access.  There are topics such as this, improving
  the Pylons core, etc, that aren't really Cookbook material.
 
  Likewise, the Pylons Community space has tutorials which arguably
  *are* Cookbook material.  It has never been made clear what the Pylons
  Community space is for.  Is it for marketing/branding/website topics?
  Is it a miscellaneous space for community members to put anything in?

 I agree on all points. I think the need to get some of those things
 moved to the right places has been acknowledged, but the wider need
 for clarification is a good point.

First we have to determine what the right spaces are. :)  The Cookbook
was meant to be the place for HOWTOs, tutorials, and code examples,
and I'd like to limit it to that.  This means several other topics
need a home:

- Miscellaneous
- Project design space (the Superwiki to replace Confluence, CMS, CRUD
 admin components)
- Feedback to the core developers: how users like the current version,
what they'd like to see in the next version
- Pylons development version: how to make your app compatable, what
works/doesn't work, what's coming.  (This may be Cookbook material;
but users might play a greater role if they had a structured place to
provide feedback.)
- Marketing Pylons / logo / Web site design
- Job postings / jobs wanted
- News (prob'ly belongs on the website but there is an empty page for
it in the Community space; this may be a job for Planet Pylons)

Once we get clarification on what the Community space is for, we can
either move stuff there or to new space(s).  Every idea starts out
small, so we at least need a miscellaneous space, whatever it's
called.

There's a part about Community that needs to be distinguished from the
miscellania: announcing what the community is and what channels are
available, how to get involved, what the community structure should
be, and a place to build new modes of community (e.g., sprints).
Maybe news about what different parts of the community are doing.  So
I lean toward limiting the Community space to things like that.
Non-technical stuff (e.g., marketing) is currently in the Community
space;
that seems like a good place for it.

-- 
Mike Orr [EMAIL PROTECTED]

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



routes module not being found.

2007-11-29 Thread SamDonaldson

Hello,

I have a really weird error all of a sudden.  When I try to run any
python script in pylons, I get this error:

File /home/saureen/work/main/site/fr/__init__.py, line 8, in ?
from fr.config.middleware import make_app
  File /home/saureen/work/main/site/fr/config/middleware.py, line 8,
in ?
from pylons.error import error_template
  File /usr/lib/python2.4/site-packages/Pylons-0.9.5-py2.4.egg/pylons/
__init__.py, line 5, in ?
from pylons.legacy import Controller, h, jsonify
  File /usr/lib/python2.4/site-packages/Pylons-0.9.5-py2.4.egg/pylons/
legacy.py, line 11, in ?
from pylons.controllers import Controller as OrigController
  File /usr/lib/python2.4/site-packages/Pylons-0.9.5-py2.4.egg/pylons/
controllers.py, line 12, in ?
from pylons.helpers import abort
  File /usr/lib/python2.4/site-packages/Pylons-0.9.5-py2.4.egg/pylons/
helpers.py, line 7, in ?
from routes import url_for
ImportError: No module named routes

I can't import routes from anywhere.  I can import it if I'm in that
directory under the Routes-* site package but otherwise, I can't
import it in a python console.  Does anybody know what happened and
how I could remedy this.  Anything would be appreciated.

Thanks,

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



Re: egg-info

2007-11-29 Thread Mike Orr

On Nov 29, 2007 10:16 PM, Philip Jenvey [EMAIL PROTECTED] wrote:


 On Nov 29, 2007, at 3:41 PM, Philip Jenvey wrote:

 
  This is sucky: the template should just reside in the root directory
  of the project, so folks don't have to worry about revision
  controlling the egg-info dir. IIRC PasteScript hardcodes the template
  location there.
 

 Oh, but of course the problem with having the production template in
 the root directory is running paster setup-app project on an
 installed project wouldn't have the template on hand -- it needs to
 be installed along with the project. Hmm..

All these issues are what make me question the wisdom of installing
apps as eggs and using paster setup-app at all.  Just copy
development.ini to production.ini and make any necessary changes (you
do want to version control production.ini, right?), copy the
application directory to the server, run python setup.py develop,
dump/restore your databases and empty them if necessary, and you're
done.

No need to install a zipped egg into site-packages and then wonder
where to put your .ini file  and data directory.

No need to write a setup-app script that prepares the environment for
*one* before-and-after scenario that may not quite fit the current
situation, especially if you have existing data or are modifying the
database.  You had to create the database long ago to build the
application, right?  So why recreate it when you can just copy a
database that works?

No need to run make-config and merge all your custom settings from
development.ini.  Just copy it and change the debug variable and email
address.

Installing Python apps as eggs makes sense if you're distributing a
public egg or managing a large server farm, but what percentage of
Python applications will ever be deployed this way anyway?

-- 
Mike Orr [EMAIL PROTECTED]

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