[Zope-Checkins] CVS: Zope/lib/python/OFS - Application.py:1.162

Amos Latteier amos@zope.com
Fri, 16 Nov 2001 19:00:21 -0500


Update of /cvs-repository/Zope/lib/python/OFS
In directory cvs.zope.org:/tmp/cvs-serv21245/lib/python/OFS

Modified Files:
	Application.py 
Log Message:
Added examples to Zope. Finally Zope comes with some simple example applications. The current examples include automatic navigation devices, a guestbook, a file library and a shopping cart. The examples make use of new features including ZPT (including macros) and sessions.

I set things up to automatically create an Examples folder in the root if one doesn't already exist. I don't know if this is the right thing to do or not. Maybe folks should have to add examples from the product add list.

If you would like to contribute example applications just let me know. I'm open to contributions.


=== Zope/lib/python/OFS/Application.py 1.161 => 1.162 ===
         del sdm
 
+    # b/c: Ensure that there's an Examples folder with examples
+    if not hasattr(app, 'Examples'):
+        examples=app._p_jar.importFile(
+            os.path.join(Globals.data_dir, 'Examples.zexp'),
+            clue='Added Examples folder')
+        app._setObject('Examples', examples)
+        del examples
+
     # b/c: Ensure that Owner role exists.
     if hasattr(app, '__ac_roles__') and not ('Owner' in app.__ac_roles__):
         app.__ac_roles__=app.__ac_roles__ + ('Owner',)