durusmail: quixote-users: Proposed change to _q_getname() interface
Proposed change to _q_getname() interface
2002-05-23
2002-05-23
2002-05-23
2002-05-23
2002-05-23
2002-05-23
Proposed change to _q_getname() interface
Neil Schemenauer
2002-05-23
It's a major change to the way the publishing loop works (not limited to
_q_getname).  Right now Quixote traverses namespaces and expects to end
up at a callable object.  Your change make it so it can end up with a
callable or a string object.

Actually, that's pretty neat.  You could publish static pages by
embedding them as literal strings.  For example:

    _q_exports = ['mypage']
    mypage = 'Hello world from Quixote'

Your patch looks good except for this bit:

> +def isstring (x):
> +    return type(x) in (types.StringType, types.InstanceType)

What about unicode strings?  What about subclasses of object?  I think
we should just test using 'callable()'.  The object is not callable then
it's treated as the output.  There's no security problem since the name
of the object needs to be in _q_exports.

--
Neil Schemenauer  | MEMS Exchange
Software Engineer                        | http://www.mems-exchange.org/


reply