[Zope-dev] CustomizerFolder and the order of things in general

Stefan H. Holek stefan@epy.co.at
Fri, 1 Dec 2000 19:27:53 +0100 (CET)


I am in the process of developing a product that patches the Folder class
at runtime - the Hotfix way. I append an additional tab to the Folder
class' manage_opions from the __init__.py of my product. While this works
fine for standard Folders and the Folder derived products I've tested,
ZPattern's Folder w/Customizer Support is giving me headaches.

I tracked it down to this code in the CustomizerFolder class:

    # We want to look like a folder, but with extra tabs after 'Contents'

    manage_options_left = Folder.manage_options[:1]
    manage_options_right = Folder.manage_options[1:]

So they manage to whack off the original manage_options before I can patch
them, sigh. ;)

I am not sure about the order of events here. Is there such a thing as
product initialization order? Will code like the above always use the
"hardwired" attributes of a class definition, and never any hotfixed
changes?

How about coding style then. What is considered worse, hotfixing or
refusing to be hotfixed? ;)

Thanks,
Stefan

--
Things work better when plugged in