On 5/24/07, Shannon -jj Behrens <[EMAIL PROTECTED]> wrote:
>
> >  But it's still a hack: I'll have to write a special controller that
> will
> > return the html snippets I need.. Why I can't use Buffet API directly
> and
> > resort to HTTP?
>
> It seems that every framework fails to work very well if you don't at
> least pretend to be doing a full request.  I know Aquarium, my
> framework, was the same way.  Of course, you don't *actually* need to
> use HTTP.  You can use Paste fixture to fake it.


Indeed. It actually seems to work. Here is the code, for the record:

        from paste.deploy import loadapp
        app = loadapp('config:%s'%self.args[0], relative_to='.')
        from paste.fixture import TestApp
        test_app = TestApp(app)
        print test_app.get('/somepage') # returns html Unicode

I put it into a paster extension command in websetup.py and thus can invoke
it via cron as "paster phpcode /path/to/app.ini"

Thanks for your help,
Max.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" 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-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to