[Zope-Checkins] SVN: Products.Five/tags/1.5.2-plus-registerPackage-fix/ Tag to map over to zope2 external in between releases.

2007-03-05 Thread Rocky Burt
Log message for revision 72989:
  Tag to map over to zope2 external in between releases.

Changed:
  A   Products.Five/tags/1.5.2-plus-registerPackage-fix/

-=-
Copied: Products.Five/tags/1.5.2-plus-registerPackage-fix (from rev 72988, 
Products.Five/branches/1.5)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/2.10/ No longer opens a zodb connection every time a ProductDispatcher is looked up.

2007-03-05 Thread Rocky Burt
Log message for revision 72990:
  No longer opens a zodb connection every time a ProductDispatcher is looked up.

Changed:
  U   Zope/branches/2.10/doc/CHANGES.txt
  U   Zope/branches/2.10/lib/python/App/FactoryDispatcher.py
  _U  Zope/branches/2.10/lib/python/Products/

-=-
Modified: Zope/branches/2.10/doc/CHANGES.txt
===
--- Zope/branches/2.10/doc/CHANGES.txt  2007-03-05 14:14:15 UTC (rev 72989)
+++ Zope/branches/2.10/doc/CHANGES.txt  2007-03-05 14:20:58 UTC (rev 72990)
@@ -8,6 +8,9 @@
 
 Bugs fixed
 
+  - No longer opens a zodb connection every time a ProductDispatcher
+is looked up.
+
   - Collector #2288: @ and + should not be quoted when forming
 request URLs in BaseRequest and HTTPRequest
 

Modified: Zope/branches/2.10/lib/python/App/FactoryDispatcher.py
===
--- Zope/branches/2.10/lib/python/App/FactoryDispatcher.py  2007-03-05 
14:14:15 UTC (rev 72989)
+++ Zope/branches/2.10/lib/python/App/FactoryDispatcher.py  2007-03-05 
14:20:58 UTC (rev 72990)
@@ -26,32 +26,15 @@
 zope2 packages and those without the Products namespace package.
 
 
-old_product_packages = {}
+packages = {}
 for x in dir(Products):
 m = getattr(Products, x)
 if isinstance(m, types.ModuleType):
-old_product_packages[x] = m
+packages[x] = m
+
+for m in getattr(Products, '_registered_packages', []):
+packages[m.__name__] = m
 
-packages = {}
-app = Zope2.app()
-try:
-products = app.Control_Panel.Products
-
-for product_id in products.objectIds():
-product = products[product_id]
-if hasattr(product, 'package_name'):
-pos = product.package_name.rfind('.')
-if pos  -1:
-packages[product_id] = __import__(product.package_name, 
-  globals(), {}, 
-  
product.package_name[pos+1:])
-else:
-packages[product_id] = __import__(product.package_name)
-elif old_product_packages.has_key(product_id):
-packages[product_id] = old_product_packages[product_id]
-finally:
-app._p_jar.close()
-
 return packages
 
 class ProductDispatcher(Acquisition.Implicit):


Property changes on: Zope/branches/2.10/lib/python/Products
___
Name: svn:externals
   - Fivesvn://svn.zope.org/repos/main/Products.Five/tags/1.5.2

   + Five
svn://svn.zope.org/repos/main/Products.Five/tags/1.5.2-plus-registerPackage-fix


___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/trunk/ No longer opens a zodb connection every time a ProductDispatcher is looked up, forward ported from zope 2.10 branch r72990 and five 1.5 branch r72986.

2007-03-05 Thread Rocky Burt
Log message for revision 72991:
  No longer opens a zodb connection every time a ProductDispatcher is looked 
up, forward ported from zope 2.10 branch r72990 and five 1.5 branch r72986.

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  U   Zope/trunk/lib/python/App/FactoryDispatcher.py
  U   Zope/trunk/lib/python/Products/Five/fiveconfigure.py
  U   Zope/trunk/lib/python/Products/Five/tests/test_registerpackage.py

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===
--- Zope/trunk/doc/CHANGES.txt  2007-03-05 14:20:58 UTC (rev 72990)
+++ Zope/trunk/doc/CHANGES.txt  2007-03-05 14:43:23 UTC (rev 72991)
@@ -82,6 +82,9 @@
 
 Bugs Fixed
 
+  - No longer opens a zodb connection every time a ProductDispatcher
+is looked up.
+
   - PageTemplate/ZRPythonExpr.py: expressions represented as unicode string
 caused UnicodeDecodeErrors. 
 

Modified: Zope/trunk/lib/python/App/FactoryDispatcher.py
===
--- Zope/trunk/lib/python/App/FactoryDispatcher.py  2007-03-05 14:20:58 UTC 
(rev 72990)
+++ Zope/trunk/lib/python/App/FactoryDispatcher.py  2007-03-05 14:43:23 UTC 
(rev 72991)
@@ -26,32 +26,15 @@
 zope2 packages and those without the Products namespace package.
 
 
-old_product_packages = {}
+packages = {}
 for x in dir(Products):
 m = getattr(Products, x)
 if isinstance(m, types.ModuleType):
-old_product_packages[x] = m
+packages[x] = m
+
+for m in getattr(Products, '_registered_packages', []):
+packages[m.__name__] = m
 
-packages = {}
-app = Zope2.app()
-try:
-products = app.Control_Panel.Products
-
-for product_id in products.objectIds():
-product = products[product_id]
-if hasattr(product, 'package_name'):
-pos = product.package_name.rfind('.')
-if pos  -1:
-packages[product_id] = __import__(product.package_name, 
-  globals(), {}, 
-  
product.package_name[pos+1:])
-else:
-packages[product_id] = __import__(product.package_name)
-elif old_product_packages.has_key(product_id):
-packages[product_id] = old_product_packages[product_id]
-finally:
-app._p_jar.close()
-
 return packages
 
 class ProductDispatcher(Acquisition.Implicit):

Modified: Zope/trunk/lib/python/Products/Five/fiveconfigure.py
===
--- Zope/trunk/lib/python/Products/Five/fiveconfigure.py2007-03-05 
14:20:58 UTC (rev 72990)
+++ Zope/trunk/lib/python/Products/Five/fiveconfigure.py2007-03-05 
14:43:23 UTC (rev 72991)
@@ -218,6 +218,11 @@
 if init_func is not None:
 newContext = ProductContext(product, app, module_)
 init_func(newContext)
+
+registered_packages = getattr(Products, '_registered_packages', None)
+if registered_packages is None:
+registered_packages = Products._registered_packages = []
+registered_packages.append(module_)
 finally:
 try:
 import transaction

Modified: Zope/trunk/lib/python/Products/Five/tests/test_registerpackage.py
===
--- Zope/trunk/lib/python/Products/Five/tests/test_registerpackage.py   
2007-03-05 14:20:58 UTC (rev 72990)
+++ Zope/trunk/lib/python/Products/Five/tests/test_registerpackage.py   
2007-03-05 14:43:23 UTC (rev 72991)
@@ -65,7 +65,11 @@
'pythonproduct2' in product_listing
   True
 
+Make sure it also shows up in ``Products._registered_packages``.
 
+   [x.__name__ for x in getattr(Products, '_registered_packages', [])]
+  ['pythonproduct2']
+
 Clean up:
 
tearDown()

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-dev] Re: Interest in AdvancedQuery and/or ManagableIndex?

2007-02-05 Thread Rocky Burt
On Mon, 2007-05-02 at 12:26 +0100, Philipp von Weitershausen wrote:
 On 5 Feb 2007, at 12:22 , Martijn Faassen wrote:
  Another is of course who is doing the hosting. Currently we're using
  ZC's infrastructure for SVN. We need to shift it away from ZC's
  infrastructure at some point to make it easier to give other people
  access. ZC can say more about this, however.
 
 I'm sure we'd find somebody willing to host at least the subversion  
 repository. We just need to get to a point where we can say: Hey, the  
 ZF now owns Zope, who wants to host it?

I would highly recommend we move to some sort of neutral OSS service
that hosts projects like this (ie sf.net).  I know plone is evaluating
using some of the services at code.google.com (but I don't believe SVN
is one of them although I could be mistaken).

So perhaps something like svn @ code.google.com would be a route to go?

- Rocky

-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
News About The Server (blog) -- http://www.serverzen.net


signature.asc
Description: This is a digitally signed message part
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: RFC: Eggifying Zope's extension mechanism (Products)

2007-01-25 Thread Rocky Burt
On Thu, 2007-25-01 at 05:07 -0800, Martin Aspeli wrote:
 I do wonder what would happen if you had both lib/python/Products/CMFCore
 and Products/CMFCore, though. Would there be an explicit preference or would
 Zope fail to start up with a conflict? I think I'd prefer the latter, in
 fact, so that people don't end up modifying/upgrading the wrong code by
 accident!

Well, we could probably add conflict-detection to the entry point
handlers for Zope (ie so any two packages that try to register as the
same project would cause an error).  But regarding Products/CMFCore and
lib/python/Products/CMFCore conflicting... that would be up to the
standard pythonpath mechanism of the python interpreter (whichever is
first on the path wins).

- Rocky

-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
News About The Server (blog) -- http://www.serverzen.net


signature.asc
Description: This is a digitally signed message part
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-Checkins] SVN: Products.Five/branches/1.3/ Backported 'browser: processInputs now decodes strings in lists and tuples' fix from 1.4 (r70913) branch.

2006-11-04 Thread Rocky Burt
Log message for revision 71059:
  Backported 'browser: processInputs now decodes strings in lists and tuples' 
fix from 1.4 (r70913) branch.

Changed:
  U   Products.Five/branches/1.3/CHANGES.txt
  A   Products.Five/branches/1.3/browser/tests/test_decode.py
  U   Products.Five/branches/1.3/form/__init__.py

-=-
Modified: Products.Five/branches/1.3/CHANGES.txt
===
--- Products.Five/branches/1.3/CHANGES.txt  2006-11-04 13:35:51 UTC (rev 
71058)
+++ Products.Five/branches/1.3/CHANGES.txt  2006-11-04 18:54:04 UTC (rev 
71059)
@@ -8,6 +8,8 @@
 Bugfixes
 
 
+* browser: processInputs now decodes strings in lists and tuples.
+
 * Port code from Zope 3 making resource directories recursive.
   Thanks to Richard Waid.
 

Added: Products.Five/branches/1.3/browser/tests/test_decode.py
===
--- Products.Five/branches/1.3/browser/tests/test_decode.py 2006-11-04 
13:35:51 UTC (rev 71058)
+++ Products.Five/branches/1.3/browser/tests/test_decode.py 2006-11-04 
18:54:04 UTC (rev 71059)
@@ -0,0 +1,75 @@
+##
+#
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED AS IS AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##
+Unit tests for decode module.
+
+$Id: test_decode.py 70913 2006-10-25 19:20:28Z yuppie $
+
+import os, sys
+if __name__ == '__main__':
+execfile(os.path.join(sys.path[0], 'framework.py'))
+
+def test_processInputs():
+
+Testing processInputs
+
+   from zope import interface
+   from zope.i18n.interfaces import IUserPreferredCharsets
+   from Products.Five.form import EditView
+   class DummyResponse:
+  ... headers = {}
+  ... def setHeader(self, n, v):
+  ... self.headers[n] = v
+   class DummyRequest:
+  ... interface.implements(IUserPreferredCharsets)
+  ... form = {}
+  ... def getPreferredCharsets(self):
+  ... return ['iso-8859-1']
+  ... RESPONSE = DummyResponse()
+   class DummyEditView(EditView):
+  ... def __init__(self, context, request):
+  ... self.context = context
+  ... self.request = request
+   request = DummyRequest()
+
+Strings are converted to unicode::
+
+   request.form['foo'] = u'f\xf6\xf6'.encode('iso-8859-1')
+   editview = DummyEditView(None, request)
+   editview._processInputs()
+   request.form['foo'] == u'f\xf6\xf6'
+  True
+
+Strings in lists are converted to unicode::
+
+   request.form['foo'] = [u'f\xf6\xf6'.encode('iso-8859-1')]
+   editview = DummyEditView(None, request)
+   editview._processInputs()
+   request.form['foo'] == [u'f\xf6\xf6']
+  True
+
+Strings in tuples are converted to unicode::
+
+   request.form['foo'] = (u'f\xf6\xf6'.encode('iso-8859-1'),)
+   editview = DummyEditView(None, request)
+   editview._processInputs()
+   request.form['foo'] == (u'f\xf6\xf6',)
+  True
+
+
+def test_suite():
+from zope.testing.doctest import DocTestSuite
+return DocTestSuite()
+
+if __name__ == '__main__':
+framework()

Modified: Products.Five/branches/1.3/form/__init__.py
===
--- Products.Five/branches/1.3/form/__init__.py 2006-11-04 13:35:51 UTC (rev 
71058)
+++ Products.Five/branches/1.3/form/__init__.py 2006-11-04 18:54:04 UTC (rev 
71059)
@@ -88,9 +88,17 @@
 def _processInputs(self):
 request = self.request
 for name, value in request.form.items():
-if (not (isCGI_NAME(name) or name.startswith('HTTP_'))
-and isinstance(value, str)):
-request.form[name] = self._decode(value)
+if not (isCGI_NAME(name) or name.startswith('HTTP_')):
+if isinstance(value, str):
+request.form[name] = self._decode(value)
+elif isinstance(value, list):
+request.form[name] = [ self._decode(val)
+   for val in value
+   if isinstance(val, str) ]
+elif isinstance(value, tuple):
+request.form[name] = tuple([ self._decode(val)
+ for val in value
+ if isinstance(val, str) ])
 
 def 

[Zope-Checkins] SVN: Products.Five/branches/1.3/ Updating changes/version info to reflect new 1.3.8 release.

2006-11-04 Thread Rocky Burt
Log message for revision 71060:
  Updating changes/version info to reflect new 1.3.8 release.

Changed:
  U   Products.Five/branches/1.3/CHANGES.txt
  U   Products.Five/branches/1.3/version.txt

-=-
Modified: Products.Five/branches/1.3/CHANGES.txt
===
--- Products.Five/branches/1.3/CHANGES.txt  2006-11-04 18:54:04 UTC (rev 
71059)
+++ Products.Five/branches/1.3/CHANGES.txt  2006-11-04 19:10:02 UTC (rev 
71060)
@@ -2,7 +2,7 @@
 Five Changes
 
 
-Five 1.3.8 (unreleased)
+Five 1.3.8 (2006-11-04)
 ===
 
 Bugfixes

Modified: Products.Five/branches/1.3/version.txt
===
--- Products.Five/branches/1.3/version.txt  2006-11-04 18:54:04 UTC (rev 
71059)
+++ Products.Five/branches/1.3/version.txt  2006-11-04 19:10:02 UTC (rev 
71060)
@@ -1 +1 @@
-Five 1.3.7
+Five 1.3.8

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Products.Five/branches/1.4/INSTALL.txt Updated INSTALL.txt to reflect the dependency on Zope 2.9.5 and higher for the 1.4.2 release.

2006-11-04 Thread Rocky Burt
Log message for revision 71064:
  Updated INSTALL.txt to reflect the dependency on Zope 2.9.5 and higher for 
the 1.4.2 release.

Changed:
  U   Products.Five/branches/1.4/INSTALL.txt

-=-
Modified: Products.Five/branches/1.4/INSTALL.txt
===
--- Products.Five/branches/1.4/INSTALL.txt  2006-11-04 19:38:49 UTC (rev 
71063)
+++ Products.Five/branches/1.4/INSTALL.txt  2006-11-04 19:41:48 UTC (rev 
71064)
@@ -4,7 +4,7 @@
 Requirements for Five 1.4
 -
 
-* Zope 2.9.2+ with Python 2.4.1+
+* Zope 2.9.5+ with Python 2.4.1+
 
 Note that Five 1.3 is part of Zope 2.9.  You can still install a newer
 Five version (e.g. Five 1.4) in your instance, if you like.  It will

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Products.Five/branches/1.4/CHANGES.txt Added information about the change which made zope 2.9.5 required for Five 1.4

2006-11-04 Thread Rocky Burt
Log message for revision 71065:
  Added information about the change which made zope 2.9.5 required for Five 1.4

Changed:
  U   Products.Five/branches/1.4/CHANGES.txt

-=-
Modified: Products.Five/branches/1.4/CHANGES.txt
===
--- Products.Five/branches/1.4/CHANGES.txt  2006-11-04 19:41:48 UTC (rev 
71064)
+++ Products.Five/branches/1.4/CHANGES.txt  2006-11-04 19:44:21 UTC (rev 
71065)
@@ -13,6 +13,8 @@
 * formlib: Removed redundant subpageform.pt and backported pageform.pt fixes
   from Zope 3. Added missing error view and i18n configuration.
 
+  This change requires Zope 2.9.5 or higher.
+
 * Made the __call__ method of ViewMixinForAttributes have the same signature
   as the original attribute.  This aids some pathological request parameter
   marshalling.

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Products.Five/tags/1.4.2/ Tagged Five 1.4.2 release.

2006-11-04 Thread Rocky Burt
Log message for revision 71066:
  Tagged Five 1.4.2 release.

Changed:
  A   Products.Five/tags/1.4.2/

-=-
Copied: Products.Five/tags/1.4.2 (from rev 71065, Products.Five/branches/1.4)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Products.Five/branches/1.5/ Updating changes/version info to reflect new 1.5.1 release.

2006-11-04 Thread Rocky Burt
Log message for revision 71068:
  Updating changes/version info to reflect new 1.5.1 release.

Changed:
  U   Products.Five/branches/1.5/CHANGES.txt
  U   Products.Five/branches/1.5/version.txt

-=-
Modified: Products.Five/branches/1.5/CHANGES.txt
===
--- Products.Five/branches/1.5/CHANGES.txt  2006-11-04 19:50:58 UTC (rev 
71067)
+++ Products.Five/branches/1.5/CHANGES.txt  2006-11-04 20:04:47 UTC (rev 
71068)
@@ -2,7 +2,7 @@
 Five Changes
 
 
-Five 1.5.1 (unreleased)
+Five 1.5.1 (2006-11-04)
 ===
 
 * site: Fixed small bug in FiveSiteManager. (issue #2198)
@@ -111,6 +111,8 @@
 * formlib: Removed redundant subpageform.pt and backported pageform.pt fixes
   from Zope 3. Added missing error view and i18n configuration.
 
+  This change requires Zope 2.9.5 or higher.
+
 * Made the __call__ method of ViewMixinForAttributes have the same signature
   as the original attribute.  This aids some pathological request parameter
   marshalling.

Modified: Products.Five/branches/1.5/version.txt
===
--- Products.Five/branches/1.5/version.txt  2006-11-04 19:50:58 UTC (rev 
71067)
+++ Products.Five/branches/1.5/version.txt  2006-11-04 20:04:47 UTC (rev 
71068)
@@ -1 +1 @@
-Five 1.5
+Five 1.5.1

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Products.Five/tags/1.5.1/ Tagged Five 1.5.1 release.

2006-11-04 Thread Rocky Burt
Log message for revision 71069:
  Tagged Five 1.5.1 release.

Changed:
  A   Products.Five/tags/1.5.1/

-=-
Copied: Products.Five/tags/1.5.1 (from rev 71068, Products.Five/branches/1.5)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Products.Five/trunk/CHANGES.txt Sync'ed trunk's (1.6) CHANGES.txt with latest release info from 1.5, 1.4, and 1.3

2006-11-04 Thread Rocky Burt
Log message for revision 71070:
  Sync'ed trunk's (1.6) CHANGES.txt with latest release info from 1.5, 1.4, and 
1.3

Changed:
  U   Products.Five/trunk/CHANGES.txt

-=-
Modified: Products.Five/trunk/CHANGES.txt
===
--- Products.Five/trunk/CHANGES.txt 2006-11-04 20:05:12 UTC (rev 71069)
+++ Products.Five/trunk/CHANGES.txt 2006-11-04 20:09:53 UTC (rev 71070)
@@ -11,9 +11,11 @@
 * Port code from Zope 3 making resource directories recursive.
   Thanks to Richard Waid.
 
-Five 1.5.1 (unreleased)
+Five 1.5.1 (2006-11-04)
 ===
 
+* site: Fixed small bug in FiveSiteManager. (issue #2198)
+
 * browser: processInputs now decodes strings in lists and tuples.
 
 * formlib: Removed redundant subpageform.pt and pageform.pt. Added missing
@@ -107,8 +109,8 @@
   deprecated, as the functionality exists in the Zope core publisher
   from Zope 2.10 and up.
 
-Five 1.4.x
-==
+Five 1.4.2 (2006-11-04)
+===
 
 Bugfixes
 
@@ -118,6 +120,8 @@
 * formlib: Removed redundant subpageform.pt and backported pageform.pt fixes
   from Zope 3. Added missing error view and i18n configuration.
 
+  This change requires Zope 2.9.5 or higher.
+
 * Made the __call__ method of ViewMixinForAttributes have the same signature
   as the original attribute.  This aids some pathological request parameter
   marshalling.
@@ -221,12 +225,14 @@
   NOTE: Anyone who copied the Five site.zcml to their
   $INSTANCE_HOME/etc/ directory is going to need to update it.
 
-Five 1.3.8 (unreleased)
+Five 1.3.8 (2006-11-04)
 ===
 
 Bugfixes
 
 
+* browser: processInputs now decodes strings in lists and tuples.
+
 * Port code from Zope 3 making resource directories recursive.
   Thanks to Richard Waid.
 

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-dev] Re: RFC: The future of Products.Five

2006-10-29 Thread Rocky Burt
On Mon, 2006-30-10 at 00:01 +0100, Philipp von Weitershausen wrote:
 Proposal
 
 
 So, what I'm proposing is to feature-freeze the Products.Five package 
 and just basically keep making it work for future Zope versions. Five 
 1.6 (current trunk) will work for Zope 2.11 (current trunk), Five 1.7 
 for 2.12, etc. So, essentially there won't be Five feature releases in 
 between anymore, which means we can put Products.Five into the 
 Zope/lib/python/Products proper.

+1


 New stuff will be added in standard Python packages that may or may not 
 ship with Zope 2, Plone or whoever needs them. I personally almost don't 
 care, it's really only about defining the right egg dependencies in 
 Plone 3.0 or Zope 2.11, I would assume (see also 'Risks' below). This 
 seems like the release manager's job who would include stuff based on 
 requests from the community and package maintainer's recommendations.

+0  We're really not sure what the story here is yet... trying to sort
things out.


 The namespace for these packages should probably be 'five', as we 
 already have five.intid and five.customerize and we are, after all, the 
 Five project.

+1


 Advantages
 --
 
 * We'll be able to use stuff we get for Python packages for free, such 
 as installation via eggs, Cheeseshop presence and much less majyck for 
 initialization.

terrific.


 * Stuff that we create as part of the Five project does not necessarily 
 have to end up in Zope 2. Currently, stuff added to Products.Five 
 eventually always ends up in some Zope 2 release which means we'll have 
 to maintain it forever, no matter how crappy it turns out to be (e.g. 
 Products.Five.site).

great.


 * Development of certain components can move much faster than even Five. 
 New things like five.intid or five.customerize can be experimented with 
 and already be in the right place if they turn out to be stable. If not, 
 they won't harm Products.Five, either. Individual packages rather than 
 one big one also reduces the amount of work that has to be done by the 
 Five release manager (IOW my work ;)).

great.


 Risks
 -
 
 * If five.* packages need ZCML config (and I know some will), they will 
 either have to be included the Zope 3 way (site.zcml or package-includes 
 slug in your instance's 'etc' directory), or we need to come up with an 
 approach that Zope 2 people are more comfortable with. I think an egg 
 entry point would be a compelling solution. There are plans to do this 
 in Zope 3 even so that you can provide configuration from Python instead 
 of ZCML. I expect this to land in Zope 3.4 which means we should be able 
 to take advantage of it in 2.11.

Interesting, but definitely needs more thought.


 * It is unclear to me at this point what Zope 2's egg story will be. I 
 *hope* that 2.11 will get the same egg story as the Zope 3.4 that ships 
 with it does, though noone has talked about eggifying Zope 2 yet. We 
 should probably do that.

Indeed.  Zope's eggification story needs to be straightened out.  We see
some of this with Jim's proposals for Zope 3.  I'm inclined to watch the
discussion for Zope 3 and hopefully see a good solution unfold (of
course I won't be afraid to share my opinion).  My suspicion is that
Zope 2's eggification story will be very similar (best case scenario:
identical) to Zope 3's eggification story.  So this is one place where I
say let Zope 3 work it out first :)


 Comments welcome :)

Well... constructive comments at least...

:)


Regards,
Rocky

-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
News About The Server (blog) -- http://www.serverzen.net


signature.asc
Description: This is a digitally signed message part
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: Re: Future of ZClasses

2006-10-04 Thread Rocky Burt
On Wed, 2006-04-10 at 10:26 +0200, Patrick Gerken wrote:
 Notice especially how they mention that a deprecation phase can be days.
 So for me it looks we are actually a bit ahead of the competition, but
 maybe somebody can correct me.

[snip...]

 I think we use Interfaces in Z3 to publish Methods. So maybe it
 makes sense to have a smaller core API with longer deprecation
 periods, so that standard projects can try to rely on core API with
 long deprecation phase and extender would use the one year deprecation
 phase. But as I said earlier, I think we are quite ahead already.

[snip...]

 But it is not fair to compare the stability of a programming language
 standard modules API with a application framework api. But maybe I am
 not good in searching and somebody points me to the well thought out
 JBoss or Websphere deprecation policy


Thanks for this insight.  As a proponent of sensible deprecation it's
nice to have some evidence rather than simply sputtering, but but... we
gotta be able to change stuff!

:)

- Rocky

-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
News About The Server (blog) -- http://www.serverzen.net


signature.asc
Description: This is a digitally signed message part
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: In Defense of ZClasses

2006-09-28 Thread Rocky Burt
On Thu, 2006-28-09 at 14:13 +0200, Philipp von Weitershausen wrote:
 The problem is the lack of an exit strategy. If you only need a simpel 
 web app, fine. If you're creating a prototype, ZClasses are hard to get 
 out of without rewriting a whole lot of code.

In the words of The Pragmatic Programmer ... ZClasses can be used to
build fine prototypes but cannot be used to create `tracer bullets`_.
Python developers by nature tend to be pragmatic programmers, so of
course we would rather use a tracer bullet over a prototype.

_`tracer bullets`: http://www.artima.com/intv/tracerP.html

- Rocky

-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
News About The Server (blog) -- http://www.serverzen.net


signature.asc
Description: This is a digitally signed message part
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: Serving large files

2006-09-18 Thread Rocky Burt
On Sun, 2006-17-09 at 16:09 -0300, Sidnei da Silva wrote:
 b) If you dump the data to a temp file and return that as a file
iterator, it can potentially take twice the time.

Potentially, yes... but from a practical standpoint I believe this will
never happen.  Writing to a tempfile over any sort of local storage
(even a local network) will be *much* faster than downloading the file
itself.  If this is indeed a problem perhaps it's a deployment issue
where you should ensure the temp dir is on a fast local volume to make
sure this never happens.

As it stands right now this seems to be the only sensible approach to
returning a large file.

- Rocky

-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
News About The Server (blog) -- http://www.serverzen.net


signature.asc
Description: This is a digitally signed message part
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope] Re: Re: request.locale - do we have this in 2.9.4?

2006-09-06 Thread Rocky Burt
On Wed, 2006-06-09 at 13:52 +0200, Philipp von Weitershausen wrote:
 That said, *if* we choose to go with such a configuration option, I 
 think it woudl probably be a good idea to have it disabled by default in 
 the first release and enabled in subsequent releases. That way 
 applications could opt in for the new behaviour earlier than necessary 
 (much like Python's __future__ imports).

My 2 cents here.  I've also spent a great deal of time pondering this
particular problem.  And there has been some good discussion in this
thread.  Personally what I'm leaning towards liking the most would be an
approach that blends the configuration and adapter ideas discussed here.

Five version X would introduce an IBrowserRequest adapter for a zope 2
request and a new zcml directive, say five:zope3request, that would
toggle whether or not Five should pass through the adapted request
instead of the raw request.  By default it would not adapt (for BBB
compat).  We could consider issuing a deprecation message saying the
default will be changed with future Five release.  And with Five version
X+1 or X+2 we change the default to adapt.

I'd propose version X would be 1.5 and the release that sets the default
to zope3 requests be version 1.6.

We could always keep around the five:zope3request directive even after
we change the default so that people who really need old-style behaviour
(raw zopee 2 requests) can still re-activate it.

- Rocky

-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
News About The Server (blog) -- http://www.serverzen.net



signature.asc
Description: This is a digitally signed message part
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope-dev] Re: I am starting to hate Zope/Plone development and its bl**dy lack of refresh.

2006-09-04 Thread Rocky Burt
On Mon, 2006-04-09 at 12:55 +0200, Max M wrote:
 Does anybody have a clue as to where the problem is? And why aren't 
 there any more people complaining about it? Is it because I develop on 
 Windows and am the only one doing so?
 
 
 What do I have to do to get the sweet sweet refresh working again?

This isn't really a Plone issue, but since it affects so many Plone
developers I'll give my 2 cents.

I will begin by saying refresh has never been totally reliable for me...
even in Zope 2.7.  Often times I would refresh and get frustrated by the
fact that my code wasn't reloaded and end up restarting anyhow.

But the true killer right now is the Zope 3 CA.  Basically, if you use
zope 3 components, they cannot be refreshed currently.  Plone 2.5 uses a
ton of Zope 3 views.  Now this doesn't excuse why the code *you* write
(if it's not using Zope 3 CA) isn't able to be refreshed.  For that, I
have no answer.

So, I've learned to change my habits.  I'm sure you've heard this a
million times, but there's good reason... it just works.  And that is to
write unit tests to build your functionality rather than loading it up
in Zope.  This cuts down on restart times *bigtime*.  This is not
specific to core plone developers.  Everyone who writes python code
should be writing unit tests.  My first test of the quality of a
third-party plone product is to inspect it's test coverage.

Anyhow, hope that helps.

Regards,
Rocky


-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
News About The Server (blog) -- http://www.serverzen.net



signature.asc
Description: This is a digitally signed message part
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: Re: I am starting to hate Zope/Plone development and its bl**dy lack of refresh.

2006-09-04 Thread Rocky Burt
On Mon, 2006-04-09 at 14:25 +0200, Andreas Jung wrote:
 
 --On 4. September 2006 09:43:07 -0230 Rocky Burt [EMAIL PROTECTED] 
 wrote:
 
  So, I've learned to change my habits.  I'm sure you've heard this a
  million times, but there's good reason... it just works.  And that is to
  write unit tests to build your functionality rather than loading it up
  in Zope.
 
 There is not much difference. Restarting a Plone instance with a bag full
 of bricks is nearly the same as running Plone unittests with the same 
 amount of bricks on your back.

Unit tests don't need to load in Plone.  More times than not they don't
even need to load up ZTC.  It's the integration tests that end up
loading ZTC and PTC.  I write those last :)

- Rocky


-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
News About The Server (blog) -- http://www.serverzen.net



signature.asc
Description: This is a digitally signed message part
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope] Re: accelerating Zope restart

2006-08-31 Thread Rocky Burt
On Thu, 2006-31-08 at 12:52 +0100,
[EMAIL PROTECTED] wrote:
  
  Zope does maintain a Data.fs.index file. If it becomes corrupt e.g. through 
  an unclean shutdown then Zope will recreate it by scanning the whole 
  Data.fs file when starting Zope the next time. This will take some 
  timeso before rebooting you should shutdown down your Zope properly.
  
 
 OK, I have two questions about shutting down zope:
 
 - To cleanly shut down zope daemon, is zopectl stop enough ?

Yes.


 - If zope runs in the foreground, how to shut it down cleanly ? CTRL+C won't 
 do
 it I guess ?

I always thought CTRL+C would do it actually.  It's only a force kill
with -9 that will kill it without shutting down properly.  But you could
always go to the Control_Panel in the zmi and do a shutdown from there,
that is for certain safe.

- Rocky

-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
News About The Server (blog) -- http://www.serverzen.net



signature.asc
Description: This is a digitally signed message part
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Re: accelerating Zope restart

2006-08-31 Thread Rocky Burt
On Thu, 2006-31-08 at 12:18 +0100,
[EMAIL PROTECTED] wrote:
 Hi,
 
 My Data.fs is huge (21GB) because it contains many video files. This is not a
 problem in itself, however, I recently had to reboot my machine and now zope
 takes around 20-30 minutes to restart. Is a fstest automatically done ? How
 could I accelerate the restarting, if possible ? 

I highly recommend you use some sort of external storage product to
store such large files.  Perhaps Chris McDonough's blob product might
fit well here.

- Rocky

-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
News About The Server (blog) -- http://www.serverzen.net



signature.asc
Description: This is a digitally signed message part
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope-Checkins] SVN: Products.Five/branches/1.4/ Removed awful _zope_app usage which was causing ConnectionStateError problems.

2006-08-21 Thread Rocky Burt
Log message for revision 69719:
  Removed awful _zope_app usage which was causing ConnectionStateError problems.

Changed:
  U   Products.Five/branches/1.4/CHANGES.txt
  U   Products.Five/branches/1.4/fiveconfigure.py
  U   Products.Five/branches/1.4/pythonproducts.py
  U   Products.Five/branches/1.4/tests/test_pythonproducts.py

-=-
Modified: Products.Five/branches/1.4/CHANGES.txt
===
--- Products.Five/branches/1.4/CHANGES.txt  2006-08-21 12:27:47 UTC (rev 
69718)
+++ Products.Five/branches/1.4/CHANGES.txt  2006-08-21 13:53:13 UTC (rev 
69719)
@@ -2,6 +2,16 @@
 Five Changes
 
 
+Five 1.4.x
+==
+
+Bugfixes
+
+
+* Backported Zope 2.10's pythonproducts zope app handling to help resolve
+  an issue with ConnectionStateError's.
+
+
 Five 1.4.1 (2006-08-13)
 ===
 

Modified: Products.Five/branches/1.4/fiveconfigure.py
===
--- Products.Five/branches/1.4/fiveconfigure.py 2006-08-21 12:27:47 UTC (rev 
69718)
+++ Products.Five/branches/1.4/fiveconfigure.py 2006-08-21 13:53:13 UTC (rev 
69719)
@@ -27,6 +27,7 @@
 from App.ProductContext import ProductContext
 import Products
 from zLOG import LOG, ERROR
+import Zope2
 
 from zope.interface import classImplements, classImplementsOnly, implementedBy
 from zope.interface.interface import InterfaceClass
@@ -266,18 +267,25 @@
 raise ValueError(Must be a package and the  \
  package must be filesystem based)
 
-product = initializeProduct(module_, 
-module_.__name__, 
-module_.__path__[0], 
-pythonproducts._zope_app)
+app = Zope2.app()
+try:
+product = initializeProduct(module_, 
+module_.__name__, 
+module_.__path__[0],
+app)
 
-product.package_name = module_.__name__
+product.package_name = module_.__name__
 
-if initFunc is not None:
-newContext = ProductContext(product, pythonproducts._zope_app, module_)
-initFunc(newContext)
+if initFunc is not None:
+newContext = ProductContext(product, app, module_)
+initFunc(newContext)
+finally:
+try:
+import transaction
+transaction.commit()
+finally:
+app._p_jar.close()
 
-
 def registerPackage(_context, package, initialize=None):
 ZCML directive function for registering a python package product
 

Modified: Products.Five/branches/1.4/pythonproducts.py
===
--- Products.Five/branches/1.4/pythonproducts.py2006-08-21 12:27:47 UTC 
(rev 69718)
+++ Products.Five/branches/1.4/pythonproducts.py2006-08-21 13:53:13 UTC 
(rev 69719)
@@ -25,9 +25,8 @@
 from App.Product import initializeProduct
 from App.ProductContext import ProductContext
 from zope.testing import cleanup
+import Zope2
 
-_zope_app = None
-
 def isMonkeyPatched(m):
 return hasattr(m, '__five_method__')  
 
@@ -35,26 +34,18 @@
 Initialize the python-packages-as-products logic
 
 
-from OFS.Application import Application
-
-global _zope_app
-if isinstance(appOrContext, Application):
-_zope_app = appOrContext
-else:
-_zope_app = appOrContext._ProductContext__app
-
-applyPatches(_zope_app)
+applyPatches()
 
 
-def applyPatches(app):
+def applyPatches():
 Apply necessary monkey patches to force Zope 2 to be capable of
 handling products that are not necessarily located under the Products
 package.  Ultimately all functionality provided by these patches should
 be folded into Zope 2 core.
 
 
-patch_ProductDispatcher__bobo_traverse__(app)
-patch_externalmethod(app)
+patch_ProductDispatcher__bobo_traverse__()
+patch_externalmethod()
 
 def removePatches():
 Remove all monkey patches.
@@ -77,11 +68,11 @@
 # Most of these monkey patches were repurposed from the code I 
 # wrote for Basket - Rocky
 
-def product_packages(app):
+def product_packages():
 Returns all product packages including the regularly defined
 zope2 packages and those without the Products namespace package.
 
-
+
 old_product_packages = {}
 for x in dir(Products):
 m = getattr(Products, x)
@@ -89,23 +80,27 @@
 old_product_packages[x] = m
 
 packages = {}
-products = app.Control_Panel.Products
-for product_id in products.objectIds():
-product = products[product_id]
-if hasattr(product, 'package_name'):
-pos = product.package_name.rfind('.')
-if pos  -1:
-packages[product_id] = __import__(product.package_name, 
-   

[Zope-Checkins] SVN: Products.Five/branches/1.4/CHANGES.txt Reorganized changelog entries to reflect bug fixes and restructuring for unreleased.

2006-07-20 Thread Rocky Burt
Log message for revision 69227:
  Reorganized changelog entries to reflect bug fixes and restructuring for 
unreleased.

Changed:
  U   Products.Five/branches/1.4/CHANGES.txt

-=-
Modified: Products.Five/branches/1.4/CHANGES.txt
===
--- Products.Five/branches/1.4/CHANGES.txt  2006-07-20 12:22:54 UTC (rev 
69226)
+++ Products.Five/branches/1.4/CHANGES.txt  2006-07-20 12:32:25 UTC (rev 
69227)
@@ -5,27 +5,30 @@
 Five 1.4.1 (unreleased)
 ===
 
+Bugfixes
+
+
+* Made the pythonproducts monkey patching more robust by checking to
+  ensure patches aren't reapplied and cleaning up after itself.
+
 * Backported the new traversal lookup order from Zope 2.10 (attribute, adapter,
   acquired attribute).
 
-* Enabled the viewlet related directives by default.
-
-* Added acquisition wrappers to viewlets before updating or rendering.
-
 * Made the provider directive acquisition wrap the resultant content provider
   so that simple providers that need security declarations (e.g. those that
   render pagetemplates) can work with the Zope 2 security machinery.
 
+* Added acquisition wrappers to viewlets before updating or rendering.
+
+Restructuring
+-
+
+* Enabled the viewlet related directives by default.
+
 * Added Five.browser.pagetemplatefile.ViewPageTemplateFile as an alias
   to ZopeTwoPageTemplateFile and as a Zope 2 correspondence to
   zope.app.pagetemplate.ViewPageTemplateFile.
 
-Bugfixes
-
-
-* Made the pythonproducts monkey patching more robust by checking to
-  ensure patches aren't reapplied and cleaning up after itself.
-
 Five 1.4 (2006-05-29)
 =
 

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/2.10/ OFS Image: Image and File now both support simple unicode objects for data (they function the same as strings for data).

2006-06-28 Thread Rocky Burt
Log message for revision 68876:
  OFS Image: Image and File now both support simple unicode objects for data 
(they function the same as strings for data).

Changed:
  U   Zope/branches/2.10/doc/CHANGES.txt
  U   Zope/branches/2.10/lib/python/OFS/Image.py
  U   Zope/branches/2.10/lib/python/OFS/tests/testFileAndImage.py

-=-
Modified: Zope/branches/2.10/doc/CHANGES.txt
===
--- Zope/branches/2.10/doc/CHANGES.txt  2006-06-28 11:20:16 UTC (rev 68875)
+++ Zope/branches/2.10/doc/CHANGES.txt  2006-06-28 11:24:05 UTC (rev 68876)
@@ -18,6 +18,9 @@
 
 Bugs Fixed
 
+  - OFS Image: Image and File now both support simple unicode objects
+for data (they function the same as strings for data).
+
   - OFS Application: Updated deprecation warnings.
 Support for '__ac_permissions__' and 'meta_types' will be removed in
 Zope 2.11, 'methods' support might remain longer.

Modified: Zope/branches/2.10/lib/python/OFS/Image.py
===
--- Zope/branches/2.10/lib/python/OFS/Image.py  2006-06-28 11:20:16 UTC (rev 
68875)
+++ Zope/branches/2.10/lib/python/OFS/Image.py  2006-06-28 11:24:05 UTC (rev 
68876)
@@ -43,7 +43,6 @@
 from cgi import escape
 import transaction
 
-StringType=type('')
 manage_addFileForm=DTMLFile('dtml/imageAdd', globals(),Kind='File',kind='file')
 def manage_addFile(self,id,file='',title='',precondition='', content_type='',
REQUEST=None):
@@ -231,7 +230,7 @@
 RESPONSE.setStatus(206) # Partial content
 
 data = self.data
-if type(data) is StringType:
+if isinstance(data, basestring):
 RESPONSE.write(data[start:end])
 return True
 
@@ -302,7 +301,7 @@
 'Content-Range: bytes %d-%d/%d\r\n\r\n' % (
 start, end - 1, self.size))
 
-if type(data) is StringType:
+if isinstance(data, basestring):
 RESPONSE.write(data[start:end])
 
 else:
@@ -401,7 +400,7 @@
 self.ZCacheable_set(None)
 
 data=self.data
-if type(data) is type(''):
+if isinstance(data, basestring):
 RESPONSE.setBase(None)
 return data
 
@@ -481,7 +480,7 @@
 if headers and headers.has_key('content-type'):
 content_type=headers['content-type']
 else:
-if type(body) is not type(''): body=body.data
+if not isinstance(body, basestring): body=body.data
 content_type, enc=guess_content_type(
 getattr(file, 'filename',id), body, content_type)
 return content_type
@@ -490,7 +489,7 @@
 
 n=1  16
 
-if type(file) is StringType:
+if isinstance(file, basestring):
 size=len(file)
 if size  n: return file, size
 # Big string: cut it into smaller chunks
@@ -617,7 +616,7 @@
 return result
 
 data = self.data
-if type(data) is type(''):
+if isinstance(data, basestring):
 RESPONSE.setBase(None)
 return data
 

Modified: Zope/branches/2.10/lib/python/OFS/tests/testFileAndImage.py
===
--- Zope/branches/2.10/lib/python/OFS/tests/testFileAndImage.py 2006-06-28 
11:20:16 UTC (rev 68875)
+++ Zope/branches/2.10/lib/python/OFS/tests/testFileAndImage.py 2006-06-28 
11:24:05 UTC (rev 68876)
@@ -252,7 +252,15 @@
 verifyClass(HTTPRangeInterface, File)
 verifyClass(WriteLockInterface, File)
 
-
+def testUnicodeWithIndexHtml(self):
+# Introduced to help test the fact that Image.py has been
+# changed to be lenient towards any basestring type, not just str
+
+val = u'some unicode string here'
+self.file.manage_edit('foobar', 'text/plain', filedata=val)
+s = self.file.index_html(self.app.REQUEST, self.app.REQUEST.RESPONSE)
+self.assertEquals(s, val)
+
 class ImageTests(FileTests):
 data = open(filedata, 'rb').read()
 content_type = 'image/gif'
@@ -285,7 +293,6 @@
 
 verifyClass(WriteLockInterface, Image)
 
-
 def test_suite():
 return unittest.TestSuite((
 unittest.makeSuite(FileTests),

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/trunk/ OFS Image: Image and File now both support simple unicode objects for data (they function the same as strings for data).

2006-06-28 Thread Rocky Burt
Log message for revision 68877:
  OFS Image: Image and File now both support simple unicode objects for data 
(they function the same as strings for data).

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  U   Zope/trunk/lib/python/OFS/Image.py
  U   Zope/trunk/lib/python/OFS/tests/testFileAndImage.py

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===
--- Zope/trunk/doc/CHANGES.txt  2006-06-28 11:24:05 UTC (rev 68876)
+++ Zope/trunk/doc/CHANGES.txt  2006-06-28 11:38:18 UTC (rev 68877)
@@ -27,6 +27,9 @@
 
 Bugs Fixed
 
+  - OFS Image: Image and File now both support simple unicode objects
+for data (they function the same as strings for data).
+
   - Collector #2122: fixed missing is_proxying_match definition
 in ZServer/HTTPServer
 

Modified: Zope/trunk/lib/python/OFS/Image.py
===
--- Zope/trunk/lib/python/OFS/Image.py  2006-06-28 11:24:05 UTC (rev 68876)
+++ Zope/trunk/lib/python/OFS/Image.py  2006-06-28 11:38:18 UTC (rev 68877)
@@ -43,7 +43,6 @@
 from cgi import escape
 import transaction
 
-StringType=type('')
 manage_addFileForm=DTMLFile('dtml/imageAdd', globals(),Kind='File',kind='file')
 def manage_addFile(self,id,file='',title='',precondition='', content_type='',
REQUEST=None):
@@ -231,7 +230,7 @@
 RESPONSE.setStatus(206) # Partial content
 
 data = self.data
-if type(data) is StringType:
+if isinstance(data, basestring):
 RESPONSE.write(data[start:end])
 return True
 
@@ -302,7 +301,7 @@
 'Content-Range: bytes %d-%d/%d\r\n\r\n' % (
 start, end - 1, self.size))
 
-if type(data) is StringType:
+if isinstance(data, basestring):
 RESPONSE.write(data[start:end])
 
 else:
@@ -401,7 +400,7 @@
 self.ZCacheable_set(None)
 
 data=self.data
-if type(data) is type(''):
+if isinstance(data, basestring):
 RESPONSE.setBase(None)
 return data
 
@@ -481,7 +480,7 @@
 if headers and headers.has_key('content-type'):
 content_type=headers['content-type']
 else:
-if type(body) is not type(''): body=body.data
+if not isinstance(body, basestring): body=body.data
 content_type, enc=guess_content_type(
 getattr(file, 'filename',id), body, content_type)
 return content_type
@@ -490,7 +489,7 @@
 
 n=1  16
 
-if type(file) is StringType:
+if isinstance(file, basestring):
 size=len(file)
 if size  n: return file, size
 # Big string: cut it into smaller chunks
@@ -617,7 +616,7 @@
 return result
 
 data = self.data
-if type(data) is type(''):
+if isinstance(data, basestring):
 RESPONSE.setBase(None)
 return data
 

Modified: Zope/trunk/lib/python/OFS/tests/testFileAndImage.py
===
--- Zope/trunk/lib/python/OFS/tests/testFileAndImage.py 2006-06-28 11:24:05 UTC 
(rev 68876)
+++ Zope/trunk/lib/python/OFS/tests/testFileAndImage.py 2006-06-28 11:38:18 UTC 
(rev 68877)
@@ -252,7 +252,15 @@
 verifyClass(HTTPRangeInterface, File)
 verifyClass(WriteLockInterface, File)
 
-
+def testUnicodeWithIndexHtml(self):
+# Introduced to help test the fact that Image.py has been
+# changed to be lenient towards any basestring type, not just str
+
+val = u'some unicode string here'
+self.file.manage_edit('foobar', 'text/plain', filedata=val)
+s = self.file.index_html(self.app.REQUEST, self.app.REQUEST.RESPONSE)
+self.assertEquals(s, val)
+
 class ImageTests(FileTests):
 data = open(filedata, 'rb').read()
 content_type = 'image/gif'
@@ -285,7 +293,6 @@
 
 verifyClass(WriteLockInterface, Image)
 
-
 def test_suite():
 return unittest.TestSuite((
 unittest.makeSuite(FileTests),

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/2.10/ OFS Image: Image and File updated to use isinstance(data, str) and raises TypeError upon encountering unicode objects.

2006-06-28 Thread Rocky Burt
Log message for revision 68879:
  OFS Image: Image and File updated to use isinstance(data, str) and raises 
TypeError upon encountering unicode objects.

Changed:
  U   Zope/branches/2.10/doc/CHANGES.txt
  U   Zope/branches/2.10/lib/python/OFS/Image.py
  U   Zope/branches/2.10/lib/python/OFS/tests/testFileAndImage.py

-=-
Modified: Zope/branches/2.10/doc/CHANGES.txt
===
--- Zope/branches/2.10/doc/CHANGES.txt  2006-06-28 11:40:37 UTC (rev 68878)
+++ Zope/branches/2.10/doc/CHANGES.txt  2006-06-28 12:43:34 UTC (rev 68879)
@@ -18,8 +18,8 @@
 
 Bugs Fixed
 
-  - OFS Image: Image and File now both support simple unicode objects
-for data (they function the same as strings for data).
+  - OFS Image: Image and File updated to use isinstance(data, str)
+and raises TypeError upon encountering unicode objects.
 
   - OFS Application: Updated deprecation warnings.
 Support for '__ac_permissions__' and 'meta_types' will be removed in

Modified: Zope/branches/2.10/lib/python/OFS/Image.py
===
--- Zope/branches/2.10/lib/python/OFS/Image.py  2006-06-28 11:40:37 UTC (rev 
68878)
+++ Zope/branches/2.10/lib/python/OFS/Image.py  2006-06-28 12:43:34 UTC (rev 
68879)
@@ -230,7 +230,7 @@
 RESPONSE.setStatus(206) # Partial content
 
 data = self.data
-if isinstance(data, basestring):
+if isinstance(data, str):
 RESPONSE.write(data[start:end])
 return True
 
@@ -301,7 +301,7 @@
 'Content-Range: bytes %d-%d/%d\r\n\r\n' % (
 start, end - 1, self.size))
 
-if isinstance(data, basestring):
+if isinstance(data, str):
 RESPONSE.write(data[start:end])
 
 else:
@@ -400,7 +400,7 @@
 self.ZCacheable_set(None)
 
 data=self.data
-if isinstance(data, basestring):
+if isinstance(data, str):
 RESPONSE.setBase(None)
 return data
 
@@ -427,6 +427,10 @@
 
 security.declarePrivate('update_data')
 def update_data(self, data, content_type=None, size=None):
+if isinstance(data, unicode):
+raise TypeError('Data can only be str or file-like.  '
+'Unicode objects are expressly forbidden.')
+
 if content_type is not None: self.content_type=content_type
 if size is None: size=len(data)
 self.size=size
@@ -480,7 +484,7 @@
 if headers and headers.has_key('content-type'):
 content_type=headers['content-type']
 else:
-if not isinstance(body, basestring): body=body.data
+if not isinstance(body, str): body=body.data
 content_type, enc=guess_content_type(
 getattr(file, 'filename',id), body, content_type)
 return content_type
@@ -489,7 +493,7 @@
 
 n=1  16
 
-if isinstance(file, basestring):
+if isinstance(file, str):
 size=len(file)
 if size  n: return file, size
 # Big string: cut it into smaller chunks
@@ -616,7 +620,7 @@
 return result
 
 data = self.data
-if isinstance(data, basestring):
+if isinstance(data, str):
 RESPONSE.setBase(None)
 return data
 
@@ -776,6 +780,10 @@
 
 security.declarePrivate('update_data')
 def update_data(self, data, content_type=None, size=None):
+if isinstance(data, unicode):
+raise TypeError('Data can only be str or file-like.  '
+'Unicode objects are expressly forbidden.')
+
 if size is None: size=len(data)
 
 self.size=size

Modified: Zope/branches/2.10/lib/python/OFS/tests/testFileAndImage.py
===
--- Zope/branches/2.10/lib/python/OFS/tests/testFileAndImage.py 2006-06-28 
11:40:37 UTC (rev 68878)
+++ Zope/branches/2.10/lib/python/OFS/tests/testFileAndImage.py 2006-06-28 
12:43:34 UTC (rev 68879)
@@ -252,15 +252,12 @@
 verifyClass(HTTPRangeInterface, File)
 verifyClass(WriteLockInterface, File)
 
-def testUnicodeWithIndexHtml(self):
-# Introduced to help test the fact that Image.py has been
-# changed to be lenient towards any basestring type, not just str
-
+def testUnicode(self):
 val = u'some unicode string here'
-self.file.manage_edit('foobar', 'text/plain', filedata=val)
-s = self.file.index_html(self.app.REQUEST, self.app.REQUEST.RESPONSE)
-self.assertEquals(s, val)
 
+self.assertRaises(TypeError, self.file.manage_edit,
+  'foobar', 'text/plain', filedata=val)
+
 

[Zope-Checkins] SVN: Zope/trunk/ OFS Image: Image and File updated to use isinstance(data, str) and raises TypeError upon encountering unicode objects.

2006-06-28 Thread Rocky Burt
Log message for revision 68880:
  OFS Image: Image and File updated to use isinstance(data, str) and raises 
TypeError upon encountering unicode objects.

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  U   Zope/trunk/lib/python/OFS/Image.py
  U   Zope/trunk/lib/python/OFS/tests/testFileAndImage.py

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===
--- Zope/trunk/doc/CHANGES.txt  2006-06-28 12:43:34 UTC (rev 68879)
+++ Zope/trunk/doc/CHANGES.txt  2006-06-28 12:50:34 UTC (rev 68880)
@@ -27,8 +27,8 @@
 
 Bugs Fixed
 
-  - OFS Image: Image and File now both support simple unicode objects
-for data (they function the same as strings for data).
+  - OFS Image: Image and File updated to use isinstance(data, str)
+and raises TypeError upon encountering unicode objects.
 
   - Collector #2122: fixed missing is_proxying_match definition
 in ZServer/HTTPServer

Modified: Zope/trunk/lib/python/OFS/Image.py
===
--- Zope/trunk/lib/python/OFS/Image.py  2006-06-28 12:43:34 UTC (rev 68879)
+++ Zope/trunk/lib/python/OFS/Image.py  2006-06-28 12:50:34 UTC (rev 68880)
@@ -230,7 +230,7 @@
 RESPONSE.setStatus(206) # Partial content
 
 data = self.data
-if isinstance(data, basestring):
+if isinstance(data, str):
 RESPONSE.write(data[start:end])
 return True
 
@@ -301,7 +301,7 @@
 'Content-Range: bytes %d-%d/%d\r\n\r\n' % (
 start, end - 1, self.size))
 
-if isinstance(data, basestring):
+if isinstance(data, str):
 RESPONSE.write(data[start:end])
 
 else:
@@ -400,7 +400,7 @@
 self.ZCacheable_set(None)
 
 data=self.data
-if isinstance(data, basestring):
+if isinstance(data, str):
 RESPONSE.setBase(None)
 return data
 
@@ -427,6 +427,10 @@
 
 security.declarePrivate('update_data')
 def update_data(self, data, content_type=None, size=None):
+if isinstance(data, unicode):
+raise TypeError('Data can only be str or file-like.  '
+'Unicode objects are expressly forbidden.')
+
 if content_type is not None: self.content_type=content_type
 if size is None: size=len(data)
 self.size=size
@@ -480,7 +484,7 @@
 if headers and headers.has_key('content-type'):
 content_type=headers['content-type']
 else:
-if not isinstance(body, basestring): body=body.data
+if not isinstance(body, str): body=body.data
 content_type, enc=guess_content_type(
 getattr(file, 'filename',id), body, content_type)
 return content_type
@@ -489,7 +493,7 @@
 
 n=1  16
 
-if isinstance(file, basestring):
+if isinstance(file, str):
 size=len(file)
 if size  n: return file, size
 # Big string: cut it into smaller chunks
@@ -616,7 +620,7 @@
 return result
 
 data = self.data
-if isinstance(data, basestring):
+if isinstance(data, str):
 RESPONSE.setBase(None)
 return data
 
@@ -776,6 +780,10 @@
 
 security.declarePrivate('update_data')
 def update_data(self, data, content_type=None, size=None):
+if isinstance(data, unicode):
+raise TypeError('Data can only be str or file-like.  '
+'Unicode objects are expressly forbidden.')
+
 if size is None: size=len(data)
 
 self.size=size

Modified: Zope/trunk/lib/python/OFS/tests/testFileAndImage.py
===
--- Zope/trunk/lib/python/OFS/tests/testFileAndImage.py 2006-06-28 12:43:34 UTC 
(rev 68879)
+++ Zope/trunk/lib/python/OFS/tests/testFileAndImage.py 2006-06-28 12:50:34 UTC 
(rev 68880)
@@ -252,15 +252,12 @@
 verifyClass(HTTPRangeInterface, File)
 verifyClass(WriteLockInterface, File)
 
-def testUnicodeWithIndexHtml(self):
-# Introduced to help test the fact that Image.py has been
-# changed to be lenient towards any basestring type, not just str
-
+def testUnicode(self):
 val = u'some unicode string here'
-self.file.manage_edit('foobar', 'text/plain', filedata=val)
-s = self.file.index_html(self.app.REQUEST, self.app.REQUEST.RESPONSE)
-self.assertEquals(s, val)
 
+self.assertRaises(TypeError, self.file.manage_edit,
+  'foobar', 'text/plain', filedata=val)
+
 class ImageTests(FileTests):
 data = open(filedata, 'rb').read()
 content_type = 'image/gif'


[Zope-Checkins] SVN: Products.Five/branches/rocky-products-less-product-loading/ Going to cut a new branch and copy over logic from the old one as necessary.

2006-06-21 Thread Rocky Burt
Log message for revision 65792:
  Going to cut a new branch and copy over logic from the old one as necessary.

Changed:
  D   Products.Five/branches/rocky-products-less-product-loading/

-=-
___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-dev] Re: Zope2 Bugday Results

2006-06-16 Thread Rocky Burt

Whoot! Nice going guys, sorry I couldn't be more helpful.

- Rocky


On Thu, 2006-15-06 at 19:37 -0400, Tres Seaver wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Issues Resolved
 
  - 1777: ExtensionClass delattr raises KeyError,
http://www.zope.org/Collectors/Zope/1777
 
  - 2009: startup segfault (OFS),
http://www.zope.org/Collectors/Zope/2009
 
  - 2016:  DemoStorage doesn't work with ZEO,
http://www.zope.org/Collectors/Zope/2016
 
  - 2036: PersistentMapping pop method is not persistent,
http://www.zope.org/Collectors/Zope/2036
 
  - 2063: Attribute error in MailHost/sendTemplate,
http://www.zope.org/Collectors/Zope/2063
 
  - 2119: Requiring 'site.zcml' breaks BBB,
http://www.zope.org/Collectors/Zope/2119
 
  - 2133: standard_error_messages out of sync,
http://www.zope.org/Collectors/Zope/2133
 
 Issues Rejected
 
  - 1919: Request marshllers inconsistent,
http://www.zope.org/Collectors/Zope/1919
 
  - 1948: SecurityImportExport for Zope 2.9,
http://www.zope.org/Collectors/Zope/1948
 
  - 1969: Allow delay in opening ports,
http://www.zope.org/Collectors/Zope/1969
 
  - 2124: Exception occures when importing a product from
 Control_Panel/Products,
http://www.zope.org/Collectors/Zope/2124
 
 Issues Marked WONTFIX
 
  - 1896: manage_changeProperties() and manage_addProperty() behave
 differently for lines,
http://www.zope.org/Collectors/Zope/1896
 
  - 1899: catalogs in .zexp from 2.7 dont import in 2.8,
http://www.zope.org/Collectors/Zope/1899
 
o I reopened this issue, as I think the fix (which had already
  been checked in) is risky.
 
 
 - --
 ===
 Tres Seaver  +1 202-558-7113  [EMAIL PROTECTED]
 Palladion Software   Excellence by Designhttp://palladion.com
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.2.2 (GNU/Linux)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 
 iD8DBQFEke8l+gerLs4ltQ4RAuyVAJ9snOuD7tbFxUGRMsPr9e+PpnWiNQCfQevL
 mZC6Udp65Gzy1jPpHnrjQzU=
 =nqbu
 -END PGP SIGNATURE-
 
 ___
 Zope-Dev maillist  -  Zope-Dev@zope.org
 http://mail.zope.org/mailman/listinfo/zope-dev
 **  No cross posts or HTML encoding!  **
 (Related lists - 
  http://mail.zope.org/mailman/listinfo/zope-announce
  http://mail.zope.org/mailman/listinfo/zope )
 
-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
News About The Server (blog) -- http://www.serverzen.net



signature.asc
Description: This is a digitally signed message part
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: Time-based releases a good idea?

2006-06-14 Thread Rocky Burt
On Wed, 2006-14-06 at 13:34 +0200, Lennart Regebro wrote:
 The majority has agreed that the path forward for Zope is to make it
 possible for people to use Zope3 technologies without having to
 rewrite everything from scratch. The changes you see in Zope2 are a
 direct effect of that. You should only get upgrade problems if you
 skip several versions. Other than that, it should pretty much just
 work.

I'd just like to add that I agree with all points in this post.  Plone
is also in a very similar situation and it was quite minimal work
getting from 2.8 to 2.9 and now to 2.10.  The result is that Plone is
now using more and more component architecture functionality which is
making certain area's easier to maintain and is currently making things
more fun to code :)  As well, the switch to zope 3 technologies is
enabling us reuse more zope tech so we have to develop less plone tech
which is always a good thing.

- Rocky

-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
News About The Server (blog) -- http://www.serverzen.net



signature.asc
Description: This is a digitally signed message part
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: Unittests with different zope configuration?

2006-06-07 Thread Rocky Burt
On Wed, 2006-07-06 at 12:04 +0200, Stefan H. Holek wrote:
 I use this to set debug-mode off:
 
  # Switch off debug mode
  import App.config
  config = App.config.getConfiguration()
  config.debug_mode = 0
  App.config.setConfiguration(config)

Oh wow, this trick should come in handy.  Thanks Stefan!

- Rocky

-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
News About The Server (blog) -- http://www.serverzen.net



signature.asc
Description: This is a digitally signed message part
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: Bugday for Zope 2.10?

2006-06-04 Thread Rocky Burt
On Sun, 2006-04-06 at 09:21 +0200, Andreas Jung wrote:
 I propose to have a bugday before the next Zope 2.10 beta release.
 How about June, 15th?

Sounds good to me, just marked my calendar, I'll be there!

- Rocky

-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
News About The Server (blog) -- http://www.serverzen.net



signature.asc
Description: This is a digitally signed message part
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope] Re: Any known leaks in ExtFile and OpenFlow?

2006-06-04 Thread Rocky Burt
On Sun, 2006-04-06 at 11:59 +0200, Michael Vartanyan wrote:
 One of my Zope (2.8.4 on Python 2.4.2, SLES9) sites constantly hits the 
 memory limit. It makes heavy use of two products - ExtFile (1.5.0) and 
 OpenFlow (1.1.0). ExtFile class (of ExtFile) and workitem class (of 
 OpenFlow) are leading the refcount list with a not-constant but overall 
 increasing numbers of references. Refcounts for both reach numbers that 
 are incomparably higher than the numbers of their instances in ZoDB. I 
 wanted to ask if there are known leaks in these products before going 
 into (painful) hunting and debugging leaks in my own code.

I don't know if this is related or not, but python2.4.x is not supported
on Zope 2.8.x.  But chasing down issues like this will be definitely be
harded while not running a supported base configuration.

- Rocky


-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
News About The Server (blog) -- http://www.serverzen.net



signature.asc
Description: This is a digitally signed message part
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope-Checkins] SVN: Products.Five/trunk/zcml.py Replaced error when missing site.zcml with a warning.

2006-05-31 Thread Rocky Burt
Log message for revision 68410:
  Replaced error when missing site.zcml with a warning.

Changed:
  U   Products.Five/trunk/zcml.py

-=-
Modified: Products.Five/trunk/zcml.py
===
--- Products.Five/trunk/zcml.py 2006-05-31 13:38:24 UTC (rev 68409)
+++ Products.Five/trunk/zcml.py 2006-05-31 15:12:29 UTC (rev 68410)
@@ -15,6 +15,7 @@
 
 $Id$
 
+import warnings
 import os
 from zope.configuration import xmlconfig
 
@@ -33,6 +34,7 @@
 # load instance site configuration file
 site_zcml = os.path.join(INSTANCE_HOME, etc, site.zcml)
 skel_site_zcml = os.path.join(INSTANCE_HOME, skel, etc, site.zcml)
+skel_site2_zcml = os.path.join(ZOPE_HOME, skel, etc, site.zcml)
 
 if os.path.exists(site_zcml):
 file = site_zcml
@@ -40,11 +42,12 @@
 # check for zope installation home skel during running unit tests
 file = skel_site_zcml
 else:
-msg = site.zcml is now required to live at '%s', for  \
-  sites upgraded from Zope 2.9 please copy site.zcml  \
-  from your installed Zope's skel/etc directory \
-  % site_zcml 
-raise IOError(msg)
+file = skel_site2_zcml
+msg = site.zcml should now live at '%s', for  \
+  sites upgraded from Zope 2.9 please copy '%s'  \
+  to '%s' \
+  % (site_zcml, skel_site2_zcml, site_zcml)
+warnings.warn(msg, DeprecationWarning)
 
 global _context
 _context = xmlconfig.file(file)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/ Updated reference to a Five version that turned the site.zcml error into a warning.

2006-05-31 Thread Rocky Burt
Log message for revision 68411:
  Updated reference to a Five version that turned the site.zcml error into a 
warning.

Changed:
  _U  Zope/trunk/lib/python/Products/

-=-

Property changes on: Zope/trunk/lib/python/Products
___
Name: svn:externals
   - Five svn://svn.zope.org/repos/main/Products.Five/tags/1.5c

   + Five-r 68410 svn://svn.zope.org/repos/main/Products.Five/trunk


___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/2.10/lib/python/Products/ Updated Zope to use Five revision so copying site.zcml is no longer mandatory.

2006-05-31 Thread Rocky Burt
Log message for revision 68416:
  Updated Zope to use Five revision so copying site.zcml is no longer mandatory.

Changed:
  _U  Zope/branches/2.10/lib/python/Products/

-=-

Property changes on: Zope/branches/2.10/lib/python/Products
___
Name: svn:externals
   - Five svn://svn.zope.org/repos/main/Products.Five/tags/1.5c

   + Five-r 68410 svn://svn.zope.org/repos/main/Products.Five/trunk


___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-dev] Re: SVN: Products.Five/trunk/ Five now requires site.zcml to live in /etc

2006-05-30 Thread Rocky Burt
On Tue, 2006-30-05 at 12:45 -0500, whit wrote:
 there is a world of difference between shipping with and requiring...is 
 this language really what happened?
 
 I thought the decision was to  ship with a site.zcml and 
 package-includes directory in their conventional place, not changing 
 Five's behavior to look for it's skeleton if it didn't find the 
 aforementioned.

No fear, this will be fixed shortly.

- Rocky


-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
News About The Server (blog) -- http://www.serverzen.net



signature.asc
Description: This is a digitally signed message part
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-Checkins] SVN: Zope/trunk/lib/python/App/ Put in an extra check to handle packages that had namespace packages.

2006-05-29 Thread Rocky Burt
Log message for revision 68339:
  Put in an extra check to handle packages that had namespace packages.

Changed:
  U   Zope/trunk/lib/python/App/Extensions.py
  U   Zope/trunk/lib/python/App/FactoryDispatcher.py

-=-
Modified: Zope/trunk/lib/python/App/Extensions.py
===
--- Zope/trunk/lib/python/App/Extensions.py 2006-05-29 10:59:28 UTC (rev 
68338)
+++ Zope/trunk/lib/python/App/Extensions.py 2006-05-29 11:28:45 UTC (rev 
68339)
@@ -98,12 +98,16 @@
 
 if result is None:
 try:
-l = name.find('.')
+l = name.rfind('.')
 if l  0:
 realName = name[l + 1:]
 toplevel = name[:l]
 
-m = __import__(toplevel)
+pos = toplevel.rfind('.')
+if pos  -1:
+m = __import__(toplevel, globals(), {}, toplevel[pos+1:])
+else:
+m = __import__(toplevel)
 
 d = os.path.join(m.__path__[0], prefix, realName)
 

Modified: Zope/trunk/lib/python/App/FactoryDispatcher.py
===
--- Zope/trunk/lib/python/App/FactoryDispatcher.py  2006-05-29 10:59:28 UTC 
(rev 68338)
+++ Zope/trunk/lib/python/App/FactoryDispatcher.py  2006-05-29 11:28:45 UTC 
(rev 68339)
@@ -40,7 +40,13 @@
 for product_id in products.objectIds():
 product = products[product_id]
 if hasattr(product, 'package_name'):
-packages[product_id] = __import__(product.package_name)
+pos = product.package_name.rfind('.')
+if pos  -1:
+packages[product_id] = __import__(product.package_name, 
+  globals(), {}, 
+  
product.package_name[pos+1:])
+else:
+packages[product_id] = __import__(product.package_name)
 elif old_product_packages.has_key(product_id):
 packages[product_id] = old_product_packages[product_id]
 finally:

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Products.Five/branches/1.4/pythonproducts.py Put in an extra check to handle packages that had namespace packages.

2006-05-29 Thread Rocky Burt
Log message for revision 68340:
  Put in an extra check to handle packages that had namespace packages.

Changed:
  U   Products.Five/branches/1.4/pythonproducts.py

-=-
Modified: Products.Five/branches/1.4/pythonproducts.py
===
--- Products.Five/branches/1.4/pythonproducts.py2006-05-29 11:28:45 UTC 
(rev 68339)
+++ Products.Five/branches/1.4/pythonproducts.py2006-05-29 11:37:25 UTC 
(rev 68340)
@@ -73,7 +73,13 @@
 for product_id in products.objectIds():
 product = products[product_id]
 if hasattr(product, 'package_name'):
-packages[product_id] = __import__(product.package_name)
+pos = product.package_name.rfind('.')
+if pos  -1:
+packages[product_id] = __import__(product.package_name, 
+  globals(), {}, 
+  product.package_name[pos+1:])
+else:
+packages[product_id] = __import__(product.package_name)
 elif old_product_packages.has_key(product_id):
 packages[product_id] = old_product_packages[product_id]
 
@@ -127,12 +133,16 @@
 return result
 
 try:
-l = name.find('.')
+l = name.rfind('.')
 if l  0:
 realName = name[l + 1:]
 toplevel = name[:l]
 
-m = __import__(toplevel)
+pos = toplevel.rfind('.')
+if pos  -1:
+m = __import__(toplevel, globals(), {}, toplevel[pos+1:])
+else:
+m = __import__(toplevel)
 
 d = os.path.join(m.__path__[0], prefix, realName)
 

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Products.Five/trunk/viewlet/README.txt Fixing viewlet test, zope.app.size was moved to zope.size.

2006-05-29 Thread Rocky Burt
Log message for revision 68342:
  Fixing viewlet test, zope.app.size was moved to zope.size.

Changed:
  U   Products.Five/trunk/viewlet/README.txt

-=-
Modified: Products.Five/trunk/viewlet/README.txt
===
--- Products.Five/trunk/viewlet/README.txt  2006-05-29 11:43:19 UTC (rev 
68341)
+++ Products.Five/trunk/viewlet/README.txt  2006-05-29 12:18:45 UTC (rev 
68342)
@@ -425,7 +425,7 @@
 Since we want to also provide the size of a file, here a simple implementation
 of the ``ISized`` interface:
 
-   from zope.app import size
+   from zope import size
class FileSized(object):
   ... zope.interface.implements(size.interfaces.ISized)
   ... zope.component.adapts(IFile)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Products.Five/trunk/ Five now requires site.zcml to live in /etc

2006-05-29 Thread Rocky Burt
Log message for revision 68359:
  Five now requires site.zcml to live in /etc

Changed:
  U   Products.Five/trunk/CHANGES.txt
  D   Products.Five/trunk/skel/
  U   Products.Five/trunk/zcml.py

-=-
Modified: Products.Five/trunk/CHANGES.txt
===
--- Products.Five/trunk/CHANGES.txt 2006-05-29 19:42:51 UTC (rev 68358)
+++ Products.Five/trunk/CHANGES.txt 2006-05-29 20:24:13 UTC (rev 68359)
@@ -8,6 +8,18 @@
 Restructuring
 -
 
+* Zope 2.10+ now includes site.zcml as part of its instance creation
+  skel directory.  As a consequence Five now requires this file to exist
+  in every instance.  If upgrading a site from Zope 2.9 to 2.10, you will 
+  need to copy site.zcml and package-includes/ from your installed Zope 
+  installation location (skel/etc/) into the etc/ directory of your upgraded 
+  instance.
+  
+  The rationale for requiring this new file is to bring Zope 2 instances
+  closer in consistency to Zope 3 instances.  It also eases use of Zope 3
+  coding techniques in Zope 2 and removes some confusion when trying
+  to run pure Zope 3 applications on Zope 2.
+
 * Zope 2.10+ uses the Zope 3 PageTemplate engine (incl. TAL and
   TALES).  A bunch of special and magic code in Five has become
   obsolete with this, some other had to be readjusted.

Modified: Products.Five/trunk/zcml.py
===
--- Products.Five/trunk/zcml.py 2006-05-29 19:42:51 UTC (rev 68358)
+++ Products.Five/trunk/zcml.py 2006-05-29 20:24:13 UTC (rev 68359)
@@ -32,13 +32,14 @@
 
 # load instance site configuration file
 site_zcml = os.path.join(INSTANCE_HOME, etc, site.zcml)
-if os.path.exists(site_zcml):
-file = site_zcml
-else:
-file = os.path.join(os.path.dirname(__file__), skel, site.zcml)
+if not os.path.exists(site_zcml):
+raise IOError, site.zcml is now required to live at '%s', for  \
+   sites upgraded from Zope 2.9 please copy site.zcml  \
+   from your installed Zope's skel/etc directory \
+   % site_zcml
 
 global _context
-_context = xmlconfig.file(file)
+_context = xmlconfig.file(site_zcml)
 
 
 def load_config(file, package=None, execute=True):

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/trunk/ Zope now provides site.zcml in its instance skel.

2006-05-29 Thread Rocky Burt
Log message for revision 68360:
  Zope now provides site.zcml in its instance skel.

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  A   Zope/trunk/skel/etc/package-includes/
  A   Zope/trunk/skel/etc/site.zcml

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===
--- Zope/trunk/doc/CHANGES.txt  2006-05-29 20:24:13 UTC (rev 68359)
+++ Zope/trunk/doc/CHANGES.txt  2006-05-29 20:27:38 UTC (rev 68360)
@@ -18,6 +18,20 @@
 
 Restructuring
 
+  - Zope 2.10+ now includes site.zcml as part of its instance 
+creation skel directory.  As a consequence Five now requires 
+this file to exist in every instance.  If upgrading a site 
+from Zope 2.9 to 2.10, you will need to copy site.zcml and 
+package-includes/ from your installed Zope installation 
+location (skel/etc/) into the etc/ directory of your upgraded 
+instance.
+  
+The rationale for requiring this new file is to bring Zope 2 
+instances closer in consistency to Zope 3 instances.  It also 
+eases use of Zope 3 coding techniques in Zope 2 and removes 
+some confusion when trying to run pure Zope 3 applications on 
+Zope 2.
+
   - Products.PageTemplates now uses the Zope 3 ZPT implementation
 in zope.pagetemplate.
 

Added: Zope/trunk/skel/etc/site.zcml
===
--- Zope/trunk/skel/etc/site.zcml   2006-05-29 20:24:13 UTC (rev 68359)
+++ Zope/trunk/skel/etc/site.zcml   2006-05-29 20:27:38 UTC (rev 68360)
@@ -0,0 +1,25 @@
+configure xmlns=http://namespaces.zope.org/zope;
+  xmlns:meta=http://namespaces.zope.org/meta;
+   xmlns:five=http://namespaces.zope.org/five;
+
+  include package=Products.Five /
+  meta:redefinePermission from=zope2.Public to=zope.Public /
+
+
+  !-- Load the meta --
+
+  include files=package-includes/*-meta.zcml /
+  five:loadProducts file=meta.zcml/
+
+
+  !-- Load the configuration --
+
+  include files=package-includes/*-configure.zcml /
+  five:loadProducts /
+
+
+  !-- Load the configuration overrides--
+
+  five:loadProductsOverrides /
+
+/configure

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Products.Five/trunk/zcml.py Fixed exception raising to use future proof style.

2006-05-29 Thread Rocky Burt
Log message for revision 68361:
  Fixed exception raising to use future proof style.

Changed:
  U   Products.Five/trunk/zcml.py

-=-
Modified: Products.Five/trunk/zcml.py
===
--- Products.Five/trunk/zcml.py 2006-05-29 20:27:38 UTC (rev 68360)
+++ Products.Five/trunk/zcml.py 2006-05-29 20:31:03 UTC (rev 68361)
@@ -33,10 +33,10 @@
 # load instance site configuration file
 site_zcml = os.path.join(INSTANCE_HOME, etc, site.zcml)
 if not os.path.exists(site_zcml):
-raise IOError, site.zcml is now required to live at '%s', for  \
-   sites upgraded from Zope 2.9 please copy site.zcml  \
-   from your installed Zope's skel/etc directory \
-   % site_zcml
+raise IOError(site.zcml is now required to live at '%s', for  \
+  sites upgraded from Zope 2.9 please copy site.zcml  \
+  from your installed Zope's skel/etc directory \
+  % site_zcml)
 
 global _context
 _context = xmlconfig.file(site_zcml)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Products.Five/trunk/zcml.py Setup a check for zcml load_site() so check skel when unit testing is occurring.

2006-05-29 Thread Rocky Burt
Log message for revision 68373:
  Setup a check for zcml load_site() so check skel when unit testing is 
occurring.

Changed:
  U   Products.Five/trunk/zcml.py

-=-
Modified: Products.Five/trunk/zcml.py
===
--- Products.Five/trunk/zcml.py 2006-05-29 21:12:41 UTC (rev 68372)
+++ Products.Five/trunk/zcml.py 2006-05-29 21:37:09 UTC (rev 68373)
@@ -32,14 +32,22 @@
 
 # load instance site configuration file
 site_zcml = os.path.join(INSTANCE_HOME, etc, site.zcml)
-if not os.path.exists(site_zcml):
-raise IOError(site.zcml is now required to live at '%s', for  \
-  sites upgraded from Zope 2.9 please copy site.zcml  \
-  from your installed Zope's skel/etc directory \
-  % site_zcml)
+skel_site_zcml = os.path.join(INSTANCE_HOME, skel, etc, site.zcml)
+
+if os.path.exists(site_zcml):
+file = site_zcml
+elif os.path.exists(skel_site_zcml):
+# check for zope installation home skel during running unit tests
+file = skel_site_zcml
+else:
+msg = site.zcml is now required to live at '%s', for  \
+  sites upgraded from Zope 2.9 please copy site.zcml  \
+  from your installed Zope's skel/etc directory \
+  % site_zcml 
+raise IOError(msg)
 
 global _context
-_context = xmlconfig.file(site_zcml)
+_context = xmlconfig.file(file)
 
 
 def load_config(file, package=None, execute=True):

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-dev] etc/site.zcml in zope 2.10's skel?

2006-05-29 Thread Rocky Burt
Hi all,

Ever since I've been developing z3-based projects on zope 2.8+ I've been
copying Five's skel/package-includes and skel/site.zcml to my
$INSTANCE_HOME/etc so I can use zcml slugs.  Now that zope2 is gaining
more and more zope3 support I think its time we added these items to
zope 2.10's instance skel directory so each new zope 2.10 instance that
is created has those items.

Some reasons for doing this are:
  - Removes one more step for getting going with zope3 development on
zope2
  - Zope 3 developers wanting to port their apps to CMF/Plone don't have
to figure out why their zcml slugs aren't working when they just copy
them into etc/package-includes (since the instance has no site.zcml)
  - more consistent with zope3 instances


What do you all think?


- Rocky


-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
News About The Server (blog) -- http://www.serverzen.net



signature.asc
Description: This is a digitally signed message part
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-Checkins] SVN: Products.Five/trunk/formlib/pageform.pt Added appropriate @@standard_macros usage.

2006-05-28 Thread Rocky Burt
Log message for revision 68314:
  Added appropriate @@standard_macros usage.

Changed:
  U   Products.Five/trunk/formlib/pageform.pt

-=-
Modified: Products.Five/trunk/formlib/pageform.pt
===
--- Products.Five/trunk/formlib/pageform.pt 2006-05-28 15:34:06 UTC (rev 
68313)
+++ Products.Five/trunk/formlib/pageform.pt 2006-05-28 19:59:53 UTC (rev 
68314)
@@ -1,9 +1,13 @@
-html metal:define-macro=main
+html xmlns=http://www.w3.org/1999/xhtml;
+  xmlns:metal=http://xml.zope.org/namespaces/metal;
+  xmlns:tal=http://xml.zope.org/namespaces/tal;
+  xmlns:i18n=http://xml.zope.org/namespaces/i18n;
+  metal:use-macro=context/@@standard_macros/page
 head
 /head
 
 body
-div
+div metal:fill-slot=body
 
 div metal:define-macro=form
 

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Products.Five/branches/1.4/formlib/pageform.pt Added appropriate @@standard_macros usage.

2006-05-28 Thread Rocky Burt
Log message for revision 68315:
  Added appropriate @@standard_macros usage.

Changed:
  U   Products.Five/branches/1.4/formlib/pageform.pt

-=-
Modified: Products.Five/branches/1.4/formlib/pageform.pt
===
--- Products.Five/branches/1.4/formlib/pageform.pt  2006-05-28 19:59:53 UTC 
(rev 68314)
+++ Products.Five/branches/1.4/formlib/pageform.pt  2006-05-28 20:05:06 UTC 
(rev 68315)
@@ -1,9 +1,13 @@
-html metal:define-macro=main
+html xmlns=http://www.w3.org/1999/xhtml;
+  xmlns:metal=http://xml.zope.org/namespaces/metal;
+  xmlns:tal=http://xml.zope.org/namespaces/tal;
+  xmlns:i18n=http://xml.zope.org/namespaces/i18n;
+  metal:use-macro=context/@@standard_macros/page
 head
 /head
 
 body
-div
+div metal:fill-slot=body
 
 div metal:define-macro=form
 

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-dev] zope2 requests VS zope3 requests

2006-05-27 Thread Rocky Burt
Hi all,

After trying to get zope3-style locale information from a zope2 request
for another task today I discovered I had no idea what the plan was
regarding uniting these two request models in short-term or long-term
(or even if there are any plans).

I've heard rumours that ultimately the preferred manner of integration
of z2 and z3 requests was to replace the z2 ZPublisher with the z3
zope.publisher.  Perhaps those are just rumours, I have no idea.  In any
event, that would certainly be long-term.

But are we doing anything in the short-term?  My naive idea was that
perhaps we should start building FrankenHTTPRequest which extended the
original ZPublisher HTTPRequest but then also implemented
zope.publisher's IHTTPRequest interface.  This would give us a fairly
safe combination of both requests and enable more zope3 applications to
work as-is on Zope 2 (the one example that comes to mind is zope3's
formlib which requires locale information to be present on the active
request based on zope.publisher's IHTTPRequest).

To be honest I'm only throwing random ideas out here just to spark a
discussion.  Maybe you all have already figured out the appropriate game
plan.  Either way, I'd just like to know :)

- Rocky


-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
News About The Server (blog) -- http://www.serverzen.net



signature.asc
Description: This is a digitally signed message part
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-Checkins] SVN: Products.Five/trunk/ Fixed an issue where browser:page based views that didn't have template or attribute defined weren't getting BrowserView mixed in.

2006-05-25 Thread Rocky Burt
Log message for revision 68289:
  Fixed an issue where browser:page based views that didn't have template or 
attribute defined weren't getting BrowserView mixed in.

Changed:
  U   Products.Five/trunk/CHANGES.txt
  U   Products.Five/trunk/browser/metaconfigure.py
  U   Products.Five/trunk/browser/tests/pages.txt
  U   Products.Five/trunk/browser/tests/pages.zcml

-=-
Modified: Products.Five/trunk/CHANGES.txt
===
--- Products.Five/trunk/CHANGES.txt 2006-05-25 20:30:23 UTC (rev 68288)
+++ Products.Five/trunk/CHANGES.txt 2006-05-25 20:44:07 UTC (rev 68289)
@@ -8,6 +8,9 @@
 Bugfixes
 
 
+* Fixed an issue where browser:page based views that didn't have
+  template or attribute defined weren't getting BrowserView mixed in.
+
 * Fixed an issue where new-style classes could not be used for
   view components with browser:page.
 

Modified: Products.Five/trunk/browser/metaconfigure.py
===
--- Products.Five/trunk/browser/metaconfigure.py2006-05-25 20:30:23 UTC 
(rev 68288)
+++ Products.Five/trunk/browser/metaconfigure.py2006-05-25 20:44:07 UTC 
(rev 68289)
@@ -111,7 +111,8 @@
 # some security declarations on it so we really shouldn't
 # modify the original.  So, instead we make a new class
 # with just one base class -- the original
-new_class = makeClass(class_.__name__, (class_,), cdict)
+new_class = makeClass(class_.__name__, 
+  (class_, BrowserView), cdict)
 
 else:
 # template

Modified: Products.Five/trunk/browser/tests/pages.txt
===
--- Products.Five/trunk/browser/tests/pages.txt 2006-05-25 20:30:23 UTC (rev 
68288)
+++ Products.Five/trunk/browser/tests/pages.txt 2006-05-25 20:44:07 UTC (rev 
68289)
@@ -78,7 +78,15 @@
 
self.folder.unrestrictedTraverse('testoid/@@new_style_class')
   Products.Five.metaclass.NewStyleClass ...
+  
+At one point browser classes with no attribute and no template
+values specified wasn't getting BrowserView mixed in.  Lets make
+sure it is now:
 
+   self.folder.unrestrictedTraverse('testoid/@@new_style_class2')
+  Products.Five.metaclass.NewStyleClass ...
+
+
 ZPT-based browser pages
 ---
 

Modified: Products.Five/trunk/browser/tests/pages.zcml
===
--- Products.Five/trunk/browser/tests/pages.zcml2006-05-25 20:30:23 UTC 
(rev 68288)
+++ Products.Five/trunk/browser/tests/pages.zcml2006-05-25 20:44:07 UTC 
(rev 68289)
@@ -200,6 +200,14 @@
   permission=zope2.Public
   /
 
+  browser:page
+  for=Products.Five.tests.testing.simplecontent.ISimpleContent
+  class=.pages.NewStyleClass
+  name=new_style_class2
+  permission=zope2.Public
+  /
+
+
   !-- Verify that browser:view works, especially when no specific
view attribute is specified --
 

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Products.Five/branches/1.4/ - Fixed an issue where browser:page based views that didn't have template or attribute defined weren't getting BrowserView mixed in.

2006-05-25 Thread Rocky Burt
Log message for revision 68290:
  - Fixed an issue where browser:page based views that didn't have template 
or attribute defined weren't getting BrowserView mixed in.
  - Fixed an issue where new-style classes could not be used for view 
components with browser:page.

Changed:
  U   Products.Five/branches/1.4/CHANGES.txt
  U   Products.Five/branches/1.4/browser/metaconfigure.py
  U   Products.Five/branches/1.4/browser/tests/pages.txt
  U   Products.Five/branches/1.4/browser/tests/pages.zcml

-=-
Modified: Products.Five/branches/1.4/CHANGES.txt
===
--- Products.Five/branches/1.4/CHANGES.txt  2006-05-25 20:44:07 UTC (rev 
68289)
+++ Products.Five/branches/1.4/CHANGES.txt  2006-05-25 21:01:15 UTC (rev 
68290)
@@ -8,6 +8,12 @@
 Bugfixes
 
 
+* Fixed an issue where browser:page based views that didn't have
+  template or attribute defined weren't getting BrowserView mixed in.
+
+* Fixed an issue where new-style classes could not be used for
+  view components with browser:page.
+
 * Five.testbrowser does not swallow cookies anymore, based on patch by
   Daniel Nouri.
 

Modified: Products.Five/branches/1.4/browser/metaconfigure.py
===
--- Products.Five/branches/1.4/browser/metaconfigure.py 2006-05-25 20:44:07 UTC 
(rev 68289)
+++ Products.Five/branches/1.4/browser/metaconfigure.py 2006-05-25 21:01:15 UTC 
(rev 68290)
@@ -73,10 +73,6 @@
 raise ConfigurationError(No such file, template)
 
 if class_:
-# new-style classes do not work with Five. As we want to import
-# packages from z3 directly, we ignore new-style classes for now.
-if type(class_) == type:
-return
 if attribute != '__call__':
 if not hasattr(class_, attribute):
 raise ConfigurationError(
@@ -113,7 +109,8 @@
 # some security declarations on it so we really shouldn't
 # modify the original.  So, instead we make a new class
 # with just one base class -- the original
-new_class = makeClass(class_.__name__, (class_,), cdict)
+new_class = makeClass(class_.__name__, 
+  (class_, BrowserView), cdict)
 
 else:
 # template

Modified: Products.Five/branches/1.4/browser/tests/pages.txt
===
--- Products.Five/branches/1.4/browser/tests/pages.txt  2006-05-25 20:44:07 UTC 
(rev 68289)
+++ Products.Five/branches/1.4/browser/tests/pages.txt  2006-05-25 21:01:15 UTC 
(rev 68290)
@@ -74,16 +74,19 @@
view.eagle.__doc__ == SimpleView.eagle.__doc__
   True
 
-Test whether new-style classes are ignored when registering browser
-pages with view classes.  When traversing for a non-existing view, we
-should get an AttributeError:
+Make sure new-style classes work fine as view classes:
 
self.folder.unrestrictedTraverse('testoid/@@new_style_class')
-  Traceback (most recent call last):
-  ...
-  AttributeError: @@new_style_class
+  Products.Five.metaclass.NewStyleClass ...
+  
+At one point browser classes with no attribute and no template
+values specified wasn't getting BrowserView mixed in.  Lets make
+sure it is now:
 
+   self.folder.unrestrictedTraverse('testoid/@@new_style_class2')
+  Products.Five.metaclass.NewStyleClass ...
 
+
 ZPT-based browser pages
 ---
 

Modified: Products.Five/branches/1.4/browser/tests/pages.zcml
===
--- Products.Five/branches/1.4/browser/tests/pages.zcml 2006-05-25 20:44:07 UTC 
(rev 68289)
+++ Products.Five/branches/1.4/browser/tests/pages.zcml 2006-05-25 21:01:15 UTC 
(rev 68290)
@@ -190,7 +190,7 @@
   permission=zope2.Public
   /
 
-  !-- browser:page directives with new style classes are ignored --
+  !-- make sure browser:page directives with new style classes work --
 
   browser:page
   for=Products.Five.tests.testing.simplecontent.ISimpleContent
@@ -200,6 +200,14 @@
   permission=zope2.Public
   /
 
+  browser:page
+  for=Products.Five.tests.testing.simplecontent.ISimpleContent
+  class=.pages.NewStyleClass
+  name=new_style_class2
+  permission=zope2.Public
+  /
+
+
   !-- Verify that browser:view works, especially when no specific
view attribute is specified --
 

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Products.Five/branches/1.3/ - Fixed an issue where browser:page based views that didn't have template or attribute defined weren't getting BrowserView mixed in.

2006-05-25 Thread Rocky Burt
Log message for revision 68291:
  - Fixed an issue where browser:page based views that didn't have template 
or attribute defined weren't getting BrowserView mixed in.
  - Fixed an issue where new-style classes could not be used for view 
components with browser:page.

Changed:
  U   Products.Five/branches/1.3/CHANGES.txt
  U   Products.Five/branches/1.3/browser/metaconfigure.py
  U   Products.Five/branches/1.3/browser/tests/pages.txt
  U   Products.Five/branches/1.3/browser/tests/pages.zcml

-=-
Modified: Products.Five/branches/1.3/CHANGES.txt
===
--- Products.Five/branches/1.3/CHANGES.txt  2006-05-25 21:01:15 UTC (rev 
68290)
+++ Products.Five/branches/1.3/CHANGES.txt  2006-05-25 21:07:29 UTC (rev 
68291)
@@ -2,6 +2,18 @@
 Five Changes
 
 
+Five 1.3.x (unreleased)
+===
+
+Bugfixes
+
+
+* Fixed an issue where browser:page based views that didn't have
+  template or attribute defined weren't getting BrowserView mixed in.
+
+* Fixed an issue where new-style classes could not be used for
+  view components with browser:page.
+
 Five 1.3.5 (2006-05-04)
 ===
 

Modified: Products.Five/branches/1.3/browser/metaconfigure.py
===
--- Products.Five/branches/1.3/browser/metaconfigure.py 2006-05-25 21:01:15 UTC 
(rev 68290)
+++ Products.Five/branches/1.3/browser/metaconfigure.py 2006-05-25 21:07:29 UTC 
(rev 68291)
@@ -73,10 +73,6 @@
 raise ConfigurationError(No such file, template)
 
 if class_:
-# new-style classes do not work with Five. As we want to import
-# packages from z3 directly, we ignore new-style classes for now.
-if type(class_) == type:
-return
 if attribute != '__call__':
 if not hasattr(class_, attribute):
 raise ConfigurationError(
@@ -113,7 +109,8 @@
 # some security declarations on it so we really shouldn't
 # modify the original.  So, instead we make a new class
 # with just one base class -- the original
-new_class = makeClass(class_.__name__, (class_,), cdict)
+new_class = makeClass(class_.__name__, 
+  (class_, BrowserView), cdict)
 
 else:
 # template

Modified: Products.Five/branches/1.3/browser/tests/pages.txt
===
--- Products.Five/branches/1.3/browser/tests/pages.txt  2006-05-25 21:01:15 UTC 
(rev 68290)
+++ Products.Five/branches/1.3/browser/tests/pages.txt  2006-05-25 21:07:29 UTC 
(rev 68291)
@@ -74,16 +74,19 @@
view.eagle.__doc__ == SimpleView.eagle.__doc__
   True
 
-Test whether new-style classes are ignored when registering browser
-pages with view classes.  When traversing for a non-existing view, we
-should get an AttributeError:
+Make sure new-style classes work fine as view classes:
 
self.folder.unrestrictedTraverse('testoid/@@new_style_class')
-  Traceback (most recent call last):
-  ...
-  AttributeError: @@new_style_class
+  Products.Five.metaclass.NewStyleClass ...
+  
+At one point browser classes with no attribute and no template
+values specified wasn't getting BrowserView mixed in.  Lets make
+sure it is now:
 
+   self.folder.unrestrictedTraverse('testoid/@@new_style_class2')
+  Products.Five.metaclass.NewStyleClass ...
 
+
 ZPT-based browser pages
 ---
 

Modified: Products.Five/branches/1.3/browser/tests/pages.zcml
===
--- Products.Five/branches/1.3/browser/tests/pages.zcml 2006-05-25 21:01:15 UTC 
(rev 68290)
+++ Products.Five/branches/1.3/browser/tests/pages.zcml 2006-05-25 21:07:29 UTC 
(rev 68291)
@@ -190,7 +190,7 @@
   permission=zope2.Public
   /
 
-  !-- browser:page directives with new style classes are ignored --
+  !-- make sure browser:page directives with new style classes work --
 
   browser:page
   for=Products.Five.tests.testing.simplecontent.ISimpleContent
@@ -200,6 +200,14 @@
   permission=zope2.Public
   /
 
+  browser:page
+  for=Products.Five.tests.testing.simplecontent.ISimpleContent
+  class=.pages.NewStyleClass
+  name=new_style_class2
+  permission=zope2.Public
+  /
+
+
   !-- Verify that browser:view works, especially when no specific
view attribute is specified --
 

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Products.Five/branches/1.2/ - Fixed an issue where browser:page based views that didn't have template or attribute defined weren't getting BrowserView mixed in.

2006-05-25 Thread Rocky Burt
Log message for revision 68292:
  - Fixed an issue where browser:page based views that didn't have template 
or attribute defined weren't getting BrowserView mixed in.
  - Fixed an issue where new-style classes could not be used for view 
components with browser:page.

Changed:
  U   Products.Five/branches/1.2/CHANGES.txt
  U   Products.Five/branches/1.2/browser/metaconfigure.py
  U   Products.Five/branches/1.2/browser/tests/pages.txt
  U   Products.Five/branches/1.2/browser/tests/pages.zcml

-=-
Modified: Products.Five/branches/1.2/CHANGES.txt
===
--- Products.Five/branches/1.2/CHANGES.txt  2006-05-25 21:07:29 UTC (rev 
68291)
+++ Products.Five/branches/1.2/CHANGES.txt  2006-05-25 21:10:12 UTC (rev 
68292)
@@ -2,6 +2,18 @@
 Five Changes
 
 
+Five 1.2.x (unreleased)
+===
+
+Bugfixes
+
+
+* Fixed an issue where browser:page based views that didn't have
+  template or attribute defined weren't getting BrowserView mixed in.
+
+* Fixed an issue where new-style classes could not be used for
+  view components with browser:page.
+
 Five 1.2.4 (2006-05-04)
 ===
 

Modified: Products.Five/branches/1.2/browser/metaconfigure.py
===
--- Products.Five/branches/1.2/browser/metaconfigure.py 2006-05-25 21:07:29 UTC 
(rev 68291)
+++ Products.Five/branches/1.2/browser/metaconfigure.py 2006-05-25 21:10:12 UTC 
(rev 68292)
@@ -77,10 +77,6 @@
 raise ConfigurationError(No such file, template)
 
 if class_:
-# new-style classes do not work with Five. As we want to import
-# packages from z3 directly, we ignore new-style classes for now.
-if type(class_) == type:
-return
 if attribute != '__call__':
 if not hasattr(class_, attribute):
 raise ConfigurationError(
@@ -116,7 +112,8 @@
 # some security declarations on it so we really shouldn't
 # modify the original.  So, instead we make a new class
 # with just one base class -- the original
-new_class = makeClass(class_.__name__, (class_,), cdict)
+new_class = makeClass(class_.__name__, 
+  (class_, BrowserView), cdict)
 
 else:
 # template

Modified: Products.Five/branches/1.2/browser/tests/pages.txt
===
--- Products.Five/branches/1.2/browser/tests/pages.txt  2006-05-25 21:07:29 UTC 
(rev 68291)
+++ Products.Five/branches/1.2/browser/tests/pages.txt  2006-05-25 21:10:12 UTC 
(rev 68292)
@@ -74,16 +74,19 @@
view.eagle.__doc__ == SimpleView.eagle.__doc__
   True
 
-Test whether new-style classes are ignored when registering browser
-pages with view classes.  When traversing for a non-existing view, we
-should get an AttributeError:
+Make sure new-style classes work fine as view classes:
 
self.folder.unrestrictedTraverse('testoid/@@new_style_class')
-  Traceback (most recent call last):
-  ...
-  AttributeError: @@new_style_class
+  Products.Five.metaclass.NewStyleClass ...
+  
+At one point browser classes with no attribute and no template
+values specified wasn't getting BrowserView mixed in.  Lets make
+sure it is now:
 
+   self.folder.unrestrictedTraverse('testoid/@@new_style_class2')
+  Products.Five.metaclass.NewStyleClass ...
 
+
 ZPT-based browser pages
 ---
 

Modified: Products.Five/branches/1.2/browser/tests/pages.zcml
===
--- Products.Five/branches/1.2/browser/tests/pages.zcml 2006-05-25 21:07:29 UTC 
(rev 68291)
+++ Products.Five/branches/1.2/browser/tests/pages.zcml 2006-05-25 21:10:12 UTC 
(rev 68292)
@@ -183,7 +183,7 @@
   permission=zope2.Public
   /
 
-  !-- browser:page directives with new style classes are ignored --
+  !-- make sure browser:page directives with new style classes work --
 
   browser:page
   for=Products.Five.tests.testing.simplecontent.ISimpleContent
@@ -193,6 +193,14 @@
   permission=zope2.Public
   /
 
+  browser:page
+  for=Products.Five.tests.testing.simplecontent.ISimpleContent
+  class=.pages.NewStyleClass
+  name=new_style_class2
+  permission=zope2.Public
+  /
+
+
   !-- Verify that browser:view works, especially when no specific
view attribute is specified --
 

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/trunk/lib/python/App/FactoryDispatcher.py Now closing manually opened zodb connections -- thanks Stefan

2006-05-04 Thread Rocky Burt
Log message for revision 67964:
  Now closing manually opened zodb connections -- thanks Stefan

Changed:
  U   Zope/trunk/lib/python/App/FactoryDispatcher.py

-=-
Modified: Zope/trunk/lib/python/App/FactoryDispatcher.py
===
--- Zope/trunk/lib/python/App/FactoryDispatcher.py  2006-05-04 13:44:32 UTC 
(rev 67963)
+++ Zope/trunk/lib/python/App/FactoryDispatcher.py  2006-05-04 15:35:44 UTC 
(rev 67964)
@@ -33,13 +33,18 @@
 old_product_packages[x] = m
 
 packages = {}
-products = Zope2.app().Control_Panel.Products
-for product_id in products.objectIds():
-product = products[product_id]
-if hasattr(product, 'package_name'):
-packages[product_id] = __import__(product.package_name)
-elif old_product_packages.has_key(product_id):
-packages[product_id] = old_product_packages[product_id]
+app = Zope2.app()
+try:
+products = app.Control_Panel.Products
+
+for product_id in products.objectIds():
+product = products[product_id]
+if hasattr(product, 'package_name'):
+packages[product_id] = __import__(product.package_name)
+elif old_product_packages.has_key(product_id):
+packages[product_id] = old_product_packages[product_id]
+finally:
+app._p_jar.close()
 
 return packages
 

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Products.Five/trunk/ Fixed up an issue where an open zodb connection wasn't geting closed properly ... also reinstated a previously-failing (but no longer) test now that the zodb

2006-05-04 Thread Rocky Burt
Log message for revision 67968:
  Fixed up an issue where an open zodb connection wasn't geting closed properly 
... also reinstated a previously-failing (but no longer) test now that the zodb 
connection handling is working properly.

Changed:
  U   Products.Five/trunk/fiveconfigure.py
  U   Products.Five/trunk/tests/test_registerpackage.py

-=-
Modified: Products.Five/trunk/fiveconfigure.py
===
--- Products.Five/trunk/fiveconfigure.py2006-05-04 17:17:04 UTC (rev 
67967)
+++ Products.Five/trunk/fiveconfigure.py2006-05-04 18:20:34 UTC (rev 
67968)
@@ -211,18 +211,24 @@
  package must be filesystem based)
 
 app = Zope2.app()
-product = initializeProduct(module_, 
-module_.__name__, 
-module_.__path__[0],
-app)
+try:
+product = initializeProduct(module_, 
+module_.__name__, 
+module_.__path__[0],
+app)
 
-product.package_name = module_.__name__
+product.package_name = module_.__name__
 
-if init_func is not None:
-newContext = ProductContext(product, app, module_)
-init_func(newContext)
+if init_func is not None:
+newContext = ProductContext(product, app, module_)
+init_func(newContext)
+finally:
+try:
+import transaction
+transaction.commit()
+finally:
+app._p_jar.close()
 
-
 def registerPackage(_context, package, initialize=None):
 ZCML directive function for registering a python package product
 

Modified: Products.Five/trunk/tests/test_registerpackage.py
===
--- Products.Five/trunk/tests/test_registerpackage.py   2006-05-04 17:17:04 UTC 
(rev 67967)
+++ Products.Five/trunk/tests/test_registerpackage.py   2006-05-04 18:20:34 UTC 
(rev 67968)
@@ -50,7 +50,22 @@
   ... /configure'''
zcml.load_string(configure_zcml)
   pythonproduct2 initialized
+
   
+Test to see if the pythonproduct2 python package actually gets setup
+as a zope2 product in the Control Panel.
+
+   product_listing = []
+   import Zope2
+   app = Zope2.app()
+   try:
+  ...product_listing = app.Control_Panel.Products.objectIds()
+  ... finally:
+  ... app._p_jar.close()
+   'pythonproduct2' in product_listing
+  True
+
+
 Clean up:
 
tearDown()

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-dev] Re: [Checkins] SVN: Zope/trunk/lib/python/App/FactoryDispatcher.py External methods can now live outside of Products based python packages.

2006-05-04 Thread Rocky Burt
On Thu, 2006-04-05 at 10:43 +0200, Stefan H. Holek wrote:
 Note that Zope2.app() opens a new ZODB connection which you need to  
 close at some point. I suggest something along the lines of:
 
   app = Zope2.app()
  try:
   products = app.Control_Panel.Products
   ...
   finally:
   app._p_jar.close()
 
 I am also wondering if this code would break if a product was removed  
 from the file system, but still had its persistent part hanging  
 around in Control_Panel.Products.

Hmm... good points, I'll look into this.


- Rocky



 On 2. Mai 2006, at 22:59, Rocky Burt wrote:
 
  Log message for revision 67869:
External methods can now live outside of Products based python  
  packages.
 
  Changed:
U   Zope/trunk/lib/python/App/FactoryDispatcher.py
 
  -=-
  Modified: Zope/trunk/lib/python/App/FactoryDispatcher.py
  ===
  --- Zope/trunk/lib/python/App/FactoryDispatcher.py  2006-05-02  
  20:57:53 UTC (rev 67868)
  +++ Zope/trunk/lib/python/App/FactoryDispatcher.py  2006-05-02  
  20:59:07 UTC (rev 67869)
  @@ -13,12 +13,36 @@
 
 
   # Implement the manage_addProduct method of object managers
  +import types
   import Acquisition, sys, Products
   from Globals import InitializeClass
   from AccessControl import ClassSecurityInfo
   from AccessControl.PermissionMapping import aqwrap
   from AccessControl.Owned import UnownableOwner
  +import Zope2
 
  +def _product_packages():
  +Returns all product packages including the regularly defined
  +zope2 packages and those without the Products namespace package.
  +
  +
  +old_product_packages = {}
  +for x in dir(Products):
  +m = getattr(Products, x)
  +if isinstance(m, types.ModuleType):
  +old_product_packages[x] = m
  +
  +packages = {}
  +products = Zope2.app().Control_Panel.Products
  +for product_id in products.objectIds():
  +product = products[product_id]
  +if hasattr(product, 'package_name'):
  +packages[product_id] = __import__(product.package_name)
  +elif old_product_packages.has_key(product_id):
  +packages[product_id] = old_product_packages[product_id]
  +
  +return packages
  +
   class ProductDispatcher(Acquisition.Implicit):

   # Allow access to factory dispatchers
  @@ -32,7 +56,7 @@
 
   # Try to get a custom dispatcher from a Python product
   dispatcher_class=getattr(
  -getattr(Products, name, None),
  +_product_packages().get(name, None),
   '__FactoryDispatcher__',
   FactoryDispatcher)
 
 
  ___
  Checkins mailing list
  [EMAIL PROTECTED]
  http://mail.zope.org/mailman/listinfo/checkins
 
 --
 Anything that happens, happens.  --Douglas Adams
 
 
 ___
 Zope-Dev maillist  -  Zope-Dev@zope.org
 http://mail.zope.org/mailman/listinfo/zope-dev
 **  No cross posts or HTML encoding!  **
 (Related lists - 
  http://mail.zope.org/mailman/listinfo/zope-announce
  http://mail.zope.org/mailman/listinfo/zope )
 
-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
News About The Server -- http://www.serverzen.net


___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: [Checkins] SVN: Zope/trunk/lib/python/App/FactoryDispatcher.py External methods can now live outside of Products based python packages.

2006-05-04 Thread Rocky Burt
On Thu, 2006-04-05 at 08:23 -0230, Rocky Burt wrote:
 On Thu, 2006-04-05 at 10:43 +0200, Stefan H. Holek wrote:
  Note that Zope2.app() opens a new ZODB connection which you need to  
  close at some point. I suggest something along the lines of:
  
  app = Zope2.app()
   try:
  products = app.Control_Panel.Products
  ...
  finally:
  app._p_jar.close()
  
  I am also wondering if this code would break if a product was removed  
  from the file system, but still had its persistent part hanging  
  around in Control_Panel.Products.
 
 Hmm... good points, I'll look into this.

Actually, this brings up something I've been wondering about.  Everytime
I call Zope2.app() inside a test case it gives me a new obj with a reset
Control_Panel.  Am I doing something wrong here?  Perhaps there's a
better way to go about this?

- Rocky



-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
News About The Server -- http://www.serverzen.net


___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-Checkins] SVN: Products.Five/trunk/tests/test_registerpackage.py Zope2.app() isn't behaving properly in tests ... will have to track this down further.

2006-05-03 Thread Rocky Burt
Log message for revision 67942:
  Zope2.app() isn't behaving properly in tests ... will have to track this down 
further.

Changed:
  U   Products.Five/trunk/tests/test_registerpackage.py

-=-
Modified: Products.Five/trunk/tests/test_registerpackage.py
===
--- Products.Five/trunk/tests/test_registerpackage.py   2006-05-03 22:38:44 UTC 
(rev 67941)
+++ Products.Five/trunk/tests/test_registerpackage.py   2006-05-03 22:50:37 UTC 
(rev 67942)
@@ -35,25 +35,6 @@
from Products.Five import zcml
zcml.load_config('meta.zcml', Products.Five)
 
-Make sure a python package with no initialize (even though one
-is specified) will fail::
-
-   configure_zcml = '''
-  ... configure
-  ... xmlns=http://namespaces.zope.org/zope;
-  ... xmlns:five=http://namespaces.zope.org/five;
-  ... i18n_domain=foo
-  ...   five:registerPackage
-  ...   package=pythonproduct1
-  ...   initialize=pythonproduct1.initialize
-  ...   /
-  ... /configure'''
-   zcml.load_string(configure_zcml)
-  Traceback (most recent call last):
-  ...
-  ZopeXMLConfigurationError: ...
-  ConfigurationError: ('...pythonproduct1 has no global initialize')
-
 Make sure a python package with a valid initialize gets its
 initialize function called::
 
@@ -70,13 +51,6 @@
zcml.load_string(configure_zcml)
   pythonproduct2 initialized
   
-Test to see if the pythonproduct2 python package actually gets setup
-as a zope2 product in the Control Panel.
-
-   product_listing = app.Control_Panel.Products.objectIds()
-   'pythonproduct2' in product_listing
-  True
-
 Clean up:
 
tearDown()
@@ -84,8 +58,10 @@
 
 
 def test_suite():
-from Testing.ZopeTestCase import ZopeDocTestSuite
-return ZopeDocTestSuite()
+from zope.testing.doctest import DocTestSuite
+return DocTestSuite()
+#from Testing.ZopeTestCase import ZopeDocTestSuite
+#return ZopeDocTestSuite()
 
 if __name__ == '__main__':
 framework()

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/trunk/lib/python/App/Extensions.py ProductDispatcher's __bobo_traverse__ now checks all products registered in Control_Panel.Products rather than simply checking the python P

2006-05-02 Thread Rocky Burt
Log message for revision 67868:
  ProductDispatcher's __bobo_traverse__ now checks all products registered in 
Control_Panel.Products rather than simply checking the python Products 
namespace package.

Changed:
  U   Zope/trunk/lib/python/App/Extensions.py

-=-
Modified: Zope/trunk/lib/python/App/Extensions.py
===
--- Zope/trunk/lib/python/App/Extensions.py 2006-05-02 20:44:47 UTC (rev 
67867)
+++ Zope/trunk/lib/python/App/Extensions.py 2006-05-02 20:57:53 UTC (rev 
67868)
@@ -78,6 +78,7 @@
 if d: raise ValueError, (
 'The file name, %s, should be a simple file name' % name)
 
+result = None
 if checkProduct:
 l = name.find('.')
 if l  0:
@@ -85,15 +86,39 @@
 n = name[l + 1:]
 for product_dir in Products.__path__:
 r = _getPath(product_dir, os.path.join(p, prefix), n, suffixes)
-if r is not None: return r
+if r is not None: result = r
 
-import App.config
-cfg = App.config.getConfiguration()
-sw=os.path.dirname(os.path.dirname(cfg.softwarehome))
-for home in (cfg.instancehome, sw):
-r=_getPath(home, prefix, name, suffixes)
-if r is not None: return r
+if result is None:
+import App.config
+cfg = App.config.getConfiguration()
+sw=os.path.dirname(os.path.dirname(cfg.softwarehome))
+for home in (cfg.instancehome, sw):
+r=_getPath(home, prefix, name, suffixes)
+if r is not None: result = r
 
+if result is None:
+try:
+l = name.find('.')
+if l  0:
+realName = name[l + 1:]
+toplevel = name[:l]
+
+m = __import__(toplevel)
+
+d = os.path.join(m.__path__[0], prefix, realName)
+
+for s in suffixes:
+if s: s=%s.%s % (d, s)
+else: s=d
+if os.path.exists(s): 
+result = s
+break
+except:
+pass
+
+
+return result
+
 def getObject(module, name, reload=0,
   # The use of a mutable default is intentional here,
   # because modules is a module cache.

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/trunk/lib/python/App/FactoryDispatcher.py External methods can now live outside of Products based python packages.

2006-05-02 Thread Rocky Burt
Log message for revision 67869:
  External methods can now live outside of Products based python packages.

Changed:
  U   Zope/trunk/lib/python/App/FactoryDispatcher.py

-=-
Modified: Zope/trunk/lib/python/App/FactoryDispatcher.py
===
--- Zope/trunk/lib/python/App/FactoryDispatcher.py  2006-05-02 20:57:53 UTC 
(rev 67868)
+++ Zope/trunk/lib/python/App/FactoryDispatcher.py  2006-05-02 20:59:07 UTC 
(rev 67869)
@@ -13,12 +13,36 @@
 
 
 # Implement the manage_addProduct method of object managers
+import types
 import Acquisition, sys, Products
 from Globals import InitializeClass
 from AccessControl import ClassSecurityInfo
 from AccessControl.PermissionMapping import aqwrap
 from AccessControl.Owned import UnownableOwner
+import Zope2
 
+def _product_packages():
+Returns all product packages including the regularly defined
+zope2 packages and those without the Products namespace package.
+
+
+old_product_packages = {}
+for x in dir(Products):
+m = getattr(Products, x)
+if isinstance(m, types.ModuleType):
+old_product_packages[x] = m
+
+packages = {}
+products = Zope2.app().Control_Panel.Products
+for product_id in products.objectIds():
+product = products[product_id]
+if hasattr(product, 'package_name'):
+packages[product_id] = __import__(product.package_name)
+elif old_product_packages.has_key(product_id):
+packages[product_id] = old_product_packages[product_id]
+
+return packages
+
 class ProductDispatcher(Acquisition.Implicit):
  
 # Allow access to factory dispatchers
@@ -32,7 +56,7 @@
 
 # Try to get a custom dispatcher from a Python product
 dispatcher_class=getattr(
-getattr(Products, name, None),
+_product_packages().get(name, None),
 '__FactoryDispatcher__',
 FactoryDispatcher)
 

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Products.Five/trunk/ Enabled ability to declare a regular python package as an official Zope2 product via zcml five:registerPackage.

2006-05-02 Thread Rocky Burt
Log message for revision 67874:
  Enabled ability to declare a regular python package as an official Zope2 
product via zcml five:registerPackage.

Changed:
  U   Products.Five/trunk/fiveconfigure.py
  U   Products.Five/trunk/fivedirectives.py
  U   Products.Five/trunk/meta.zcml
  A   Products.Five/trunk/tests/test_registerpackage.py
  A   Products.Five/trunk/tests/testing/pythonproduct1.py
  A   Products.Five/trunk/tests/testing/pythonproduct2/
  A   Products.Five/trunk/tests/testing/pythonproduct2/Extensions/
  A   Products.Five/trunk/tests/testing/pythonproduct2/Extensions/__init__.py
  A   Products.Five/trunk/tests/testing/pythonproduct2/Extensions/somemodule.py
  A   Products.Five/trunk/tests/testing/pythonproduct2/__init__.py

-=-
Modified: Products.Five/trunk/fiveconfigure.py
===
--- Products.Five/trunk/fiveconfigure.py2006-05-02 22:48:25 UTC (rev 
67873)
+++ Products.Five/trunk/fiveconfigure.py2006-05-02 23:22:01 UTC (rev 
67874)
@@ -24,7 +24,10 @@
 import logging
 
 import App.config
+from App.Product import initializeProduct
+from App.ProductContext import ProductContext
 import Products
+import Zope2
 
 from zope.interface import classImplements, classImplementsOnly, implementedBy
 from zope.interface.interface import InterfaceClass
@@ -199,6 +202,37 @@
 args = (class_, meta_type, permission, addview, icon, global_)
 )
 
+def _registerPackage(module_, init_func=None):
+Registers the given python package as a Zope 2 style product
+
+
+if not hasattr(module_, '__path__'):
+raise ValueError(Must be a package and the  \
+ package must be filesystem based)
+
+app = Zope2.app()
+product = initializeProduct(module_, 
+module_.__name__, 
+module_.__path__[0],
+app)
+
+product.package_name = module_.__name__
+
+if init_func is not None:
+newContext = ProductContext(product, app, module_)
+init_func(newContext)
+
+
+def registerPackage(_context, package, initialize=None):
+ZCML directive function for registering a python package product
+
+
+_context.action(
+discriminator = ('registerPackage', package),
+callable = _registerPackage,
+args = (package,initialize)
+)
+
 # clean up code
 
 def killMonkey(class_, name, fallback, attr=None):

Modified: Products.Five/trunk/fivedirectives.py
===
--- Products.Five/trunk/fivedirectives.py   2006-05-02 22:48:25 UTC (rev 
67873)
+++ Products.Five/trunk/fivedirectives.py   2006-05-02 23:22:01 UTC (rev 
67874)
@@ -170,6 +170,8 @@
 required=False
 )
 
+
+
 class IInclude(Interface):
 
 file = BytesLine(
@@ -178,3 +180,20 @@
 u'installed Product. If the file does not exist, for a '
 u'particular product, no error is raised.',
 required=False)
+
+class IRegisterPackageDirective(Interface):
+Registers the given python package which at a minimum fools zope2 into
+thinking of it as a zope2 product.
+
+
+package = GlobalObject(
+title=u'Target package',
+required=True
+)
+
+initialize = GlobalObject(
+title=u'Initialization function to invoke',
+description=u'The dotted name of a function that will get invoked '
+u'with a ProductContext instance',
+required=False
+)

Modified: Products.Five/trunk/meta.zcml
===
--- Products.Five/trunk/meta.zcml   2006-05-02 22:48:25 UTC (rev 67873)
+++ Products.Five/trunk/meta.zcml   2006-05-02 23:22:01 UTC (rev 67874)
@@ -160,6 +160,12 @@
handler=.fiveconfigure.registerClass
/
 
+meta:directive
+   name=registerPackage
+   schema=.fivedirectives.IRegisterPackageDirective
+   handler=.fiveconfigure.registerPackage
+   /
+
   /meta:directives
 
 /configure

Added: Products.Five/trunk/tests/test_registerpackage.py
===
--- Products.Five/trunk/tests/test_registerpackage.py   2006-05-02 22:48:25 UTC 
(rev 67873)
+++ Products.Five/trunk/tests/test_registerpackage.py   2006-05-02 23:22:01 UTC 
(rev 67874)
@@ -0,0 +1,91 @@
+##
+#
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED AS IS AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, 

[Zope-dev] Re: Branches finished for merging.

2006-04-29 Thread Rocky Burt
On Sat, 2006-29-04 at 13:21 +0200, Laurence Rowe wrote:
 Lennart Regebro wrote:
  Do we want to include optional twisted in 2.10 too? It works now, for 
  http. :-)
  Haven't tried the ftp yet, but if I finish it until tomorrow?
 
 If it is optional (and not default) I don't see why not, it'll make it 
 easier to test with real sites to give it some battle hardening.

+1 from me (being optional and not default of course)


- Rocky


-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
News About The Server -- http://www.serverzen.net


___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: Zope 2.10: Remaining tasks

2006-04-28 Thread Rocky Burt
On Thu, 2006-27-04 at 13:08 -0400, Jim Fulton wrote:
 Philipp von Weitershausen wrote:
 It would be helpful if the authors of the branches listed on:
 
http://www.zope.org/Wikis/DevSite/Projects/Zope2.10/Tasks
 
 would update the page by either deleting their branch or giving
 a realistic estimate of when it will be ready.  It's
 a good idea to be conservative.  The next release after this one
 is not very far away (November).

My changes are quite small (a couple small changes to some
methods/functions that assume all products come from the Products
namespace package).  But I do not have permission to edit that wiki page
(my username is 'rocky').

- Rocky


-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
News About The Server -- http://www.serverzen.net


___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/ Updated svn:externals to include more recent Five version since zope 2.10 will require Five 1.5.

2006-04-23 Thread Rocky Burt
Log message for revision 67558:
  Updated svn:externals to include more recent Five version since zope 2.10 
will require Five 1.5.

Changed:
  _U  Zope/trunk/lib/python/Products/

-=-

Property changes on: Zope/trunk/lib/python/Products
___
Name: svn:externals
   - Five svn://svn.zope.org/repos/main/Products.Five/tags/1.3.3

   + # updated to get a more recent working Five snapshot (what will be Five 1.5
# and actually included with Zope 2.10

Five -r67270 svn://svn.zope.org/repos/main/Products.Five/trunk


___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-dev] [ANN] pythonproducts 1.0beta1 released

2006-04-23 Thread Rocky Burt
I'm pleased to announce the first beta release of pythonproducts.

pythonproducts
==

Description
  A mechanism to construct Zope 2 products as regular python 
  packages.  This enables a python package to be deployed as a 
  Zope 2 product using a similar strategy as Zope 3.

Author/Maintainer
  `Rocky Burt [EMAIL PROTECTED]`__

Latest Release
  `1.0beta1
http://dev.serverzen.com/site/projects/pythonproducts/releases/pythonproducts-1-0beta1-tar.gz/download`__

License
  BSD-style, see LICENSE.txt for details

Source Control
  http://codespeak.net/svn/z3/pythonproducts/
 
Requirements
  - Python 2.3.5 or higher in 2.3.x series
  - Zope 2.8 or 2.9
  - Five 1.2 or higher

Installing
  Uses regular python distutils for installation.  Simply run::
  
python ./setup.py install --home /some/path/to/zope_instance_home

Usage
  Once pythonproducts has been installed, the standard practise of
installing
  a python package as a Zope 2 product is as follows:
  
1. edit (or create it if it doesn't exist already) 
   ``$YOUR_PKG_SOURCE/configure.zcml`` and add the line 
   ``five:registerPackage package=. initialize=.initialize /``
2. copy your python package to ``$INSTANCE_HOME/lib/python``
3. create a ZCML slug by creating the file 
   ``
$INSTANCE_HOME/etc/package-includes/yourpackage-configure.zcml`` and
   populating it with ``configure package=yourpackage /``

Explanation of Usage
  Step 1: Your python package needs to register itself as a 
  Zope 2 product.  This is accomplished by using the new  
  ``registerPackage`` directive.  This directive takes 
  a (required) package attribute which declares any python
  package as a Zope 2 product (with . meaning this package).  Another
  (optional) attribute is the 'initialize' attribute.  If this   
  attribute is defined, a function with that name will be invoked in 
  a traditional Zope 2 style with a ProductContext instance as the 
  sole argument.
  
  Step 2: Your python package needs to exist *somewhere* on 
  PYTHONPATH.  With Zope 2.8, $INSTANCE_HOME/lib/python is added to 
  the PYTHONPATH so copying your python package there ensures its
  somewhere in PYTHONPATH.  But really your python package could be
  copied to any directory that exists on PYTHONPATH
  (ie /usr/lib/python2.3/site-packages).
  
  Step 3: The standard way of registering a package with Zope 3 is 
  to create a ZCML slug in the $INSTANCE_HOME/etc/package-includes 
  directory.  This file can be called anything as long as it ends with
  -configure.zcml.


Regards,
Rocky

-- 
Rocky Burt
AdaptiveWave - Content Management as a Service
http://www.adaptivewave.com
Content Management Made Simple


___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: Re: Re: cvs.zope.org/Products - svn.zope.org?

2006-04-23 Thread Rocky Burt
Great, thanks for doing this Jens!

- Rocky


On Sun, 2006-23-04 at 12:41 +0100, Jens Vagelpohl wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 All done, please take a quick look at...
 
 http://svn.zope.org/Products.Basket/
 
 http://svn.zope.org/Products.ExternalEditor/
 
 to ensure everything is OK. Then I will cvs rm the packages in CVS  
 and add a suitable log entry to tell people where things are.
 
 jens
 
 
 On 23 Apr 2006, at 12:10, Chris McDonough wrote:
 
  Sorry, I wasn't paying attention here.
 
  Moving these things is fine by me, I just currently don't have the  
  time to expend any effort on it.  If somebody wants to do it,  
  great, and just let me know where it ends up.
 
  I'll note that Basket should really just die in favor of something  
  going in to Zope 2 proper.
 
  - C
 
  On Apr 22, 2006, at 1:02 PM, Rocky Burt wrote:
 
  Will do.
 
  - Rocky
 
  On Thu, 2006-20-04 at 21:12 +0100, Jens Vagelpohl wrote:
  -BEGIN PGP SIGNED MESSAGE-
  Hash: SHA1
 
  Rocky, since this whole issue seems to have petered out, if you want
  to follow up with the respective product authors and have them
  contact me I'll get them moved. I just don't want to do that without
  having a consensus first.
 
  jens
 
 
  On 18 Apr 2006, at 11:44, Rocky Burt wrote:
 
  As a Plone developer my favourite two products I'd like to see  
  moved
  would be:
1) ExternalEditor
2) Basket
 
  'course I've had the discussion with chrism in the past about  
  moving
  Basket over...  Chris, what do you think?
 
  - Rocky
 
 
  On Tue, 2006-18-04 at 09:35 +0200, Jens Vagelpohl wrote:
  -BEGIN PGP SIGNED MESSAGE-
  Hash: SHA1
 
 
  On 18 Apr 2006, at 08:30, Andreas Jung wrote:
 
 
 
  --On 17. April 2006 16:25:10 +0200 Jens Vagelpohl
  [EMAIL PROTECTED] wrote:
  Wouldn't it make sense to migrate the complete Products  
  hierarchy
  from cvs.zope.org to svn.zope.org?
 
  - -1 on migrating everything.
 
  IMHO it would be better to identify those dependencies and
  selectively
  migrate products as needed. I'd volunteer to do the   
  migrations, I
  have a
  well-working test harness and migration scripts  for that  
  purpose
  on the
  cvs.zope.org box.
 
 
  We must distinguish between major community projects and private/
  commercial projects. If you want to support both we might end up
  having most of the stuff on svn.zope.org as well...
 
  Have you looked at what's inside the Products folder on  
  cvs.zope.org?
  The important bits are already moved to SVN and then there's a  
  whole
  lot of old unmaintained stuff. Now that I looked at what's in  
  there I
  am even more against a wholesale move.
 
  I'm assuming the reason you started this discussion is because you
  had to fish something out of CVS. We could start by you  
  identifying
  what that was.
 
  jens
 
 
  -BEGIN PGP SIGNATURE-
  Version: GnuPG v1.4.1 (Darwin)
 
  iD8DBQFERJbSRAx5nvEhZLIRAslrAJ4kDbIRw1/5l+yyc6j4x0fuWTCvYACdFISH
  ORbGazbvlNa7OEdGvWFIByE=
  =ribv
  -END PGP SIGNATURE-
  ___
  Zope-Dev maillist  -  Zope-Dev@zope.org
  http://mail.zope.org/mailman/listinfo/zope-dev
  **  No cross posts or HTML encoding!  **
  (Related lists -
   http://mail.zope.org/mailman/listinfo/zope-announce
   http://mail.zope.org/mailman/listinfo/zope )
 
  -- 
  Rocky Burt
  AdaptiveWave - Content Management as a Service
  http://www.adaptivewave.com
  Content Management Made Simple
 
 
  ___
  Zope-Dev maillist  -  Zope-Dev@zope.org
  http://mail.zope.org/mailman/listinfo/zope-dev
  **  No cross posts or HTML encoding!  **
  (Related lists -
   http://mail.zope.org/mailman/listinfo/zope-announce
   http://mail.zope.org/mailman/listinfo/zope )
 
  -BEGIN PGP SIGNATURE-
  Version: GnuPG v1.4.1 (Darwin)
 
  iD8DBQFER+s5RAx5nvEhZLIRAopsAKCjtGP4GlDkwsKJvec8OBJhMfkEdgCdHFnB
  ZSF1NyFxDZNGgRQ1yra5UR8=
  =lP+F
  -END PGP SIGNATURE-
  ___
  Zope-Dev maillist  -  Zope-Dev@zope.org
  http://mail.zope.org/mailman/listinfo/zope-dev
  **  No cross posts or HTML encoding!  **
  (Related lists -
   http://mail.zope.org/mailman/listinfo/zope-announce
   http://mail.zope.org/mailman/listinfo/zope )
 
  -- 
  Rocky Burt
  AdaptiveWave - Content Management as a Service
  http://www.adaptivewave.com
  Content Management Made Simple
 
 
  ___
  Zope-Dev maillist  -  Zope-Dev@zope.org
  http://mail.zope.org/mailman/listinfo/zope-dev
  **  No cross posts or HTML encoding!  **
  (Related lists -
   http://mail.zope.org/mailman/listinfo/zope-announce
   http://mail.zope.org/mailman/listinfo/zope )
 
 
  ___
  Zope-Dev maillist  -  Zope-Dev@zope.org
  http://mail.zope.org/mailman/listinfo/zope-dev
  **  No cross posts or HTML encoding!  **
  (Related lists -http://mail.zope.org/mailman/listinfo/zope

[Zope-dev] Re: Re: [ANN] pythonproducts 1.0beta1 released

2006-04-23 Thread Rocky Burt
On Sun, 2006-23-04 at 19:22 +0100, Jens Vagelpohl wrote:
  But there's still the matter of CMF.  At some point I want to get the
  patches integrated into CMF 1.6 and/or 2.0 but with 1.6 its  
  probably too
  late and with CMF 2.0 I need to better understand how the FTI stuff
  works before I can (or if I even should) apply the patches.
 
 Whatever those patches are (I did not look) you should target CMF 2.1  
 (the current trunk) and not 1.6/2.0 because those are now in  
 maintenance mode. CMF 2.1 will be ready in time for Plone 3.0, that's  
 already been decided.

Great news regarding CMF 2.1 and Plone.  Specifically all pythonproducts
does for CMF is patch
CMFCore.TypesTool.TypesTool.listDefaultTypeInformation so that when it
looks up a product it doesn't simply look it up from the Products
package namespace, but it checks all registered product packages (can be
found by scanning Control_Panel/Products).

Maybe you could enlighten me on how much thats used now with CMF 2.0+.

- Rocky



-- 
Rocky Burt
AdaptiveWave - Content Management as a Service
http://www.adaptivewave.com
Content Management Made Simple


___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: [ANN] pythonproducts 1.0beta1 released

2006-04-23 Thread Rocky Burt
On Sun, 2006-23-04 at 20:40 +0200, yuppie wrote:
 So I guess
 
 1.) the CMF stuff is obsolete with CMF 2.0

Indeed, this is great news!


 2.) pythonproducts doesn't work with CMF 2.0
 (not tested, but patch_listDefaultTypeInformation seems to require 
 listDefaultTypeInformation)

Right, a goal of beta2 is to make sure certain futuristic combinations
of zope/five/cmf still at least run with pythonproducts even if
pythonproducts isn't required.  Main goal is to ensure pythonproducts is
smart enough to only patch stuff that isn't already working.


 3.) registerPackage works out of the box with Five 1.4 / Zope 2.10
 (also not tested)

Well, a little more than that.  registerPackage should work out of the
box with the following combos:
  - Zope 2.9 and Five 1.4+
  - Zope 2.10 (any Five version including the included version)


- Rocky

-- 
Rocky Burt
AdaptiveWave - Content Management as a Service
http://www.adaptivewave.com
Content Management Made Simple


___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: Re: cvs.zope.org/Products - svn.zope.org?

2006-04-22 Thread Rocky Burt
Will do.

- Rocky

On Thu, 2006-20-04 at 21:12 +0100, Jens Vagelpohl wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Rocky, since this whole issue seems to have petered out, if you want  
 to follow up with the respective product authors and have them  
 contact me I'll get them moved. I just don't want to do that without  
 having a consensus first.
 
 jens
 
 
 On 18 Apr 2006, at 11:44, Rocky Burt wrote:
 
  As a Plone developer my favourite two products I'd like to see moved
  would be:
1) ExternalEditor
2) Basket
 
  'course I've had the discussion with chrism in the past about moving
  Basket over...  Chris, what do you think?
 
  - Rocky
 
 
  On Tue, 2006-18-04 at 09:35 +0200, Jens Vagelpohl wrote:
  -BEGIN PGP SIGNED MESSAGE-
  Hash: SHA1
 
 
  On 18 Apr 2006, at 08:30, Andreas Jung wrote:
 
 
 
  --On 17. April 2006 16:25:10 +0200 Jens Vagelpohl
  [EMAIL PROTECTED] wrote:
  Wouldn't it make sense to migrate the complete Products hierarchy
  from cvs.zope.org to svn.zope.org?
 
  - -1 on migrating everything.
 
  IMHO it would be better to identify those dependencies and
  selectively
  migrate products as needed. I'd volunteer to do the  migrations, I
  have a
  well-working test harness and migration scripts  for that purpose
  on the
  cvs.zope.org box.
 
 
  We must distinguish between major community projects and private/
  commercial projects. If you want to support both we might end up
  having most of the stuff on svn.zope.org as well...
 
  Have you looked at what's inside the Products folder on cvs.zope.org?
  The important bits are already moved to SVN and then there's a whole
  lot of old unmaintained stuff. Now that I looked at what's in there I
  am even more against a wholesale move.
 
  I'm assuming the reason you started this discussion is because you
  had to fish something out of CVS. We could start by you identifying
  what that was.
 
  jens
 
 
  -BEGIN PGP SIGNATURE-
  Version: GnuPG v1.4.1 (Darwin)
 
  iD8DBQFERJbSRAx5nvEhZLIRAslrAJ4kDbIRw1/5l+yyc6j4x0fuWTCvYACdFISH
  ORbGazbvlNa7OEdGvWFIByE=
  =ribv
  -END PGP SIGNATURE-
  ___
  Zope-Dev maillist  -  Zope-Dev@zope.org
  http://mail.zope.org/mailman/listinfo/zope-dev
  **  No cross posts or HTML encoding!  **
  (Related lists -
   http://mail.zope.org/mailman/listinfo/zope-announce
   http://mail.zope.org/mailman/listinfo/zope )
 
  -- 
  Rocky Burt
  AdaptiveWave - Content Management as a Service
  http://www.adaptivewave.com
  Content Management Made Simple
 
 
  ___
  Zope-Dev maillist  -  Zope-Dev@zope.org
  http://mail.zope.org/mailman/listinfo/zope-dev
  **  No cross posts or HTML encoding!  **
  (Related lists -
   http://mail.zope.org/mailman/listinfo/zope-announce
   http://mail.zope.org/mailman/listinfo/zope )
 
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.1 (Darwin)
 
 iD8DBQFER+s5RAx5nvEhZLIRAopsAKCjtGP4GlDkwsKJvec8OBJhMfkEdgCdHFnB
 ZSF1NyFxDZNGgRQ1yra5UR8=
 =lP+F
 -END PGP SIGNATURE-
 ___
 Zope-Dev maillist  -  Zope-Dev@zope.org
 http://mail.zope.org/mailman/listinfo/zope-dev
 **  No cross posts or HTML encoding!  **
 (Related lists - 
  http://mail.zope.org/mailman/listinfo/zope-announce
  http://mail.zope.org/mailman/listinfo/zope )
 
-- 
Rocky Burt
AdaptiveWave - Content Management as a Service
http://www.adaptivewave.com
Content Management Made Simple


___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: [Zope2.8.7] with Five 1.0 or Five 1.2

2006-03-28 Thread Rocky Burt
On Tue, 2006-28-03 at 08:58 +0200, Philipp von Weitershausen wrote:
 Chris McDonough wrote:
  -1... Five 1.2 has quite a few differences from Five 1.0 that would stop
  products written for Five 1.0 from working properly.  I've not gone to
  2.9 on a few projects for this reason (sticking with 2.8).  2.9 is where
  the new version belongs, IMO.
 
 Out of curiosity, what are the incompatibilities between Five 1.0 and
 1.2/1.3 that hinder you from upgrading?

I'd be extremely eager to know the answer to this myself as I've moved a
few production sites from Five 1.0 to 1.2 without breaking any existing
functionality.

- Rocky

-- 
Rocky Burt
AdaptiveWave - Content Management as a Service
http://www.adaptivewave.com
Content Management Made Simple


___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: [Zope2.8.7] with Five 1.0 or Five 1.2

2006-03-27 Thread Rocky Burt
On Mon, 2006-27-03 at 07:35 +0200, Andreas Jung wrote:
 Zope 2.8 ships/shipped with Five 1.0 which is very old and no longer
 actively maintained. Most ppl doing currently development with Zope 2.8
 are using Five 1.2. Should we upgrade the Five version in Zope 2.8 to Five 
 1.2 to make their lives a bit easier? There is possibly a compatiblity 
 problem involved and it is against the general rule for major upgrades of a
 package or product for a minor Zope release..I have no opinion on this 
 issue...I just had this thought

+1

-- 
Rocky Burt
AdaptiveWave - Content Management as a Service
http://www.adaptivewave.com
Content Management Made Simple


___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-Checkins] SVN: Products.Five/branches/1.4/pythonproducts.py Fixed up the placement of global statements for _zope_app.

2006-03-26 Thread Rocky Burt
Log message for revision 66189:
  Fixed up the placement of global statements for _zope_app.

Changed:
  U   Products.Five/branches/1.4/pythonproducts.py

-=-
Modified: Products.Five/branches/1.4/pythonproducts.py
===
--- Products.Five/branches/1.4/pythonproducts.py2006-03-26 20:25:40 UTC 
(rev 66188)
+++ Products.Five/branches/1.4/pythonproducts.py2006-03-26 20:30:29 UTC 
(rev 66189)
@@ -33,12 +33,12 @@
 
 from OFS.Application import Application
 
+global _zope_app
 if isinstance(appOrContext, Application):
 _zope_app = appOrContext
 else:
 _zope_app = appOrContext._ProductContext__app
 
-global _zope_app
 applyPatches(_zope_app)
 
 
@@ -87,8 +87,8 @@
 
 
 from App.FactoryDispatcher import FactoryDispatcher, ProductDispatcher
+global _original__bobo_traverse__
 _original__bobo_traverse__ = ProductDispatcher.__bobo_traverse__
-global _original__bobo_traverse__
 
 def __bobo_traverse__(self, REQUEST, name):
 product=self.aq_acquire('_getProducts')()._product(name)
@@ -115,8 +115,8 @@
 from App import Extensions, FactoryDispatcher
 from Products.ExternalMethod import ExternalMethod
 
+global _originalGetPath
 _originalGetPath = Extensions.getPath
-global _originalGetPath
 
 def getPath(prefix, name, checkProduct=1, suffixes=('',)):
 Make sure to check paths of all registered product packages.

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Products.Five/branches/1.0/ Added missing fix from newer versions of Five where the _context wasn't getting cleaned up properly in zcml.py. Without this fix, adapter lookups would

2006-03-25 Thread Rocky Burt
Log message for revision 66160:
  Added missing fix from newer versions of Five where the _context wasn't 
getting cleaned up properly in zcml.py.  Without this fix, adapter lookups 
wouldn't work in any test after the first test that used load_zcml in the same 
test fixture (essentially adapter lookups were dead).

Changed:
  U   Products.Five/branches/1.0/CHANGES.txt
  U   Products.Five/branches/1.0/zcml.py

-=-
Modified: Products.Five/branches/1.0/CHANGES.txt
===
--- Products.Five/branches/1.0/CHANGES.txt  2006-03-25 11:23:51 UTC (rev 
66159)
+++ Products.Five/branches/1.0/CHANGES.txt  2006-03-25 12:59:18 UTC (rev 
66160)
@@ -5,6 +5,11 @@
 Five 1.0.3 (...)
 
 
+* Added missing fix from newer versions of Five where the _context wasn't
+  getting cleaned up properly in zcml.py.  Without this fix, adapter lookups
+  wouldn't work in any test after the first test that used load_zcml in the 
+  same test fixture (essentially adapter lookups were dead).
+
 * Fixed bug that broke WebDAV access for five:defaultViewable objects. The
   __browser_default__ now modifies only GET and POST requests.
 

Modified: Products.Five/branches/1.0/zcml.py
===
--- Products.Five/branches/1.0/zcml.py  2006-03-25 11:23:51 UTC (rev 66159)
+++ Products.Five/branches/1.0/zcml.py  2006-03-25 12:59:18 UTC (rev 66160)
@@ -61,3 +61,12 @@
 global _context
 _context = xmlconfig.string(s, _context)
 
+# clean up code
+
+def cleanUp():
+global _context
+_context = None
+
+from zope.testing.cleanup import addCleanUp
+addCleanUp(cleanUp)
+del addCleanUp

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Products.Five/branches/1.4/ Setup logic-less registerPackage zcml directive.

2006-03-12 Thread Rocky Burt
Log message for revision 65925:
  Setup logic-less registerPackage zcml directive.
  

Changed:
  _U  Products.Five/branches/1.4/
  U   Products.Five/branches/1.4/fiveconfigure.py
  U   Products.Five/branches/1.4/fivedirectives.py
  U   Products.Five/branches/1.4/meta.zcml

-=-

Property changes on: Products.Five/branches/1.4
___
Name: svk:merge
   + 98c0701e-2f07-0410-a1a0-c1bc72243522:/local/Products.Five/branches/1.4:8740

Modified: Products.Five/branches/1.4/fiveconfigure.py
===
--- Products.Five/branches/1.4/fiveconfigure.py 2006-03-12 18:37:59 UTC (rev 
65924)
+++ Products.Five/branches/1.4/fiveconfigure.py 2006-03-12 19:40:39 UTC (rev 
65925)
@@ -260,6 +260,22 @@
 
 # clean up code
 
+def _registerPackage(module_, initFunc=None):
+Registers the given python package as a Zope 2 style product
+
+
+
+def registerPackage(_context, package, initialize=None):
+ZCML directive function for registering a python package product
+
+
+_context.action(
+discriminator = ('registerPackage', package),
+callable = _registerPackage,
+args = (package,initialize)
+)
+
+
 def killMonkey(class_, name, fallback, attr=None):
 Die monkey, die!
 method = getattr(class_, name, None)

Modified: Products.Five/branches/1.4/fivedirectives.py
===
--- Products.Five/branches/1.4/fivedirectives.py2006-03-12 18:37:59 UTC 
(rev 65924)
+++ Products.Five/branches/1.4/fivedirectives.py2006-03-12 19:40:39 UTC 
(rev 65925)
@@ -178,3 +178,20 @@
 u'installed Product. If the file does not exist, for a '
 u'particular product, no error is raised.',
 required=False)
+
+class IRegisterPackageDirective(Interface):
+Registers the given python package which at a minimum fools zope2 into
+thinking of it as a zope2 product.
+
+
+package = GlobalObject(
+title=u'Target package',
+required=True
+)
+
+initialize = GlobalObject(
+title=u'Initialization function to invoke',
+description=u'The dotted name of a function that will get invoked '
+u'with a ProductContext instance',
+required=False
+)

Modified: Products.Five/branches/1.4/meta.zcml
===
--- Products.Five/branches/1.4/meta.zcml2006-03-12 18:37:59 UTC (rev 
65924)
+++ Products.Five/branches/1.4/meta.zcml2006-03-12 19:40:39 UTC (rev 
65925)
@@ -157,6 +157,12 @@
handler=.fiveconfigure.registerClass
/
 
+meta:directive
+   name=registerPackage
+   schema=.fivedirectives.IRegisterPackageDirective
+   handler=.fiveconfigure.registerPackage
+   /
+   
   /meta:directives
 
   meta:directive

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Products.Five/branches/1.4/ Setup basic modules for testing registerpackage functionality.

2006-03-12 Thread Rocky Burt
Log message for revision 65926:
  Setup basic modules for testing registerpackage functionality.
  

Changed:
  _U  Products.Five/branches/1.4/
  A   Products.Five/branches/1.4/tests/test_registerpackage.py
  A   Products.Five/branches/1.4/tests/testing/pythonproduct1.py

-=-

Property changes on: Products.Five/branches/1.4
___
Name: svk:merge
   - 98c0701e-2f07-0410-a1a0-c1bc72243522:/local/Products.Five/branches/1.4:8740
   + 98c0701e-2f07-0410-a1a0-c1bc72243522:/local/Products.Five/branches/1.4:8741

Added: Products.Five/branches/1.4/tests/test_registerpackage.py
===
--- Products.Five/branches/1.4/tests/test_registerpackage.py2006-03-12 
19:40:39 UTC (rev 65925)
+++ Products.Five/branches/1.4/tests/test_registerpackage.py2006-03-12 
19:41:31 UTC (rev 65926)
@@ -0,0 +1,56 @@
+##
+#
+# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED AS IS AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##
+Unit tests for the registerPackage directive.
+
+$Id$
+
+import os, sys
+if __name__ == '__main__':
+execfile(os.path.join(sys.path[0], 'framework.py'))
+
+def test_registerPackage():
+
+Testing registerPackage
+
+   from zope.app.testing.placelesssetup import setUp, tearDown
+   setUp()
+   import Products
+   import Products.Five
+   from Products.Five import zcml
+
+Use the five:registerPackage directive::
+
+   configure_zcml = '''
+  ... configure
+  ... xmlns=http://namespaces.zope.org/zope;
+  ... xmlns:five=http://namespaces.zope.org/five;
+  ... i18n_domain=foo
+  ...   five:registerPackage
+  ...   package=Products.Five.tests.testing.pythonproduct1
+  ...   /
+  ... /configure'''
+   zcml.load_config('meta.zcml', Products.Five)
+   zcml.load_string(configure_zcml)
+
+Clean up:
+
+   tearDown()
+
+
+def test_suite():
+from Testing.ZopeTestCase import ZopeDocTestSuite
+return ZopeDocTestSuite()
+
+if __name__ == '__main__':
+framework()

Added: Products.Five/branches/1.4/tests/testing/pythonproduct1.py
===
--- Products.Five/branches/1.4/tests/testing/pythonproduct1.py  2006-03-12 
19:40:39 UTC (rev 65925)
+++ Products.Five/branches/1.4/tests/testing/pythonproduct1.py  2006-03-12 
19:41:31 UTC (rev 65926)
@@ -0,0 +1,18 @@
+##
+#
+# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED AS IS AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##
+Python
+
+$Id$
+
+

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Products.Five/branches/1.4/ Added preliminary support for being able to register any python package as a zope2 product (so it shows up in Control Panel).

2006-03-12 Thread Rocky Burt
Log message for revision 65927:
  Added preliminary support for being able to register any python package as a 
zope2 product (so it shows up in Control Panel).
  

Changed:
  _U  Products.Five/branches/1.4/
  U   Products.Five/branches/1.4/__init__.py
  U   Products.Five/branches/1.4/fiveconfigure.py
  A   Products.Five/branches/1.4/pythonproducts.py
  U   Products.Five/branches/1.4/tests/test_registerpackage.py
  A   Products.Five/branches/1.4/tests/testing/pythonproduct2/
  A   Products.Five/branches/1.4/tests/testing/pythonproduct2/__init__.py

-=-

Property changes on: Products.Five/branches/1.4
___
Name: svk:merge
   - 98c0701e-2f07-0410-a1a0-c1bc72243522:/local/Products.Five/branches/1.4:8741
   + 98c0701e-2f07-0410-a1a0-c1bc72243522:/local/Products.Five/branches/1.4:8742

Modified: Products.Five/branches/1.4/__init__.py
===
--- Products.Five/branches/1.4/__init__.py  2006-03-12 19:41:31 UTC (rev 
65926)
+++ Products.Five/branches/1.4/__init__.py  2006-03-12 19:42:14 UTC (rev 
65927)
@@ -19,6 +19,7 @@
 from Globals import INSTANCE_HOME
 
 import zcml
+import pythonproducts
 
 # public API provided by Five
 # usage: from Products.Five import something
@@ -26,4 +27,5 @@
 from skin.standardmacros import StandardMacros
 
 def initialize(context):
+pythonproducts.setupPythonProducts(context)
 zcml.load_site()

Modified: Products.Five/branches/1.4/fiveconfigure.py
===
--- Products.Five/branches/1.4/fiveconfigure.py 2006-03-12 19:41:31 UTC (rev 
65926)
+++ Products.Five/branches/1.4/fiveconfigure.py 2006-03-12 19:42:14 UTC (rev 
65927)
@@ -23,6 +23,8 @@
 import warnings
 
 import App.config
+from App.Product import initializeProduct
+from App.ProductContext import ProductContext
 import Products
 from zLOG import LOG, ERROR
 
@@ -41,6 +43,7 @@
 from traversable import Traversable
 from bridge import fromZ2Interface
 from browser.metaconfigure import page
+import pythonproducts
 
 debug_mode = App.config.getConfiguration().debug_mode
 
@@ -258,13 +261,26 @@
 args = (class_, meta_type, permission, addview, icon, global_)
 )
 
-# clean up code
-
 def _registerPackage(module_, initFunc=None):
 Registers the given python package as a Zope 2 style product
 
 
+if not hasattr(module_, '__path__'):
+raise ValueError(Must be a package and the  \
+ package must be filesystem based)
+
+product = initializeProduct(module_, 
+module_.__name__, 
+module_.__path__[0], 
+pythonproducts._zope_app)
 
+product.package_name = module_.__name__
+
+if initFunc is not None:
+newContext = ProductContext(product, pythonproducts._zope_app, module_)
+initFunc(newContext)
+
+
 def registerPackage(_context, package, initialize=None):
 ZCML directive function for registering a python package product
 
@@ -275,6 +291,7 @@
 args = (package,initialize)
 )
 
+# clean up code
 
 def killMonkey(class_, name, fallback, attr=None):
 Die monkey, die!

Added: Products.Five/branches/1.4/pythonproducts.py
===
--- Products.Five/branches/1.4/pythonproducts.py2006-03-12 19:41:31 UTC 
(rev 65926)
+++ Products.Five/branches/1.4/pythonproducts.py2006-03-12 19:42:14 UTC 
(rev 65927)
@@ -0,0 +1,147 @@
+##
+#
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED AS IS AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##
+Setup necessary monkey patches and other related logic for using 
+regular python packages for zope2 products
+
+$Id$
+
+__author__ = Rocky Burt
+
+import os
+import types
+
+import Products
+from App.Product import initializeProduct
+from App.ProductContext import ProductContext
+
+_zope_app = None
+
+def setupPythonProducts(appOrContext):
+Initialize the python-packages-as-products logic
+
+
+from OFS.Application import Application
+
+if isinstance(appOrContext, Application):
+_zope_app = appOrContext
+else:
+_zope_app = appOrContext._ProductContext__app
+
+global _zope_app
+#applyPatches(_zope_app)
+
+
+def applyPatches(app):
+Apply necessary monkey patches to force

[Zope-Checkins] SVN: Products.Five/branches/1.4/ Renamed test_registerpackage to test_pythonproducts.

2006-03-12 Thread Rocky Burt
Log message for revision 65934:
  Renamed test_registerpackage to test_pythonproducts.
  

Changed:
  _U  Products.Five/branches/1.4/
  A   Products.Five/branches/1.4/tests/test_pythonproducts.py
  D   Products.Five/branches/1.4/tests/test_registerpackage.py

-=-

Property changes on: Products.Five/branches/1.4
___
Name: svk:merge
   - 98c0701e-2f07-0410-a1a0-c1bc72243522:/local/Products.Five/branches/1.4:8742
   + 98c0701e-2f07-0410-a1a0-c1bc72243522:/local/Products.Five/branches/1.4:8749

Added: Products.Five/branches/1.4/tests/test_pythonproducts.py
===
--- Products.Five/branches/1.4/tests/test_pythonproducts.py 2006-03-12 
21:46:58 UTC (rev 65933)
+++ Products.Five/branches/1.4/tests/test_pythonproducts.py 2006-03-12 
23:20:01 UTC (rev 65934)
@@ -0,0 +1,87 @@
+##
+#
+# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED AS IS AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##
+Unit tests for the registerPackage directive.
+
+$Id$
+
+import os, sys
+if __name__ == '__main__':
+execfile(os.path.join(sys.path[0], 'framework.py'))
+
+def test_registerPackage():
+
+Testing registerPackage
+
+   from zope.app.testing.placelesssetup import setUp, tearDown
+   setUp()
+   import Products
+   import Products.Five
+   from Products.Five import zcml
+   from Products.Five import pythonproducts
+   zcml.load_config('meta.zcml', Products.Five)
+   pythonproducts.setupPythonProducts(app)
+
+Make sure a python package with no initialize (even though one
+is specified) will fail::
+
+   configure_zcml = '''
+  ... configure
+  ... xmlns=http://namespaces.zope.org/zope;
+  ... xmlns:five=http://namespaces.zope.org/five;
+  ... i18n_domain=foo
+  ...   five:registerPackage
+  ...   package=Products.Five.tests.testing.pythonproduct1
+  ...   
initialize=Products.Five.tests.testing.pythonproduct1.initialize
+  ...   /
+  ... /configure'''
+   zcml.load_string(configure_zcml)
+  Traceback (most recent call last):
+  ...
+  ZopeXMLConfigurationError: ...
+  ConfigurationError: ('...pythonproduct1 has no global initialize')
+
+Make sure a python package with a valid initialize gets its
+initialize function called::
+
+   configure_zcml = '''
+  ... configure
+  ... xmlns=http://namespaces.zope.org/zope;
+  ... xmlns:five=http://namespaces.zope.org/five;
+  ... i18n_domain=foo
+  ...   five:registerPackage
+  ...   package=Products.Five.tests.testing.pythonproduct2
+  ...   
initialize=Products.Five.tests.testing.pythonproduct2.initialize
+  ...   /
+  ... /configure'''
+   zcml.load_string(configure_zcml)
+  pythonproduct2 initialized
+  
+Test to see if the pythonproduct2 python package actually gets setup
+as a zope2 product in the Control Panel.
+
+   productListing = app.Control_Panel.Products.objectIds()
+   'Products.Five.tests.testing.pythonproduct2' in productListing
+  True
+
+Clean up:
+
+   tearDown()
+
+
+def test_suite():
+from Testing.ZopeTestCase import ZopeDocTestSuite
+return ZopeDocTestSuite()
+
+if __name__ == '__main__':
+framework()

Deleted: Products.Five/branches/1.4/tests/test_registerpackage.py
===
--- Products.Five/branches/1.4/tests/test_registerpackage.py2006-03-12 
21:46:58 UTC (rev 65933)
+++ Products.Five/branches/1.4/tests/test_registerpackage.py2006-03-12 
23:20:01 UTC (rev 65934)
@@ -1,87 +0,0 @@
-##
-#
-# Copyright (c) 2004, 2005 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED AS IS AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##
-Unit tests for the registerPackage directive.
-

[Zope-Checkins] SVN: Products.Five/branches/1.4/ Now applying monkey patches to make Zope2 work with python packages that don't have to live in Products/

2006-03-12 Thread Rocky Burt
Log message for revision 65935:
  Now applying monkey patches to make Zope2 work with python packages that 
don't have to live in Products/
  

Changed:
  _U  Products.Five/branches/1.4/
  U   Products.Five/branches/1.4/pythonproducts.py
  U   Products.Five/branches/1.4/tests/test_pythonproducts.py
  A   Products.Five/branches/1.4/tests/testing/pythonproduct2/Extensions/
  A   
Products.Five/branches/1.4/tests/testing/pythonproduct2/Extensions/__init__.py
  A   
Products.Five/branches/1.4/tests/testing/pythonproduct2/Extensions/somemodule.py

-=-

Property changes on: Products.Five/branches/1.4
___
Name: svk:merge
   - 98c0701e-2f07-0410-a1a0-c1bc72243522:/local/Products.Five/branches/1.4:8749
   + 98c0701e-2f07-0410-a1a0-c1bc72243522:/local/Products.Five/branches/1.4:8750

Modified: Products.Five/branches/1.4/pythonproducts.py
===
--- Products.Five/branches/1.4/pythonproducts.py2006-03-12 23:20:01 UTC 
(rev 65934)
+++ Products.Five/branches/1.4/pythonproducts.py2006-03-12 23:20:47 UTC 
(rev 65935)
@@ -39,7 +39,7 @@
 _zope_app = appOrContext._ProductContext__app
 
 global _zope_app
-#applyPatches(_zope_app)
+applyPatches(_zope_app)
 
 
 def applyPatches(app):
@@ -135,6 +135,7 @@
 m = __import__(toplevel)
 
 d = os.path.join(m.__path__[0], prefix, realName)
+
 for s in suffixes:
 if s: s=%s.%s % (d, s)
 else: s=d

Modified: Products.Five/branches/1.4/tests/test_pythonproducts.py
===
--- Products.Five/branches/1.4/tests/test_pythonproducts.py 2006-03-12 
23:20:01 UTC (rev 65934)
+++ Products.Five/branches/1.4/tests/test_pythonproducts.py 2006-03-12 
23:20:47 UTC (rev 65935)
@@ -19,6 +19,11 @@
 if __name__ == '__main__':
 execfile(os.path.join(sys.path[0], 'framework.py'))
 
+# need to add the testing package to the pythonpath in order to
+# test python-packages-as-products
+from Products.Five.tests import testing
+sys.path.append(testing.__path__[0])
+
 def test_registerPackage():
 
 Testing registerPackage
@@ -41,8 +46,8 @@
   ... xmlns:five=http://namespaces.zope.org/five;
   ... i18n_domain=foo
   ...   five:registerPackage
-  ...   package=Products.Five.tests.testing.pythonproduct1
-  ...   
initialize=Products.Five.tests.testing.pythonproduct1.initialize
+  ...   package=pythonproduct1
+  ...   initialize=pythonproduct1.initialize
   ...   /
   ... /configure'''
zcml.load_string(configure_zcml)
@@ -60,8 +65,8 @@
   ... xmlns:five=http://namespaces.zope.org/five;
   ... i18n_domain=foo
   ...   five:registerPackage
-  ...   package=Products.Five.tests.testing.pythonproduct2
-  ...   
initialize=Products.Five.tests.testing.pythonproduct2.initialize
+  ...   package=pythonproduct2
+  ...   initialize=pythonproduct2.initialize
   ...   /
   ... /configure'''
zcml.load_string(configure_zcml)
@@ -71,7 +76,7 @@
 as a zope2 product in the Control Panel.
 
productListing = app.Control_Panel.Products.objectIds()
-   'Products.Five.tests.testing.pythonproduct2' in productListing
+   'pythonproduct2' in productListing
   True
 
 Clean up:
@@ -79,6 +84,49 @@
tearDown()
 
 
+def test_externalmethods():
+
+Testing registerPackage
+
+   from zope.app.testing.placelesssetup import setUp, tearDown
+   setUp()
+   import Products
+   import Products.Five
+   from Products.Five import zcml
+   from Products.Five import pythonproducts
+   zcml.load_config('meta.zcml', Products.Five)
+   pythonproducts.setupPythonProducts(app)
+
+   configure_zcml = '''
+  ... configure
+  ... xmlns=http://namespaces.zope.org/zope;
+  ... xmlns:five=http://namespaces.zope.org/five;
+  ... i18n_domain=foo
+  ...   five:registerPackage
+  ...   package=pythonproduct2
+  ...   initialize=pythonproduct2.initialize
+  ...   /
+  ... /configure'''
+   zcml.load_string(configure_zcml)
+  pythonproduct2 initialized
+  
+Lets go ahead and try setting up an external method from the
+pythonproduct2 product.
+
+   from Products.ExternalMethod.ExternalMethod import 
manage_addExternalMethod
+   manage_addExternalMethod(app, 'testexternal', '', 
'pythonproduct2.somemodule', 'somemethod')
+  
+Now lets actually execute the external method.
+
+   app.testexternal()
+  Executed somemethod
+
+Clean up:
+
+   tearDown()
+
+
+
 def test_suite():
 from Testing.ZopeTestCase import ZopeDocTestSuite
 return ZopeDocTestSuite()

Added: 

[Zope-dev] Re: http access to svn repos?

2006-03-11 Thread Rocky Burt
On Tue, 2006-07-03 at 09:35 +, Chris Withers wrote:
 *sigh* red tape wins again. It's much easier to just do nothing, and 
 just not be able to contribute from behind a firewall...

Yeah, this is always unfortunate.


  The issues aren't so much technical feasibility as social / legal:  a
  checkin done using somebody's private key is way less deniable than one
  done with a password.  Unless you plan to set up a system for issuing
  client certificates to contributors, I don't think https is superior to
  svn+ssh at all.
 
 Hmmm, I'm tempted to call BS on this. How much of this has actually been 
 tested in a court? Really, all this crap gets caught up on pseudo legal 
 BS which ultimately just makes it more difficult for people to 
 contribute :-( I really don't get the whole paranoia about passwords 
 anyway... yes, client certs and public key are more secure, but 
 really, why are we setting the bar so high? It's not like we're dealing 
 with top secret national security stuff...

+1 on Chris' comments


 For trying to get people to help out, this sucks ass. Come on, we're an 
 open source project, we _want_ people to help out, not keep on pushing 
 them away with higher and higher bars :-(

+1 once more


For my own contribution I could really care less what protocols we use,
since Im in a situation where I can use whatever.

But out of the 20 or so public SVN repos i have write access to,
zope.org is the only one that requires this whole ssh thing (most do
writing over https, a few do writing over regular http).  Its certainly
not the norm.  I realize changing it at this point would probably be a
major pain for all existing contributors, but lowering the bar for new
contributors is definitely worth it IMHO.

Anyhow, just my 2 cents.

- Rocky


-- 
Rocky Burt
AdaptiveWave - Content Management as a Service
http://www.adaptivewave.com
Content Management Made Simple


___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: Re: [Zope-dev] Two visions?

2006-03-04 Thread Rocky Burt
On Thu, 2006-02-03 at 10:32 -0500, Stephan Richter wrote:
 On Thursday 02 March 2006 10:29, Stefane Fermigier wrote:
  Geoff Davis wrote:
   I think that the idea of giving Zed its own, distinct identity is great.
 
  I think it is stupid.
 
 Me too!!

Not I.  Particularly not if we want further adoption Zed outside of
the zope community.  And for the record, I could care less what the name
is.  But I do think someone in this thread made a good point -- having a
name without zope will allow for much easier adoption by the rest of
the python community.  And isn't that what we're all here for?

Profile: Zed, plays nice with others

- Rocky


-- 
Rocky Burt
AdaptiveWave - Consulting, Training, and Content Management as a Service
http://www.adaptivewave.com
Content Management Made Simple


___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: [Zope3-dev] Re: Two visions?

2006-03-04 Thread Rocky Burt
On Fri, 2006-03-03 at 09:30 +0100, Max M wrote:
 Benji York wrote:
  If we want people outside of the zope community to use these components, 
  they should not have the word zope anywhere in their name.  If it says 
  zope people will *always* assume it is for use only with/inside Zope 
  (Zope 2 more often than not).
 
 
 Would we want people outside the community to do this?

We want as much as the python developer as possible to use pieces of
zope.  This means those pieces of zope will have had greater testing,
more reviewing, and ultimately, more people contributing.

At this point, I think the number of people that already use zope3
components and have never used zope the application server would be
larger than expected.  For those who don't get put off by names right
away, zope3 CA is a nice piece of work.

- Rocky



-- 
Rocky Burt
AdaptiveWave - Consulting, Training, and Content Management as a Service
http://www.adaptivewave.com
Content Management Made Simple


___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Two visions?

2006-03-04 Thread Rocky Burt
On Thu, 2006-02-03 at 16:49 +0100, Paul Everitt wrote:
 I think Geoff's core point could be met by keeping the word Zope for 
 the app server.  I think Geoff's deeper point was to rethink the word 
 used for the CA, which actually doesn't want to be thought of us an app 
 server.

+1

-- 
Rocky Burt
AdaptiveWave - Consulting, Training, and Content Management as a Service
http://www.adaptivewave.com
Content Management Made Simple


___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: Re: Re: Two visions

2006-03-04 Thread Rocky Burt
On Thu, 2006-02-03 at 19:31 +, Stefane Fermigier wrote:
 Strange how (most of) the Plone people seem to be so quick in willing to
 sacrifice the Zope brand :(

Were this truly the case, most Plone people wouldn't bother
contributing to this thread.  But the reality is -- I (from a Plone
people point of view) am very concerned about the future of Zope from
both technology and marketing standpoints.

I do python/zope/plone consulting for a living -- it thrills me when I
can say to a fairly technology-savvy client that I will deploy my
solution on top of Zope and they say, Oh Zope? I've heard thats pretty
good.  And yes, it has happened.


- Rocky

-- 
Rocky Burt
AdaptiveWave - Consulting, Training, and Content Management as a Service
http://www.adaptivewave.com
Content Management Made Simple


___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Re: Two visions

2006-03-02 Thread Rocky Burt
On Tue, 2006-28-02 at 13:21 +0100, Martijn Faassen wrote:
 Philipp von Weitershausen wrote:
 [snip]
  I would vote for spelling out Zed (which would also be a little easier
  to google but might create trademark problems). The namespace package
  could either be 'z' or 'zed'.
  
  Then again, I really should take Jim's side and stay out of naming
  decisions.
 
 Let's please not have a naming discussion again. I think renaming Zope 3 
 is really bad marketing myself and naming discussions mostly a waste of 
 time...

As I sit here spending sooo much time reading this thread, I've finally
decided its time to throw in my own naive point of view as an ex-J2EE
developer and a Zope 2 developer that generally builds applications on
top of Zope2/CMF/Plone.

Let me make a random comments.

1) The Zope 3 name and brand is a marketing disaster (from my
perspective) -- to be honest there's really no way I could see this
actually getting worse by coming up with a new name.  How many times in
the #plone channel do we get asked, Does Plone run on Zope 3.1/3.2?
or, When will Plone run on Zope 3.2 to which we say no to the first
question and dunno to the second question.

2) Today when I build new applications with Plone, the best I can hope
for is to use Zope 3 as a framework and Zope 2 as a deployment platform.
Although the reality is I still use Zope 2 as a framework fr too
much as well.  I'm hoping (expecting) that Five will continue to make
the requirement to use Zope 2 as a framework diminish more and more.  As
a developer, I certainly prefer working with Zope 3 the framework over
Zope 2 the framework.

3) New developers who are moving in to either learn how to use Zope to
develop applications or support existing zope applications of course
immediately download the highest number Zope (zope 3 of course).  They
start using it and (hopefully) enjoy working on it and discover there's
a big zope community with lots of developed applications.  Then this
developer starts googling for a type of plugin/component he needs to
make sure he's not reinventing the wheel and discovers there's a HUGE
plethora of Zope applications that do not even run on his latest zope
platform and won't run on that platform in the foreseeable future.

Ok, let me say what I think regarding these things.

If we started treating zope 3 as just a framework and put energies back
into maintaing/refactoring/beautifying zope2 as an application server
that uses that framework at its core (this is essentially what zope 2.8+
is working towards with Five IMHO) then this could help several ways:
  1) we stop spending time reproducing zope2 app server functionality in
zope3
  2) we stop building more into zope2 as a framework (i think this is
pretty much already happening)

Anyway, this still keeps things very confusing from a naming perspective
(mostly for new adopters).  So  having said all of that, I am
actually +1 on Jim's proposal #2.  What I see from that (someone correct
me if I'm wrong) is the following:

  1) rename zope 3 the framework as Z or zopelib or Zed or something
sensical that doesn't confuse the early adopter's conquest of trying to
figure out which zope to start with
  2) Make zope 2 the application server acquire the name zope once
again and be the only app server.  This could only work (from a new
adopter's perspective) if either the application server is given a new
name or given a version number higher than 3.

Who are we worried aboug confusing here? Existing Zope 3 developers?
Zope 2 developers?  I don't think so, those people are smart enough to
figure it out.  So I say lets focus on not confusing new adopters in
which case SOMETHING HAS TO BE DONE ABOUT THE CURRENT NAMING SITUATION!

Kind Regards,
Rocky


-- 
Rocky Burt
AdaptiveWave - Consulting, Training, and Content Management as a Service
http://www.adaptivewave.com
Content Management Made Simple


___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] [ANN] pythonproducts 1.0alpha1 released

2006-02-27 Thread Rocky Burt
Hi all,

I've now made available the first public release of pythonproducts.

pythonproducts
==

Description
  A mechanism to construct Zope 2 products as regular python 
  packages.  This enables a python package to be deployed as a 
  Zope 2 product using a similar strategy as Zope 3.

Author/Maintainer
  `Rocky Burt [EMAIL PROTECTED]`__

Latest Release
  `1.0alpha1
http://dev.serverzen.com/site/projects/pythonproducts/releases/pythonproducts-1-0alpha1-tar.gz/download`__

License
  BSD-style, see LICENSE.txt for details

Source Control
  http://codespeak.net/svn/z3/pythonproducts/
 
Requirements
  - Python 2.3.5 or higher in 2.3.x series
  - Zope 2.8.4 or higher in 2.8.x series
  - Five 1.2 or higher

Installing
  Uses regular python distutils for installation.  Simply run::
  
./setup.py install --home /some/path/to/zope_instance_home

Usage
  Once pythonproducts has been installed, the standard practise 
  of installing a python package as a Zope 2 product is as 
  follows:
  
1. edit (or create it if it doesn't exist already) 
   ``$YOUR_PKG_SOURCE/configure.zcml`` and add the line 
   ``five:registerPackage package=. initialize=.initialize /``
2. copy your python package to ``$INSTANCE_HOME/lib/python``
3. create a ZCML slug by creating the file 
   ``
$INSTANCE_HOME/etc/package-includes/yourpackage-configure.zcml`` and
   populating it with ``configure package=yourpackage /``

Explanation of Usage
  Step 1: Your python package needs to register itself as a 
  Zope 2 product.  This is accomplished by using the new
  ``registerPackage`` directive.  This directive takes a 
  (required) package attribute which declares any python 
  package as a Zope 2 product (with . meaning this package).  
  Another (optional) attribute is the 'initialize' attribute.  
  If this attribute is defined, a function with that name 
  will be invoked in a traditional Zope 2 style with a 
  ProductContext instance as the sole argument.
  
  Step 2: Your python package needs to exist *somewhere* on 
  PYTHONPATH.  With Zope 2.8, $INSTANCE_HOME/lib/python is 
  added to the PYTHONPATH so copying your python package 
  there ensures its somewhere in PYTHONPATH.  But really your 
  python package could be copied to any directory that exists 
  on PYTHONPATH (ie /usr/lib/python2.3/site-packages).
  
  Step 3: The standard way of registering a package with Zope 3 is 
  to create a ZCML slug in the $INSTANCE_HOME/etc/package-includes
  directory.  This file can be called anything as long as it ends 
  with -configure.zcml.
 


-- 
Rocky Burt
AdaptiveWave - Consulting, Training, and Content Management as a Service
http://www.adaptivewave.com
Content Management Made Simple


___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: [Zope3-dev] Pluggins vs Application Definition

2006-02-14 Thread Rocky Burt
Stephan Richter wrote:
 On Saturday 11 February 2006 16:50, Jim Fulton wrote:
 
- Application developers need to build an application.  They will
   generally want fairly tight control over what goes into the
   application.  For them, it's valuable to say in an explicit
   way what they want.

- If the application is extensible, then application users
   will want to be able to extend the application by adding
   pluggins.  If application users are not technically
   sophisticated, or, more importantly, not technically interested,
   they peobably would prefer to just drop something into a special
   directory and be done with it.

In summary, I think we need *both* approaches, as they serve different
needs.
 
 
 This is interesting. I agree with Philipp though that a simple install tool 
 would be better than one magic location. I think the ZCML slugs are very cool 
 and if we have a tool (as make does now) that does this one step, then we 
 effectively have drop-in packages. BTW, I think that a tool is also better, 
 because it would allow us to keep track of the installed packages and do 
 dependency checking, package-db maintenance, etc. Just randomly thinking...

I also think an install script is a good way of facading the actual
process.  In fact for my pythonproducts product (allows one to use
python packages as zope2 products without the Products directory) I was
considering providing a py script to do this for zope2 products.  Zope 2
developers see zcml slugs and say, what, things have gotten harder
going to zope3?.

- Rocky


-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
ServerZen Hosting -- http://www.serverzenhosting.net
News About The Server -- http://www.serverzen.net

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: December release post-mortem

2006-01-18 Thread Rocky Burt
Andreas Jung wrote:
 I think 2.9.0 is the _real_ 2.9 beta which will be widely used by ppl :-)

Isn't this always the case? :)(ie with all 2.x.0 releses)

- Rocky

-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
ServerZen Hosting -- http://www.serverzenhosting.net
News About The Server -- http://www.serverzen.net

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: [ZODB-Dev] Re: Re: zLOG module deprecated

2006-01-10 Thread Rocky Burt
Andreas Jung wrote:
 To bring this discussion to an end:
 
 - if we need specific logging functionaliy then it should be implemented
   to be shared between Zope 2 and Zope 3
 
 - adjusting the current code base from 'logging' to zope.logging would
 mean just to replace the imports (assuming we keep getLogger() factory)
 
 I am not totally against something like zope.logging but I still don't
 see the real need. We have some months until Zope 2.10 to get this in
 the right way.

Not requiring a new zope logging module (and using the builtin python
logging module) helps keep the bar lower for python developers entering
zope devleopment.  Having to learn new standard log levels, etc raises
that bar slightly.  My personal opinion is to not introduce more zope
packages when existing python modules are 99% sufficient.  And removing
existing zope packages (ie zLOG) when existing python modules are 99%
sufficient is a Very Good Thing TM.

So +1 on deprecating zLOG (and removing when possible) and not creating
a new zope logging package.

- Rocky


-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
ServerZen Hosting -- http://www.serverzenhosting.net
News About The Server -- http://www.serverzen.net

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope] Re: Java vs Zope

2006-01-04 Thread Rocky Burt
J Cameron Cooper wrote:
 ... I think it's quite acceptable to put the burden of use on the
 programmer instead of the compiler, considering the benefits; that's
 what he's thinking about anyway, no?

+1

 Zope 3, though I admit I've only played with it glancingly, seems to be
 more J2EE-like in certain respects: there seem to be a lot of things I
 have to touch to get things going. To a certain point, I can deal with
 this, but if there's ever a ZDoclet...

Lol, I remember so many times haveint to install XDoclet in order to
develop my EJB's in any sane amount of time.

But I understand and agree with your point here.  EJB development
required so much boilerplate code that it slowed the developer down big
time.  It took tools like XDoclet to come along and make the boilerplate
code somewhat manageable before developing with EJB's was very
productive IMHO.  I recently talked about this at:
http://www.serverzen.net/weblog/archive/2006/01/02/boilerplate-zope-projects

For the record (and as my blog entry mentions), Skeletor seems to strive
to be XDoclet for Zope2.

- Rocky

-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
ServerZen Hosting -- http://www.serverzenhosting.net
News About The Server -- http://www.serverzen.net

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope-dev] Re: [RfC] Removal of old stuff in Zope 2.10

2005-12-22 Thread Rocky Burt
Andreas Jung wrote:
 
 
 --On 22. Dezember 2005 15:20:27 +0100 robert rottermann
 [EMAIL PROTECTED] wrote:
 

 I perfectly agree with both of these arguments.
 However having a dead easy to use RDBMS tool is very convenient. Both
 for teaching and marketing purposes.
 
 
 
 I agree (meanwhile) but we have to sort out the issues I mentioned already
 (license, integration with Z 3, who volunteers :-))

Hmm... I'm definitely willing to help out here.  But one strike against
me is my lack of zope3 development knowledge.

When you mentioned before about importing sqlite into svn.zope.org, you
were talking about actually including a snapshot of sqlite inside zope
source rather than making it a build time requirement?

- Rocky



-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
ServerZen Hosting -- http://www.serverzenhosting.net
News About The Server -- http://www.serverzen.net

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: Product installation (implicit vs. explicit)

2005-12-22 Thread Rocky Burt
Chris McDonough wrote:
 The question is this: do you think there should be an explicit 
 install step for egg packages/Products or do you think it should be 
 possible to just put eggs on your PYTHONPATH (and perhaps adjust a 
 config file with requirements)?

To be honest, the explicit'ness of an external egg install process irks
me but I cannot really give a reason why (perhaps its just because I'm
used to having Zope2 products just work).

Also, with having to install eggs, how would this work with eggs that
are actually directories (that are formed like egg zip files) and
dealing with eggs from a development standpoint.  Does this mean they
would get copied some place?  Or just that something would be registered
into the zodb registering those eggs, etc...

- Rocky


-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
ServerZen Hosting -- http://www.serverzenhosting.net
News About The Server -- http://www.serverzen.net

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: Product installation (implicit vs. explicit)

2005-12-22 Thread Rocky Burt
Chris McDonough wrote:
 What do Java people expect from jar files (I ask as a Java dope)?  Do 
 they have a more limited scope (no dependencies, for example?)

Coming from a heavy java/j2ee background I can say that people in
java-land expect to place jar's on the java classpath (equivalent of
pythonpath) and they just work with regard to showing up on the classpath.

Taking this one step further, a Zope2 product egg would be closer to a
J2EE ear (Enterprise ARchive) file rather than a Java jar file.  An ear
file is basically a jar file with extra metadata stating that it follows
the appropriate conventions for j2ee deployment (basically instructions
on which parts of the ear file are for ejb management, more for web file
management, etc).

Now the best question is, do ear files get automatically configured and
installed by a j2ee server?  Answer: It depends.

This is comppletely up to the j2ee server implementation.  Orion and
JBoss for example (full j2ee implementations) have a special directory
where you can simply drop ear files and they get automatically get
picked up by the server and deployed as applications/components.

But, having said that, I know for a fact that the preferred manner to
configure an ear file with Orion is to do it explicitly in Orion's xml
configuration files.

Hopefully that sheds some light.

Regarding dependencies, no, jar/war/ear files (java's zip file types) do
not have dependency configuration although they do have the ability to
use something else if it exists (you can specify a Class-Path argument
in the manifest file).

- Rocky


-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
ServerZen Hosting -- http://www.serverzenhosting.net
News About The Server -- http://www.serverzen.net

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: [RfC] Removal of old stuff in Zope 2.10

2005-12-22 Thread Rocky Burt
Andreas Jung wrote:
 --On 22. Dezember 2005 11:42:30 -0330 Rocky Burt [EMAIL PROTECTED]
 wrote:
 When you mentioned before about importing sqlite into svn.zope.org, you
 were talking about actually including a snapshot of sqlite inside zope
 source rather than making it a build time requirement?

 
 I really don't care about how to do it..this would be up to the volunteer.
 But the license issue must be discussed since you are not allowed to import
 non-ZPL code to svn.zope.org.

Well, if we simply suck sqlite in as a build time requirement (during
the 'make' process) do we care about importing non-ZPL code into
svn.zope.org?  We would only care about licensing when distributing
binaries that include sqlite, no?

- Rocky


-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
ServerZen Hosting -- http://www.serverzenhosting.net
News About The Server -- http://www.serverzen.net

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: Directory structure on svn.zope.org

2005-12-22 Thread Rocky Burt
Andreas Jung wrote:
 The top-level directory structure on svn.zope.org appears a bit messy to
 me. There we have the folders for the large projects CMF, Zope, Zope3
 and lots
 modules that possibly don't belong there. Wouldn't it make sense to move
 them into a dedicated Zope3-modules folder (or choose another name)?


+1 on this... i would say a dedicated zope3-modules folder and a
dedicated zope2-modules folder (well, i don't care what the names are
either, but some toplevel containing folders).

- Rocky


-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
ServerZen Hosting -- http://www.serverzenhosting.net
News About The Server -- http://www.serverzen.net

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: [RfC] Removal of old stuff in Zope 2.10

2005-12-21 Thread Rocky Burt
Max M wrote:
 If there is another practical way to do it, that would be fine too. I
 don't know about sqllite. But if it's more difficulte than dropping a
 package into a directory it would be bad.
 

Personally I'd be a huge proponent of including SQLite in zope core.  It
is extraordinarilly functional and has few requirements.  I particularly
like using it to ensure unit tests against RDBMS connections work
properly.  Requiring a user to install postgresql just to run the unit
tests of a product is somewhat unfeasible.

- Rocky



-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
ServerZen Hosting -- http://www.serverzenhosting.net
News About The Server -- http://www.serverzen.net

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope] Re: zope db question

2005-12-21 Thread Rocky Burt

Hi José,

If you're learning how to use Zope then it'd be best (imho) for you to
learn how to do it with the ZODB (this is the 'default' way to store
data persistently in Zope).  Later on if you have a specific reason to
put this in a relational database (please, don't use gadfly) then it'll
be much easier for you to figure this out.

- Rocky


José Carlos Senciales Chaves wrote:
 Hi
  
 I am new phyton and zope programmer.
  
 I have to make a product for zope and i must use a list of groups with a
 lot of data.
  
 I´m wondering if i must to use a list of persistent objects or if it´s
 better use a database like
 gadfly with tables or another one.
  
 I´m a little confuse. I think that the two solutions are possible but i
 don´t know whitch is better.
  
 sorry for my bad english.
  
 thanks.
 jose from Spain, Europe.
 
 
 
 
 ___
 Zope maillist  -  Zope@zope.org
 http://mail.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists - 
  http://mail.zope.org/mailman/listinfo/zope-announce
  http://mail.zope.org/mailman/listinfo/zope-dev )


-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
ServerZen Hosting -- http://www.serverzenhosting.net
News About The Server -- http://www.serverzen.net

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope-dev] Re: svn.zope.org borked

2005-12-19 Thread Rocky Burt

Perhaps the backend should be switched from bdb to fsfs (native
subversion backend type) ?  I know it does away with a lot of these,
issues.

- Rocky

Jim Fulton wrote:
 Jens Vagelpohl wrote:
 

 On 19 Dec 2005, at 12:23, Andreas Jung wrote:

 I get always connection closed unexpectedly when using svn update.

 Andreas



 That %$£@ BerkeleyDB backend was geborken again. svnadmin recover 
 fixed it.
 
 
 Thanks!
 
 Jim
 


-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
ServerZen Hosting -- http://www.serverzenhosting.net
News About The Server -- http://www.serverzen.net

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] toplevel products folder in zope svn ?

2005-12-02 Thread Rocky Burt

Anyone know if there is any plan to add a toplevel products folder in
the zope svn repo like there currently is in zope's cvs repo?  I know
this has held up a few products from going from zope CVS to SVN.

- Rocky


-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
ServerZen Hosting -- http://www.serverzenhosting.net
News About The Server -- http://www.serverzen.net

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] RE: RFC: Reunite Zope 2 and Zope 3 inthe sourcecoderepository

2005-11-28 Thread Rocky Burt

Yes, I know that this is possible. But are you really proposing
to start a project like this? Or do you mean Five is going or should 
go in this direction?



It (or Zope 2 development in general, which is becoming indistinguishable
from Five) is going in this direction.


Just an outsider's naive comment on this:

These days all of my plone-based z2 products use z3 interfaces, adapters 
and views (via Five).  I look forward to using more five/z3 
functionality everyday (such as events, etc).


I'm sure this is still a long way from using pure z3, but with every new 
version of z2/z3/Five I hope to get closer and closer.


- Rocky


--
Rocky Burt
ServerZen Software -- http://www.serverzen.com
ServerZen Hosting -- http://www.serverzenhosting.net
News About The Server -- http://www.serverzen.net

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


[Zope-PAS] Re: question about user.getProperty()

2005-10-09 Thread Rocky Burt

Jens Vagelpohl wrote:


AFAIK getProperty for a user object does not exist in this form. You  
have to get the propertysheet and then the property.


jens

P.S.: Please don't confuse member and user. user is what the  
userfolder creates. member is a CMF/Plone thing only, it represents  a 
user wrapped in a member data wrapper. So if you're asking  specifically 
about member then you need to make the memberdata  class' 
getProperty as intelligent as you need yourself.



Ah yes, this was very much a problem of mine.  The item I was using 
was actually the user from the security manager.  This type of user 
only has the member data as property sheets.  But in my use-case, where 
I'm using this in a Plone environment, I can use the portal_memberdata 
(or was it portal_mebership?) tool to get the current member which is 
indeed a wrapped user.  And this member has a getProperty which indeed 
checks all propertysheets to retrieve the property you asked for.  So 
all is well.


Thanks.

- Rocky


--
Rocky Burt
ServerZen Software -- http://www.serverzen.com
ServerZen Hosting -- http://www.serverzenhosting.net
News About The Server -- http://serverzen.net

___
Zope-PAS mailing list
Zope-PAS@zope.org
http://mail.zope.org/mailman/listinfo/zope-pas


  1   2   >