[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/apidoc/utilitymodule/ Fixed utility module to work well with any type of utility name.

Bjorn Tillenius bjorn.tillenius at gmail.com
Sat Oct 29 09:40:17 EDT 2005


On Sat, Oct 29, 2005 at 03:22:21PM +0200, Tarek Ziadé wrote:
> Tarek Ziadé wrote:
> 
> >Bjorn Tillenius wrote:
> >
> >>On Fri, Oct 28, 2005 at 02:33:13PM -0400, Stephan Richter wrote:
> >> 
> >>
> >>>+Bu what are those strange names? Since utility names can be any 
> >>>string, it is
> >>>+hard to deal with them in a URL. Thus the system will advertise and 
> >>>use the
> >>>+names in their `BASE64` encoded form. However, because it is easier 
> >>>in the
> >>>+Python API to use the real utility names, utilities can be looked 
> >>>up in their
> >>>+original form as well.
> >>>  
> >>
> >>
> >>Maybe I've missed some aspect of the problem, but it seems strange that
> >>you chose to use BASE64, thus producing very cryptic URLs, which aren't
> >>readable at all. If the problem is that you want to use the names in
> >>URLs, why not use urllib.quote() whenever you construct a URL?
> >
> fogot a piece in my previous message:
> 
> urlquote is brakable as well:
> 
> >>> urllib.quote(' brake / me ///// please ')
> '%20brake%20/%20me%20/////%20please%20'

Yeah, you have to pass safe='' as well. I still think urlquote produces
nicer URLs than base64.

Regards,

Bjorn


More information about the Zope3-Checkins mailing list