Re: [Paste] Pyramid on Python 3.2

2011-09-25 Thread Michael Merickel
On Sun, Sep 25, 2011 at 7:45 PM, Mike Orr  wrote:

> I guess we should spec out what we're using in PasteDeploy and
> PasteScript. Then we can either write a minimal tool(s) for Pyramid
> that does that, or look for something that does that. If it's a
> Pyramid tool, we can use Mako or Chameleon, which are already
> dependencies. If it's a generic tool, we can probably use Tempita
> because it's tiny.
>

I don't see any reason this tool would be Pyramid-specific. PasteScript is
generally useful and I haven't seen a compelling reason to change that.


> I agree that for this purpose we don't want to change the INI syntax;
> that would be a separate project. Although we could replace %(here)s
> with {here} as minor improvement. One of the nastiest parts of
> PasteDeploy was reading the INI file on demand the way Pylons does it;
> that requires doing ugly imports and replicating what Paste does
> because the functions were ill-named and didn't encapsulate the level
> you needed. There's a Pyramid function now that loads an application
> for you, but the part about reading a generic section and recognizing
> Paste'isms like %(here)s isn't done, so that would be one of the
> goals.
>

This is also entirely independent of the porting issue. PasteDeploy is
already ported so we aren't actively searching for a replacement for the
reason of running it on py3k.


> We need a standalone HTTP server of some sort to run out of the box.
> If not paste.httpserver, what then?


PasteScript already bundles the CherryPy WSGI server in its package. This
would probably be the logical thing to keep when looking for a default
cross-version compatible server to use. Most other servers I'm aware of are
not pure-python and have higher barrier to entry when setting up.

-- 

Michael

-- 
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.



Re: [Paste] Pyramid on Python 3.2

2011-09-25 Thread Rick Harding
On Mon, 26 Sep 2011, Sebastien Douche wrote:

> On Mon, Sep 26, 2011 at 02:45, Mike Orr  wrote:
> > We need a standalone HTTP server of some sort to run out of the box.
> > If not paste.httpserver, what then?
> 
> gunicorn?[1]
> 
> 
> [1] http://gunicorn.org/
> 
> -- 
> Sebastien Douche 
> Twitter : @sdouche

I've used swanging for some wsgi testing when working in middleware before
and seems to have worked well enough. It's in pypi. 

http://pypi.python.org/pypi/Spawning/0.7


-- 

Rick Harding
@mitechie
http://blog.mitechie.com
http://lococast.net

-- 
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.



Re: [Paste] Pyramid on Python 3.2

2011-09-25 Thread Sebastien Douche
On Mon, Sep 26, 2011 at 02:45, Mike Orr  wrote:
> We need a standalone HTTP server of some sort to run out of the box.
> If not paste.httpserver, what then?

gunicorn?[1]


[1] http://gunicorn.org/

-- 
Sebastien Douche 
Twitter : @sdouche

-- 
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.



Re: [Paste] Pyramid on Python 3.2

2011-09-25 Thread Mike Orr
On Sun, Sep 25, 2011 at 5:09 PM, Michael Merickel  wrote:
> Pyramid is only actually dependent on PasteScript for the paster command and
> scaffolds, so whether Paste gets ported or not isn't a big deal. The paster
> command is used to generate scaffolds, start servers and the convenient
> ability to "paster request" simulate a request into a conforming WSGI app.
> If we are interested in porting PasteScript it's definitely an undertaking
> because there is a large amount of code unused by a basic Pyramid
> application. It'd probably be worth taking the opportunity to look into some
> fairly large bw-incompat changes to PasteScript to knock its capabilities
> into something more manageable. For example, it currently uses Cheetah to do
> templates which is not py3k compatible whereas Jinja2 is compat and more
> actively developed/supported.
> PasteDeploy has been ported, so hopefully INI file syntax can remain
> relatively unchanged minus the fact that it may be unlikely paste.httpserver
> is ported.

I guess we should spec out what we're using in PasteDeploy and
PasteScript. Then we can either write a minimal tool(s) for Pyramid
that does that, or look for something that does that. If it's a
Pyramid tool, we can use Mako or Chameleon, which are already
dependencies. If it's a generic tool, we can probably use Tempita
because it's tiny.

I agree that for this purpose we don't want to change the INI syntax;
that would be a separate project. Although we could replace %(here)s
with {here} as minor improvement. One of the nastiest parts of
PasteDeploy was reading the INI file on demand the way Pylons does it;
that requires doing ugly imports and replicating what Paste does
because the functions were ill-named and didn't encapsulate the level
you needed. There's a Pyramid function now that loads an application
for you, but the part about reading a generic section and recognizing
Paste'isms like %(here)s isn't done, so that would be one of the
goals.

We need a standalone HTTP server of some sort to run out of the box.
If not paste.httpserver, what then?

-- 
Mike Orr 

-- 
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.



Re: [Paste] Pyramid on Python 3.2

2011-09-25 Thread Michael Merickel
Pyramid is only actually dependent on PasteScript for the paster command and
scaffolds, so whether Paste gets ported or not isn't a big deal. The paster
command is used to generate scaffolds, start servers and the convenient
ability to "paster request" simulate a request into a conforming WSGI app.

If we are interested in porting PasteScript it's definitely an undertaking
because there is a large amount of code unused by a basic Pyramid
application. It'd probably be worth taking the opportunity to look into some
fairly large bw-incompat changes to PasteScript to knock its capabilities
into something more manageable. For example, it currently uses Cheetah to do
templates which is not py3k compatible whereas Jinja2 is compat and more
actively developed/supported.

PasteDeploy has been ported, so hopefully INI file syntax can remain
relatively unchanged minus the fact that it may be unlikely paste.httpserver
is ported.

-- 

Michael

-- 
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.



Re: using route_path to generate without slash prefix

2011-09-25 Thread Chris McDonough
On Sun, 2011-09-25 at 15:42 -0500, Matt Feifarek wrote:
> I want to use pyramid's request.route_path() to make links that are
> relative... ie, that do not start with "/".
> 
> 
> My route is declared thus:
> 
> 
> config.add_route('render_page', '/{page}.html')
> 
> 
> My view:
> 
> 
> @view_config(route_name='render_page')
> def render_template(request):
> page = request.matchdict.get('page', 'welcome')
> return render_to_response('opile:templates/%s.html.mako' %
> page, request=request)
> 
> 
> running: 
> request.route_path('render_page', page='examples')
> 
> gives me "/examples.html" but I want "examples.html".
> 
> 
> Likewise, for paths that are one layer down, I want links that start
> with "../" rather than "/". Does Pyramid support this configuration? I
> can't find anything in the docs.
> 
> 
> (Why would I want to do this? I'm using Pyramid to generate what will
> become a static-html "site" that can be opened on a filesystem, so
> there is no "/". I can always intercept and modify the output, but I'd
> prefer to do it "right".)

Pyramid does not support this, no.

- C




> 
> 
> 
> 
> 
> -- 
> 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.


-- 
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.



using route_path to generate without slash prefix

2011-09-25 Thread Matt Feifarek
I want to use pyramid's request.route_path() to make links that are
relative... ie, that do not start with "/".

My route is declared thus:

config.add_route('render_page', '/{page}.html')


My view:

@view_config(route_name='render_page')
def render_template(request):
page = request.matchdict.get('page', 'welcome')
return render_to_response('opile:templates/%s.html.mako' %
page, request=request)


running:

request.route_path('render_page', page='examples')


gives me "/examples.html" but I want "examples.html".

Likewise, for paths that are one layer down, I want links that start with
"../" rather than "/". Does Pyramid support this configuration? I can't find
anything in the docs.

(Why would I want to do this? I'm using Pyramid to generate what will become
a static-html "site" that can be opened on a filesystem, so there is no "/".
I can always intercept and modify the output, but I'd prefer to do it
"right".)

-- 
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.



Re: [Paste] Pyramid on Python 3.2

2011-09-25 Thread Mike Orr
On Sun, Sep 25, 2011 at 3:15 AM, Atsushi Odagiri  wrote:
> Hi
> Congraturation for first step to py3k.
> I wanna help that works, and I have some question.
> PasteDeploy have ported to py3k, but Paste is not ported.
> Will Pyramid2.x use pastescript or replace to wiseguy?
> Can wiseguy completely replace pastescript?
> PasteScript depends on setuptools/distribute to detect plugins, and
> PasteDeploy depends too.
> That will replace to packaging/distutils2 that doesn't have the feature of
> entry_points.
> May I help to make PasteScript py3 ready?

We have discussed replacing PasteScript/PasteDeploy with something
else but nothing has been decided, and so far we haven't found any
reason to prefer one alternative over the others. Here's what we
discussed earlier:
https://github.com/Pylons/pyramid/wiki/Pyramid-2-brainstorm

If you mean this Wiseguy
http://code.google.com/p/msolo/wiki/wiseguy
it looks like it doesn't replace PasteScript. PasteScript is a general
command-line front end to "paster serve", "paster create", and other
utilities. Wiseguy according to its webpage is a FastCGI adapter for
WSGI applications. While we can document it as an alternative,
Pyramid's default server needs to be something that runs standalone
without a separate webserver.

You can work on PasteScript/PasteDeploy/Paste or an alternative,
you'll just need to coordinate with the other people who are working
on those things. And I've lost track of who's doing what.

Who is working on the Paste components or alternatives, and what looks
most promising/'feasable at this point? If you could summarize your
ideas here and on the wiki, it'll make it easier to see if we're any
closer to a decision.

-- 
Mike Orr 

-- 
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.