durusmail: quixote-users: Illegal Python Names cookbook recipe
Illegal Python Names cookbook recipe
2004-04-05
2004-04-05
2004-04-05
Bug fixes (was: Illegal Python Names cookbook recipe)
2004-04-07
2004-04-07
Bug fixes (was: Illegal Python Names cookbookrecipe)
2004-04-07
Patches for .7a3
2004-04-07
Re: Patches for .7a3
2004-04-08
StaticFile is broken (Quixote-0.7a3, scgi-1.2a2, Apache/1.3.27, FreeBSD 4.7)
2004-04-08
Re: Patches for .7a3
2004-04-21
2004-04-21
2004-04-06
2004-04-06
2004-04-06
2004-04-06
2004-04-06
2004-04-06
2004-04-06
2004-04-07
2004-04-07
2004-04-07
2004-04-07
2004-04-07
2004-04-07
2004-04-07
Re: Illegal Python Names cookbook recipe
2004-04-07
2004-04-07
2004-04-07
2004-04-07
2004-04-07
2004-04-07
2004-04-07
2004-04-07
2004-04-07
2004-04-07
2004-04-07
2004-04-07
2004-04-08
2004-04-07
2004-04-07
2004-04-07
2004-04-06
2004-04-05
2004-04-05
2004-04-05
Re: R: [Quixote-users] Illegal Python Names cookbook recipe
2004-04-06
Illegal Python Names cookbook recipe
Kendall Clark
2004-04-06
On Tue, Apr 06, 2004 at 05:11:49PM -0400, A.M. Kuchling wrote:
> On Tue, Apr 06, 2004 at 04:04:13PM -0400, Kendall Clark wrote:
> > What about URL bits that begin with a numeral? Or contain other
> > characters that aren't legal in Py identifiers?
>
> Can you motivate these use cases by examples?  Offhand I can't think of
> cases where I want to accept '$' or '^' in a URL, or where a fixed set of
> numerals would be used.

Let's say I'm a web publisher of engineering specifications, and I
want to use Quixote. The industry body I'm publishing for often names
documents beginning with the year they were adopted. So, for example,
"2004 SCADA Extensions". Which seems natural to publish as:

     http://foo.bar/2004ScadaExtensions

Let's say I have 15 or 20 such documents. Not enough to go to the
trouble of using a database. But too many to stuff into a big
if-elif-else thing inside of _q_resolve or _q_lookup. That's ugly.

As with my other use case (I want to have URI components handled by Py
callables with "-" in the name), you *can* implement this in Quixote
using _q_lookup or _q_resolve.

> I can imagine using /thing/subthings/1, /2, /3, ...
> but usually there wouldn't be a fixed limit on the integer values, and
> _q_lookup is therefore quite natural.

Not if the structure were:

     http://foo.bar///
/ So: http://foo.bar/2004SCADAExtensions/3/3.2/3.2.5 I.e., there is a fixed limit on the chapters, sections, and subsections headings, but they aren't really integers to lookup in a database. > One use I can imagine is having to exactly replicate some URL layout that > uses special characters, but that probably isn't your situation. So what > are you trying to do? That very well could be my situation! :> What about having to exactly replicate an existing URL structure in Quixote? So, for example, my research group publishes a set of OWL and RDF ontologies which have parts that are illegal Python identifiers. I can't change the URL names because there are existing documents using those URLs as namespace identifiers. But I want to move this site to Quixote. Oops, that's ugly because Quixote requires me to use _q_lookup or _q_resolve to handle many legal URI names; but I really just want to do _q_exports. Of course, the use case game doesn't *really* work for this discussion, since it's not between "being able to do it or not", but between adding *another* way to do it which seems simpler and more fitting. In other words, there is no use case where *the only possible way to accomplish the requirement* is to use the "new" _q_exports format. But surely that's a too restricted criterion? In other words, as much as I admire the design of Quixote, I think this is a design flaw and playing the use case game doesn't seem the best way to talk about that kind of problem. Best, Kendall Clark
reply