[albatross-users] Importing page modules
Matt Goodall
matt at pollenation.net
Sat Nov 29 04:21:54 EST 2003
Hi all,
Some time ago I raised an issue with importing page modules and how it
affected sys.modules. It's not been resolved yet although that's not
what this message is about. Someone recently posted to python-list with
a related issue so I thought I'd mention it here too:
Generated code that is exec-ed (to simulate import) cannot import os.path??
http://mail.python.org/pipermail/python-list/2003-November/197043.html
This is one of the problems I came across when inventing an imaginary
package for the page modules to live in. IIRC, I ended up loading page
modules as modules with names like albatross_page_home rather than using
something a bit more obvious like albatross.pages.home.
Anyway, in the end I abandoned the above approach (too magical for me
and I don't like hacking with the Python import mechanism) and went with
execfile() even though that also has issues. The history of that
conversion will be in the archives if anyone is interested.
Cheers, Matt
--
Matt Goodall, Pollenation Internet Ltd
w: http://www.pollenationinternet.com
e: matt at pollenation.net
t: +44 (0)113 2252500
More information about the Albatross-users
mailing list