Commit 9b71c09c authored by Amos Latteier's avatar Amos Latteier

Make sure that we don't add the examples to the app if they've already been added and then deleted.

parent f7270f0e
...@@ -84,8 +84,8 @@ ...@@ -84,8 +84,8 @@
############################################################################## ##############################################################################
__doc__='''Application support __doc__='''Application support
$Id: Application.py,v 1.165 2001/11/17 17:51:54 chrism Exp $''' $Id: Application.py,v 1.166 2001/11/19 19:43:30 amos Exp $'''
__version__='$Revision: 1.165 $'[11:-2] __version__='$Revision: 1.166 $'[11:-2]
import Globals,Folder,os,sys,App.Product, App.ProductRegistry, misc_ import Globals,Folder,os,sys,App.Product, App.ProductRegistry, misc_
import time, traceback, os, string, Products import time, traceback, os, string, Products
...@@ -419,7 +419,6 @@ def initialize(app): ...@@ -419,7 +419,6 @@ def initialize(app):
get_transaction().note('Added standard_error_message') get_transaction().note('Added standard_error_message')
get_transaction().commit() get_transaction().commit()
# b/c: Ensure that a temp folder exists # b/c: Ensure that a temp folder exists
if not hasattr(app, 'temp_folder'): if not hasattr(app, 'temp_folder'):
from Products.TemporaryFolder.TemporaryFolder import MountedTemporaryFolder from Products.TemporaryFolder.TemporaryFolder import MountedTemporaryFolder
...@@ -472,12 +471,16 @@ def initialize(app): ...@@ -472,12 +471,16 @@ def initialize(app):
get_transaction().commit() get_transaction().commit()
del sdm del sdm
# b/c: Ensure that there's an Examples folder with examples # b/c: Ensure that there's an Examples folder with examples.
if not hasattr(app, 'Examples'): # However, make sure that if the examples have been added already
# and then deleted that we don't add them again.
if not hasattr(app, 'Examples') and not \
hasattr(app, '_Zope25_examples_have_been_added'):
examples_path = os.path.join(Globals.data_dir, 'Examples.zexp') examples_path = os.path.join(Globals.data_dir, 'Examples.zexp')
if os.path.isfile(os.path.join(examples_path)): if os.path.isfile(os.path.join(examples_path)):
examples=app._p_jar.importFile(examples_path) examples=app._p_jar.importFile(examples_path)
app._setObject('Examples', examples) app._setObject('Examples', examples)
app._Zope25_examples_have_been_added=1
get_transaction().note('Added Examples folder') get_transaction().note('Added Examples folder')
get_transaction().commit() get_transaction().commit()
del examples del examples
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment