[albatross-users] page module import magic

Dave Cole djc at object-craft.com.au
Tue Jan 13 12:25:53 EST 2004


On Tue, 2004-01-13 at 01:33, Matt Goodall wrote:
> Andrew McNamara wrote:
> 
> Hierarchies of pages do work but not quite correctly in the released 
> code base, hence my original bug report. The only problem with them is 
> the corruption of sys.modules. Perhaps Albatross was never really meant 
> to be used like this?

The current behaviour is a bug.  I think we all agree it should be
fixed. :-)

> I actually thought your preferred solution was to use *real* application 
> packages and modules (which I guess is why I was a little confused about 
> your "dummy parent modules" comment) but I've reread the thread and 
> found mention of a "synthetic namespace".

My preference is to just use Python packages, but as Andrew points out,
this will probably break some current code.  The fix is probably fairly
easy, just place __init__.py in page module parent directories.

> I would be grateful if you could keep me updated on the solution you 
> choose. I would need to change my code in a number of places to use a 
> '.' in the URL but it's probably not too big a problem and I would 
> rather use an official Albatross release than my patched version. 
> However, nice URLs will be important to me for some future projects.

Is there any reason we couldn't simply url.replace('/', '.')?

> Thanks for the detailed explanation. If I get time I will try your patch 
> to see what happens here. Sadly, I'm not finding much time for anything 
> but payed coding at the moment :(.

I know what you mean.

- Dave

-- 
http://www.object-craft.com.au




More information about the Albatross-users mailing list