[Zope-Checkins] CVS: Zope/lib/python/OFS - Application.py:1.180.18.2
Casey Duncan
casey@zope.com
Wed, 20 Mar 2002 13:41:56 -0500
Update of /cvs-repository/Zope/lib/python/OFS
In directory cvs.zope.org:/tmp/cvs-serv6471
Modified Files:
Tag: casey-death_to_index_html-branch
Application.py
Log Message:
Changed behavior of install_standards so that the standard objs are installed
only *once* (not every restart), and also changed it so that they are not hard
set using setattr, which caused objects (like index_html) to phantom when they
were deleted from the root.
=== Zope/lib/python/OFS/Application.py 1.180.18.1 => 1.180.18.2 ===
def install_standards(app):
+ # Check to see if we've already done this before
+ # Don't do it twice (Casey)
+ if getattr(app, '_standard_objects_have_been_added', 0):
+ return
+
# Install the replaceable standard objects
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
std_dir = os.path.join(Globals.package_home(globals()), 'standard')
@@ -725,9 +730,11 @@
else:
continue
wrote = 1
- ob.__replaceable__ = Globals.REPLACEABLE
- setattr(Application, fn, ob)
+ # Below is icky and sneaky since it makes these impossible to delete
+ #ob.__replaceable__ = Globals.REPLACEABLE
+ #setattr(Application, fn, ob)
if wrote:
+ app._standard_objects_have_been_added = 1
get_transaction().note('Installed standard objects')
get_transaction().commit()