[albatross-users] Re: load_page_module patch

Andrew McNamara andrewm at object-craft.com.au
Fri Sep 26 14:00:19 EST 2003


[added cc to albatross-users]

>You sent something slightly different to that.  The current Albatross
>is just plain wrong in the way that it loads page modules.  It makes a
>structured module space effectively flat.  It also imports the modules
>in a way that interferes with the Python module space.
>
>In the past I was of the opinion that page modules should be organised
>such that they provided a "package" under the specified module_path.
>I mentioned my position to Andrew and he was not really sure that
>making page modules look like a package is a good idea.

My concern is that both proposed solutions are fairly radical - we don't
know all the consequences, and people won't appreciate us breaking their
previously working scripts. I'd suggest we maintain a list of things we
need to fix for the 2.0 release. In the mean time, maybe we can supply an
alternate mixin that implements the proposed behaviour

BTW, my objection to execfile is you lose the pre-compiled python
byte code. I'll have to see if I can come up with a scheme that uses
the normal import machinery, but imports into a synthetic __pages__
namespace or something.

>Matt> Oh yeah, the patch contains some slightly quirky code. That
>Matt> class Page stuff is the beginning of an experiment to simplify
>Matt> the whole page module vs page class thing. I figured that if the
>Matt> page module loader return a class that acted as a proxy to the
>Matt> module then some of the other code could be simplified.
>
>I think that it might be a good way to manage the code from page
>modules.  There is no sensible way for the page to be cached
>otherwise.

Indeed. But it feels like we're just re-inventing modules...

-- 
Andrew McNamara, Senior Developer, Object Craft
http://www.object-craft.com.au/



More information about the Albatross-users mailing list