On Sat, Oct 10, 2009 at 10:38 PM, Matt Feifarek <matt.feifa...@gmail.com> wrote:
>> 2. Patch Paste Deploy with a new loader class, to load a function spec
>> instead of an egg spec, without changing anything else about the INI
>> file format. In other words, my app:main looks like this:
>>
>> [app:main]
>> use = func:myhello.config.middleware:make_app
>> full_stack = true
>
> I'm not following completely. Does this make the GAE SDK http/app server
> become aware of your ini file somehow? If not, the func: you made seems to
> have the exact same effect as the normal pylons behavior; it still runs
> make_app... that's the WSGI starting point, right? (Also,
> middleware:make_app is the "entry point" for a pylons app).

It sounds like he has a load routine that imports
myhello.config.middleware rather than going through the entry point.
This is how you would do it "without Setuptools".

An entry point is an indirect name for a callable.  This is a
Setuptools thing.  A consumer package documents that it looks for a
certain entry point (a namespace).  Any number of producer packages
can define entries in this namespace, which is a short name and a
string specifying "package.module:object".  The user (i.e., the
application's configuration) tells the consumer to load a certain
name, using ``pkg_resources.load_entry_point()``.  Setuptools goes
through the entry point to find the callable, imports it, and returns
it.  In Pylons' case, PasteDeploy is the consumer, and your Pylons
application is the producer.  Entry points are defined in setup.py,
and are written into the egg-info directory during install.

Even if you don't use the whole appengine-homedir infrastructure, it's
worth looking at the top-level script (runner.py, I think it's
called).  It does the same thing but bypasses PasteDeploy and the INI
file.  It's "different" in the front end, but once you call make_app()
it's the same.

>> 3. Hack on Mako/the render function a bit. I'm still not done with
>> this one. Mako's TemplateLookup uses various non-supported functions
>> such as os.makedirs and tempfile.mkstmp. The Template class works
>> fine, of course, but TemplateLookup is rather critical for any serious
>> usage. Has this been addressed elsewhere?
>
> Yep, I think that Mako can live happily on GAE. I think that commenting out
> cache_dir line in environment basically accomplishes what you're working on.

Mako caches compiled templates in the data directory.  That won't work
on GAE because there's no filesystem.  You could try making an
equivalent with Datastore or Memcached, but it would take some
programming.

-- 
Mike Orr <sluggos...@gmail.com>

--~--~---------~--~----~------------~-------~--~----~
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 
pylons-discuss+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to