[Zope] the misc_ dictionary
Erik Enge
erik+list@esol.no
15 Feb 2001 11:59:58 +0100
[azazel@planningsrl.it]
| Ok... i still don't know if there is a policy for the use of misc_ but
| i have resolved my problems
This is how I use it in my __init__.py file in the product directory
(ie. lib/python/Products/ProductX):
__init__.py file:
#####################################################################
__doc__ = 'Initialize the rs product.'
__version__='$Revision: 1.1 $'[11:-2]
from ImageFile import ImageFile
misc_ = {
'Folder_icon.gif': ImageFile('img/Folder_icon.gif', globals()),
'dtmldoc.gif': ImageFile('img/dtmldoc.gif', globals()),
}
import rs
def initialize(context):
"Initialize the product."
try:
context.registerClass(
rs.rs,
constructors = (rs.manage_addrsForm,
rs.manage_addrs)
)
context.registerHelp()
context.registerHelpTitle('Zope/rs 2000 Help')
except:
import sys, traceback, string
type, val, tb = sys.exc_info()
sys.stderr.write(string.join(traceback.format_exception(type, val, tb), ''))
del type, val, tb
#####################################################################
This then allows me to do http://myhost/misc_/rs/Folder_icon.gif
Hope this helps :)