durusmail: quixote-users: legal py & uri names don't overlap...
legal py & uri names don't overlap...
2004-04-05
2004-04-05
2004-04-05
2004-04-05
legal py & uri names don't overlap...
Kendall Clark
2004-04-05
Peeps,

I thought this might be a FAQ, but after grepping the archive of this
list, I'm either grepping for the wrong thing or it's an IAQ. Anyway,
I can have perfectly legal URIs which have components that aren't
legal Python variables. The hyphen/dash is the obvious one:

http://monkeyfist.com/rdf-model/foo

which I'd like to map to:

_q_exports = ["rdf-model"] where "rdf-model" is an instance of a
ModelDispatch class. But, clearly, "rdf-model" isn't a legal Python
variable name (alas -- my #1 Python wart!).

What is the general trick to having URI path components with "-" and
other illegal Python variable characters mapped to Python bits in
Quixote? I'd prefer a solution other than doing a dynamic lookup; that
will work in some cases, but not in others (I guess it will *work* in
all cases, but ugh!).

Thanks,
Kendall Clark
--
Sometimes it's appropriate, even patriotic, to be ashamed
of your country. -- James Howard Kunstler


reply