> You're using *var with a default value, and the magic *path_info on
> top of that.  All of these could interact in unexpected ways.  It
> would be better to make two or three specific routes for these cases,
> and to use named routes for generation.  That minimizes the ambiguity.
>  So do something like:
>
>     map.connect("home", "/", controller="main", action="index")
>     map.connect("wiki", "/WikiSystem", controller="EmbeddedTrac", 
> path_info="/")
>     map.connect("/WikiSystem/*path_info", controller="EmbeddedTrac")
>
>     h.url_for("home")
>     h.url_for("wiki")
>

Thanks, I've incorporated those changes.  It didn't modify the
original behavior which causes the h.url_for("home") to be /
WikiSystem/ when called from the EmbeddedTrac controller since it's
still pre-pending the SCRIPT_NAME variable contents.  No problem,
though, I'll just stick with modifying the SCRIPT_NAME hack to remove
the path part.

I ran into a few more problems with the urllib.basejoin method, so I
just used direct string manipulation which should work fine in this
case since SCRIPT_NAME shouldn't have any relative paths and should
always use forward slashes.


        # fixup the SCRIPT_NAME path to go up one level
        tempScriptName = environ['SCRIPT_NAME']
        baseUrl = tempScriptName[0:tempScriptName.rfind('/')]
        environ['SCRIPT_NAME'] = baseUrl

        # render the new page
        lstContent = [render("genshi", "TemplateName"), ]

        # restore SCRIPT_NAME
        environ['SCRIPT_NAME'] = tempScriptName



> Routes 2 is slated to have direct delegation to WSGI apps, something like
> map.wsgi("/WikiSystem", EmbeddedTrac).

I'm looking forward to Routes 2 -- it should really add a nice shine
to the whole Pylons framework.

-Eric

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