[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/PluginIndexes/DateIndex/DateIndex.py Recreate the BTrees.Length.Length instance on a clear, like UnIndex-based

2005-11-30 Thread Martijn Pieters
Log message for revision 40426:
  Recreate the BTrees.Length.Length instance on a clear, like UnIndex-based
  indexes do; this way one can simply re-catalog a site upgraded from a Zope 2.7
  instance.
  

Changed:
  U   Zope/trunk/lib/python/Products/PluginIndexes/DateIndex/DateIndex.py

-=-
Modified: Zope/trunk/lib/python/Products/PluginIndexes/DateIndex/DateIndex.py
===
--- Zope/trunk/lib/python/Products/PluginIndexes/DateIndex/DateIndex.py 
2005-11-30 07:01:03 UTC (rev 40425)
+++ Zope/trunk/lib/python/Products/PluginIndexes/DateIndex/DateIndex.py 
2005-11-30 11:26:29 UTC (rev 40426)
@@ -20,6 +20,7 @@
 from datetime import tzinfo, timedelta
 from types import StringType, FloatType, IntType
 
+import BTrees.Length
 from BTrees.IIBTree import IISet, union, intersection, multiunion
 from BTrees.IOBTree import IOBTree
 from BTrees.OIBTree import OIBTree
@@ -111,7 +112,7 @@
  Complete reset 
 self._index = IOBTree()
 self._unindex = OIBTree()
-self._length.set(0)
+self._length = BTrees.Length.Length()
 
 def index_object( self, documentId, obj, threshold=None ):
 index an object, normalizing the indexed value to an integer

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


[Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/lib/python/Products/PluginIndexes/DateIndex/DateIndex.py Merge r 40426 from the trunk: make DateIndexes upgradeble from Zope 2.7 by way

2005-11-30 Thread Martijn Pieters
Log message for revision 40427:
  Merge r 40426 from the trunk: make DateIndexes upgradeble from Zope 2.7 by way
  of a re-index.
  

Changed:
  U   
Zope/branches/Zope-2_8-branch/lib/python/Products/PluginIndexes/DateIndex/DateIndex.py

-=-
Modified: 
Zope/branches/Zope-2_8-branch/lib/python/Products/PluginIndexes/DateIndex/DateIndex.py
===
--- 
Zope/branches/Zope-2_8-branch/lib/python/Products/PluginIndexes/DateIndex/DateIndex.py
  2005-11-30 11:26:29 UTC (rev 40426)
+++ 
Zope/branches/Zope-2_8-branch/lib/python/Products/PluginIndexes/DateIndex/DateIndex.py
  2005-11-30 12:32:05 UTC (rev 40427)
@@ -20,6 +20,7 @@
 from datetime import tzinfo, timedelta
 from types import StringType, FloatType, IntType
 
+import BTrees.Length
 from BTrees.IIBTree import IISet, union, intersection, multiunion
 from BTrees.IOBTree import IOBTree
 from BTrees.OIBTree import OIBTree
@@ -111,7 +112,7 @@
  Complete reset 
 self._index = IOBTree()
 self._unindex = OIBTree()
-self._length.set(0)
+self._length = BTrees.Length.Length()
 
 def index_object( self, documentId, obj, threshold=None ):
 index an object, normalizing the indexed value to an integer

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


[Zope-Checkins] SVN: Zope/branches/2.9/lib/python/Products/PluginIndexes/DateIndex/DateIndex.py Merge r 40426 from the trunk: make DateIndexes upgradeble from Zope 2.7 by way

2005-11-30 Thread Martijn Pieters
Log message for revision 40428:
  Merge r 40426 from the trunk: make DateIndexes upgradeble from Zope 2.7 by way
  of a re-index.
  

Changed:
  U   Zope/branches/2.9/lib/python/Products/PluginIndexes/DateIndex/DateIndex.py

-=-
Modified: 
Zope/branches/2.9/lib/python/Products/PluginIndexes/DateIndex/DateIndex.py
===
--- Zope/branches/2.9/lib/python/Products/PluginIndexes/DateIndex/DateIndex.py  
2005-11-30 12:32:05 UTC (rev 40427)
+++ Zope/branches/2.9/lib/python/Products/PluginIndexes/DateIndex/DateIndex.py  
2005-11-30 12:47:07 UTC (rev 40428)
@@ -20,6 +20,7 @@
 from datetime import tzinfo, timedelta
 from types import StringType, FloatType, IntType
 
+import BTrees.Length
 from BTrees.IIBTree import IISet, union, intersection, multiunion
 from BTrees.IOBTree import IOBTree
 from BTrees.OIBTree import OIBTree
@@ -111,7 +112,7 @@
  Complete reset 
 self._index = IOBTree()
 self._unindex = OIBTree()
-self._length.set(0)
+self._length = BTrees.Length.Length()
 
 def index_object( self, documentId, obj, threshold=None ):
 index an object, normalizing the indexed value to an integer

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


[Zope-Checkins] SVN: Zope/branches/tseaver-collector_1774/lib/python/AccessControl/ My original patch, with tests.

2005-11-30 Thread Tres Seaver
Log message for revision 40431:
  My original patch, with tests.

Changed:
  U   
Zope/branches/tseaver-collector_1774/lib/python/AccessControl/ImplPython.py
  U   
Zope/branches/tseaver-collector_1774/lib/python/AccessControl/cAccessControl.c
  U   
Zope/branches/tseaver-collector_1774/lib/python/AccessControl/interfaces.py
  U   
Zope/branches/tseaver-collector_1774/lib/python/AccessControl/tests/testZopeSecurityPolicy.py

-=-
Modified: 
Zope/branches/tseaver-collector_1774/lib/python/AccessControl/ImplPython.py
===
--- Zope/branches/tseaver-collector_1774/lib/python/AccessControl/ImplPython.py 
2005-11-30 22:40:15 UTC (rev 40430)
+++ Zope/branches/tseaver-collector_1774/lib/python/AccessControl/ImplPython.py 
2005-11-30 22:43:01 UTC (rev 40431)
@@ -34,6 +34,7 @@
 
 from AccessControl import SecurityManagement
 from AccessControl import Unauthorized
+from AccessControl.interfaces import ISecurityPolicy
 from AccessControl.interfaces import ISecurityManager
 from AccessControl.SimpleObjectPolicies import Containers, _noroles
 from AccessControl.ZopeGuards import guarded_getitem
@@ -199,6 +200,8 @@
 
 class ZopeSecurityPolicy:
 
+implements(ISecurityPolicy)
+
 def __init__(self, ownerous=1, authenticated=1, verbose=0):
 Create a Zope security policy.
 
@@ -459,12 +462,28 @@
 raise Unauthorized(name, value)
 
 def checkPermission(self, permission, object, context):
-# XXX proxy roles and executable owner are not checked
 roles = rolesForPermissionOn(permission, object)
 if isinstance(roles, basestring):
 roles = [roles]
-return context.user.allowed(object, roles)
+result = context.user.allowed(object, roles)
 
+# check executable owner and proxy roles
+stack = context.stack
+if stack:
+eo = stack[-1]
+if self._ownerous:
+owner = eo.getOwner()
+if (owner is not None) and not owner.allowed(object, roles):
+return 0
+proxy_roles = getattr(eo, '_proxy_roles', None)
+if proxy_roles:
+if object is not aq_base(object):
+if not owner._check_context(object):
+return 0
+for r in proxy_roles:
+if r in roles:
+return 1
+return result
 
 # AccessControl.SecurityManager
 # -

Modified: 
Zope/branches/tseaver-collector_1774/lib/python/AccessControl/cAccessControl.c
===
--- 
Zope/branches/tseaver-collector_1774/lib/python/AccessControl/cAccessControl.c  
2005-11-30 22:40:15 UTC (rev 40430)
+++ 
Zope/branches/tseaver-collector_1774/lib/python/AccessControl/cAccessControl.c  
2005-11-30 22:43:01 UTC (rev 40431)
@@ -1292,61 +1292,200 @@
 */
 
 static PyObject *ZopeSecurityPolicy_checkPermission(PyObject *self,
-   PyObject *args) {
+PyObject *args) {
 
-   PyObject *permission = NULL;
-   PyObject *object = NULL;
-   PyObject *context = NULL;
-   PyObject *roles;
-   PyObject *result = NULL;
-   PyObject *user;
+/* return value */
+PyObject *rval = NULL;
 
-   /*| def checkPermission(self, permission, object, context)
-   */
+/* arguments, not increfe'd */
+PyObject *permission = NULL;
+PyObject *object = NULL;
+PyObject *context = NULL;
 
-   if (unpacktuple3(args, checkPermission, 3, 
+/* locals, XDECREF at exit */
+PyObject *roles = NULL;
+PyObject *user = NULL;
+PyObject *stack = NULL;
+PyObject *eo = NULL;
+PyObject *owner = NULL;
+PyObject *proxy_roles = NULL;
+PyObject *method = NULL;
+PyObject *wrappedowner = NULL;
+PyObject *objectbase = NULL;
+PyObject *incontext = NULL;
+
+int contains = 0;
+int iRole;
+int length;
+
+/*| def checkPermission(self, permission, object, context)
+*/
+
+if (unpacktuple3(args, checkPermission, 3, 
  permission, object, context)  0)
-   return NULL;
+return NULL;
 
-   /*| roles = rolesForPermissionOn(permission, object)
-   */
+/*| roles = rolesForPermissionOn(permission, object)
+*/
 
-   roles = c_rolesForPermissionOn(permission, object, NULL, NULL);
-   if (roles == NULL)
+roles = c_rolesForPermissionOn(permission, object, NULL, NULL);
+if (roles == NULL)
   return NULL;
 
-   /*| if type(roles) in (StringType, UnicodeType):
-   **| roles = [roles]
-   */
+/*| if type(roles) in (StringType, UnicodeType):
+**| roles = [roles]
+*/
 
-   if ( PyString_Check(roles) || PyUnicode_Check(roles) ) {
-  PyObject *r;
+if ( PyString_Check(roles) || PyUnicode_Check(roles) ) {
+  PyObject 

[Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/lib/python/Products/SiteAccess/SiteRoot.py Fixed #1960. Simplified dumb useless dialog.

2005-11-30 Thread Florent Guillaume
Log message for revision 40432:
  Fixed #1960. Simplified dumb useless dialog.

Changed:
  U   Zope/branches/Zope-2_8-branch/lib/python/Products/SiteAccess/SiteRoot.py

-=-
Modified: 
Zope/branches/Zope-2_8-branch/lib/python/Products/SiteAccess/SiteRoot.py
===
--- Zope/branches/Zope-2_8-branch/lib/python/Products/SiteAccess/SiteRoot.py
2005-11-30 22:43:01 UTC (rev 40431)
+++ Zope/branches/Zope-2_8-branch/lib/python/Products/SiteAccess/SiteRoot.py
2005-11-30 22:55:29 UTC (rev 40432)
@@ -98,9 +98,7 @@
 self.__init__(title, base, path)
 if REQUEST:
 return MessageDialog(title='SiteRoot changed.',
-  message='The title is now %sbr'
-  'The base is now %sbr'
-  'The path is now %sbr' % map(escape, (title, base, 
path)),
+  message='SiteRoot changed.',
   action='%s/manage_main' % REQUEST['URL1'])
 
 def __call__(self, client, request, response=None):

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


[Zope-Checkins] SVN: Zope/branches/2.9/lib/python/Products/SiteAccess/SiteRoot.py Fixed #1960. Simplified dumb useless dialog.

2005-11-30 Thread Florent Guillaume
Log message for revision 40433:
  Fixed #1960. Simplified dumb useless dialog.

Changed:
  U   Zope/branches/2.9/lib/python/Products/SiteAccess/SiteRoot.py

-=-
Modified: Zope/branches/2.9/lib/python/Products/SiteAccess/SiteRoot.py
===
--- Zope/branches/2.9/lib/python/Products/SiteAccess/SiteRoot.py
2005-11-30 22:55:29 UTC (rev 40432)
+++ Zope/branches/2.9/lib/python/Products/SiteAccess/SiteRoot.py
2005-11-30 22:57:33 UTC (rev 40433)
@@ -98,9 +98,7 @@
 self.__init__(title, base, path)
 if REQUEST:
 return MessageDialog(title='SiteRoot changed.',
-  message='The title is now %sbr'
-  'The base is now %sbr'
-  'The path is now %sbr' % map(escape, (title, base, 
path)),
+  message='SiteRoot changed.',
   action='%s/manage_main' % REQUEST['URL1'])
 
 def __call__(self, client, request, response=None):

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


[Zope-Checkins] SVN: Zope/branches/tseaver-collector_1774/lib/python/AccessControl/ImplPython.py Ensure that in the presence of proxy roles, if none match, then lose.

2005-11-30 Thread Tres Seaver
Log message for revision 40436:
  Ensure that in the presence of proxy roles, if none match, then lose.
  
  Use the wrapped owner when testing context inside proxy roles.
  
  Therfore, move check of user's roles to end, since  proxy roles make the 
user's
  roles irrelevant.  This also simplifies the C version, as well, since we don't
  need to worry about setting the result back to NULL if we haven't assigned it
  when an error occurs.
  
  Incorporate comments from the C version (so that correspondence is clearer).
  

Changed:
  U   
Zope/branches/tseaver-collector_1774/lib/python/AccessControl/ImplPython.py

-=-
Modified: 
Zope/branches/tseaver-collector_1774/lib/python/AccessControl/ImplPython.py
===
--- Zope/branches/tseaver-collector_1774/lib/python/AccessControl/ImplPython.py 
2005-11-30 23:20:42 UTC (rev 40435)
+++ Zope/branches/tseaver-collector_1774/lib/python/AccessControl/ImplPython.py 
2005-11-30 23:35:15 UTC (rev 40436)
@@ -465,26 +465,38 @@
 roles = rolesForPermissionOn(permission, object)
 if isinstance(roles, basestring):
 roles = [roles]
-result = context.user.allowed(object, roles)
 
 # check executable owner and proxy roles
 stack = context.stack
 if stack:
 eo = stack[-1]
+# If the executable had an owner, can it execute?
 if self._ownerous:
 owner = eo.getOwner()
 if (owner is not None) and not owner.allowed(object, roles):
+# We don't want someone to acquire if they can't 
+# get an unacquired!
 return 0
 proxy_roles = getattr(eo, '_proxy_roles', None)
 if proxy_roles:
-if object is not aq_base(object):
-if not owner._check_context(object):
-return 0
+# Verify that the owner actually can state the proxy role
+# in the context of the accessed item; users in subfolders
+# should not be able to use proxy roles to access items 
+# above their subfolder!
+owner = eo.getWrappedOwner()
+if owner is not None:
+if object is not aq_base(object):
+if not owner._check_context(object):
+# object is higher up than the owner, 
+# deny access
+return 0
 for r in proxy_roles:
 if r in roles:
 return 1
-return result
+return 0
 
+return context.user.allowed(object, roles)
+
 # AccessControl.SecurityManager
 # -
 

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


[Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/lib/python/AccessControl/tests/testZopeGuards.py Clean up after ourselves.

2005-11-30 Thread Tres Seaver
Log message for revision 40438:
  Clean up after ourselves.

Changed:
  U   
Zope/branches/Zope-2_8-branch/lib/python/AccessControl/tests/testZopeGuards.py

-=-
Modified: 
Zope/branches/Zope-2_8-branch/lib/python/AccessControl/tests/testZopeGuards.py
===
--- 
Zope/branches/Zope-2_8-branch/lib/python/AccessControl/tests/testZopeGuards.py  
2005-11-30 23:52:43 UTC (rev 40437)
+++ 
Zope/branches/Zope-2_8-branch/lib/python/AccessControl/tests/testZopeGuards.py  
2005-12-01 01:55:42 UTC (rev 40438)
@@ -419,10 +419,13 @@
 _old_mgr = _old_policy = _marker = []
 
 def setUp(self):
-pass
+self._wrapped_dicts = []
 
 def tearDown( self ):
 self._restorePolicyAndManager()
+for munged, orig in self._wrapped_dicts:
+munged.update(orig)
+del self._wrapped_dicts
 
 def _initPolicyAndManager(self, manager=None):
 from AccessControl.SecurityManagement import get_ident
@@ -668,6 +671,8 @@
 # tell whether they're executed.
 def _wrap_replaced_dict_callables(self, d):
 import __builtin__
+orig = d.copy()
+self._wrapped_dicts.append((d, orig))
 for k, v in d.items():
 if callable(v) and v is not getattr(__builtin__, k, None):
 d[k] = FuncWrapper(k, v)

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


[Zope-Checkins] SVN: Zope/branches/2.9/lib/python/AccessControl/tests/testZopeGuards.py Clean up after ourselves.

2005-11-30 Thread Tres Seaver
Log message for revision 40439:
  Clean up after ourselves.

Changed:
  U   Zope/branches/2.9/lib/python/AccessControl/tests/testZopeGuards.py

-=-
Modified: Zope/branches/2.9/lib/python/AccessControl/tests/testZopeGuards.py
===
--- Zope/branches/2.9/lib/python/AccessControl/tests/testZopeGuards.py  
2005-12-01 01:55:42 UTC (rev 40438)
+++ Zope/branches/2.9/lib/python/AccessControl/tests/testZopeGuards.py  
2005-12-01 01:59:12 UTC (rev 40439)
@@ -395,10 +395,13 @@
 _old_mgr = _old_policy = _marker = []
 
 def setUp(self):
-pass
+self._wrapped_dicts = []
 
 def tearDown( self ):
 self._restorePolicyAndManager()
+for munged, orig in self._wrapped_dicts:
+munged.update(orig)
+del self._wrapped_dicts
 
 def _initPolicyAndManager(self, manager=None):
 from AccessControl.SecurityManagement import get_ident
@@ -644,6 +647,8 @@
 # tell whether they're executed.
 def _wrap_replaced_dict_callables(self, d):
 import __builtin__
+orig = d.copy()
+self._wrapped_dicts.append((d, orig))
 for k, v in d.items():
 if callable(v) and v is not getattr(__builtin__, k, None):
 d[k] = FuncWrapper(k, v)

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


[Zope-Checkins] SVN: Zope/trunk/lib/python/AccessControl/tests/testZopeGuards.py Clean up after ourselves.

2005-11-30 Thread Tres Seaver
Log message for revision 40440:
  Clean up after ourselves.

Changed:
  U   Zope/trunk/lib/python/AccessControl/tests/testZopeGuards.py

-=-
Modified: Zope/trunk/lib/python/AccessControl/tests/testZopeGuards.py
===
--- Zope/trunk/lib/python/AccessControl/tests/testZopeGuards.py 2005-12-01 
01:59:12 UTC (rev 40439)
+++ Zope/trunk/lib/python/AccessControl/tests/testZopeGuards.py 2005-12-01 
02:15:15 UTC (rev 40440)
@@ -395,10 +395,13 @@
 _old_mgr = _old_policy = _marker = []
 
 def setUp(self):
-pass
+self._wrapped_dicts = []
 
 def tearDown( self ):
 self._restorePolicyAndManager()
+for munged, orig in self._wrapped_dicts:
+munged.update(orig)
+del self._wrapped_dicts
 
 def _initPolicyAndManager(self, manager=None):
 from AccessControl.SecurityManagement import get_ident
@@ -644,6 +647,8 @@
 # tell whether they're executed.
 def _wrap_replaced_dict_callables(self, d):
 import __builtin__
+orig = d.copy()
+self._wrapped_dicts.append((d, orig))
 for k, v in d.items():
 if callable(v) and v is not getattr(__builtin__, k, None):
 d[k] = FuncWrapper(k, v)

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


Re: [Zope-dev] Re: DateTime mess

2005-11-30 Thread Lennart Regebro
On 11/30/05, Jens Vagelpohl [EMAIL PROTECTED] wrote:
 +1 on a dedicated migration step. Might even be a chance for some
 other cleanups.

So the process would be something like:

1. Make a FrankenDateTime that uses the pickles of the DateTime, but
the methods of datetime.
2. Make a zope.datetime module with the enhancements we want.
3. Immediately deprecate FrankenDateTime for zope.datetime.
4. Two versions later (2.12) remov the FrankenDateTime and make a
migration step necessary for the continued use of the ZODBs.

Or?

Hmm. I guess step 1 is strictly speaking optional, but then we would
have to live with the broken DateTime for some time...
--
Lennart Regebro, Nuxeo http://www.nuxeo.com/
CPS Content Management http://www.cps-project.org/
___
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: DateTime mess

2005-11-30 Thread Jens Vagelpohl


On 30 Nov 2005, at 08:20, Lennart Regebro wrote:


On 11/30/05, Jens Vagelpohl [EMAIL PROTECTED] wrote:

+1 on a dedicated migration step. Might even be a chance for some
other cleanups.


So the process would be something like:

1. Make a FrankenDateTime that uses the pickles of the DateTime, but
the methods of datetime.
2. Make a zope.datetime module with the enhancements we want.
3. Immediately deprecate FrankenDateTime for zope.datetime.
4. Two versions later (2.12) remov the FrankenDateTime and make a
migration step necessary for the continued use of the ZODBs.


Or maybe...

1) Create zope.datetime the way we want it
2) Extend DateTime to also satisfy the zope.datetime API
3) Deprecate the non-zope.datetime API in DateTime to make people use  
the zope.datetime API (if not the objects themselves)
4) Two versions later, migrate all remaining DateTime objects to  
zope.datetime


jens

___
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] DateTime iso8601 bad handling of dates

2005-11-30 Thread Evan Simpson
This has been brought up and (rather cavalierly) dismissed before.  I
challenge anyone to justify the following DateTime behavior:

 DateTime('2005-01-01').strftime('%Y-%m-%d')
'2004-12-31'

DateTimes are actually timestamps, and the current implementation
assumes that a date in ISO8601 format without a timezone specifier is
UTC rather than local.

It was asserted, last time this came up, that this is compliant with the
ISO8601 spec, but my own research shows this to be false.  If someone
can point me to a truly authoritative source that supports the current
behavior, I would appreciate it, but that would not change the fact that
the manifested behavior is *broken*.

This is a simple two-line fix, folks.  I've already done it on my
production systems.

Cheers,

Evan @ 4-am

___
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] zope.conf extensibility

2005-11-30 Thread Sidnei da Silva
This might be the third time I hit this issue, and I've always given
up before. I hope this is the last time.

I have some product that would greatly benefit from being able to be
configured from within zope.conf. I don't want a separate
configuration file. Period.

Why? Apache doesn't have separate configuration files for mod_cache or
mod_anything.

Chris McDonough has used the %import feature on ClockServer product,
but that just works because zopeschema.xml has a multisection
definition for ZServer.server type.

I think it would be very useful for zopeschema.xml to have a
multisection for some abstract type to allow third-party product to
define their own section type extending this abstract type and thus
have their configuration kept inside zope.conf

Consider this a proposal *wink*.

-- 
Sidnei da Silva
Enfold Systems, LLC.
http://enfoldsystems.com
___
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] Folderish or SimpleItem object types for structural content

2005-11-30 Thread Dieter Maurer
Martijn Jacobs wrote at 2005-11-29 22:09 +0100:
 ...
That will be true, but I was wondering where to draw the line,  for 
example with perfomance issues. All the objects will be in a ZCatalog, 
to allow searching for example. But one 'ObjectManager' step less in the 
choice what to do with the products results in much less objects in the 
catalog.

This must be a funny classification scheme...

But anyway: I have a completely different strategy for you:
lets see whether you will like it.

You do not materialize the classification scheme at all but you
have only your leaves (let's call them objects).

Each object has its classification as an attribute, say category.
A category thus has the form topic/subtopic/subsubtopc/

You index the category with a PathIndex (I would recommend
my Managable PathIndex) and use canned searches (so called topics)
the recreate the classification structure via searches (if needed).


If you do the last step (use topics for the complete recreation of the
classification structure), then the number of objects will
not decrease (what formerly was a classification folder is now
a topic). But the new structure is much more flexible.
You can now assign different categories (say along different
dimensions) to your objects and will get different hierarchical (topical)
views on your object set.


The estimation about the amount of objects, with only the leave 
nodes as 'SimpleItem' objects will be 30.000. I never had so many 
objects in a ZODB, that's why I'm asking this, but as your answer 
suggests it's still the preferred way.

30.000 is not yet very impressing.

And, how large will be your classification scheme?
Usually, such a scheme is *much* smaller than the classified items
(if the lowest classification level had one (or very few) element,
if would be superfluous). Adding it would give a few more thousand
objects in addition -- you would get 31.000 (or maybe 35.000)
instead of 30.000. Do not be worried about this...


You should take care to use the correct folder implementation, however.
As soon as a folder is likely to have more than a few dozen of objects,
you should use a BTreeFolder2 rather than a normal folder.
The total number of ZODB objects will go up by this choice
(but you already learned that you need not to worry about this)
but access is much more efficient (if the folder contains large numbers
of children).

-- 
Dieter
___
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] zope.conf extensibility

2005-11-30 Thread Fred Drake
On 11/30/05, Sidnei da Silva [EMAIL PROTECTED] wrote:
 I have some product that would greatly benefit from being able to be
 configured from within zope.conf. I don't want a separate
 configuration file. Period.

Tres Seaver and I implemented this during the Goldegg sprint in
Fredericksburg, which we provided a location for.  This should be in
Zope 2.9.

I don't know that there's any real documentation for this.  Feel free
to add some.


  -Fred

--
Fred L. Drake, Jr.fdrake at gmail.com
There is no wealth but life. --John Ruskin
___
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] zope.conf extensibility

2005-11-30 Thread Sidnei da Silva
On Wed, Nov 30, 2005 at 03:55:22PM -0500, Fred Drake wrote:
| On 11/30/05, Sidnei da Silva [EMAIL PROTECTED] wrote:
|  I have some product that would greatly benefit from being able to be
|  configured from within zope.conf. I don't want a separate
|  configuration file. Period.
| 
| Tres Seaver and I implemented this during the Goldegg sprint in
| Fredericksburg, which we provided a location for.  This should be in
| Zope 2.9.
| 
| I don't know that there's any real documentation for this.  Feel free
| to add some.

I haven't seen this being checked in at all, maybe it's in Tres
laptop?

-- 
Sidnei da Silva
Enfold Systems, LLC.
http://enfoldsystems.com
___
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] zope.conf extensibility

2005-11-30 Thread Fred Drake
On 11/30/05, Sidnei da Silva [EMAIL PROTECTED] wrote:
 I haven't seen this being checked in at all, maybe it's in Tres
 laptop?

These were committed to the trunk before the 2.9 branch was created:


r39652 | tseaver | 2005-10-26 15:10:40 -0400 (Wed, 26 Oct 2005) | 1 line

Allow custom section types to play in product-config.

r39635 | tseaver | 2005-10-26 12:09:59 -0400 (Wed, 26 Oct 2005) | 7 lines

Added a 'product-config' section type to zope.conf, allowing arbitrary
key-value mappings.

Products can look for such confgiurations to set product-specific options
(see the example 'product-config' section in skel/etc/zope.conf.in
for sample usage).


  -Fred

--
Fred L. Drake, Jr.fdrake at gmail.com
There is no wealth but life. --John Ruskin
___
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] zope.conf extensibility

2005-11-30 Thread Sidnei da Silva
On Wed, Nov 30, 2005 at 04:27:11PM -0500, Fred Drake wrote:
| On 11/30/05, Sidnei da Silva [EMAIL PROTECTED] wrote:
|  I haven't seen this being checked in at all, maybe it's in Tres
|  laptop?
| 
| These were committed to the trunk before the 2.9 branch was created:
| 
| 
| r39652 | tseaver | 2005-10-26 15:10:40 -0400 (Wed, 26 Oct 2005) | 1 line
| 
| Allow custom section types to play in product-config.
| 
| r39635 | tseaver | 2005-10-26 12:09:59 -0400 (Wed, 26 Oct 2005) | 7 lines
| 
| Added a 'product-config' section type to zope.conf, allowing arbitrary
| key-value mappings.
| 
| Products can look for such confgiurations to set product-specific options
| (see the example 'product-config' section in skel/etc/zope.conf.in
| for sample usage).

Oh, thanks! Missed that one.

-- 
Sidnei da Silva
Enfold Systems, LLC.
http://enfoldsystems.com
___
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] Folderish or SimpleItem object types for structural content

2005-11-30 Thread Martijn Jacobs


Hello Dieter.


This must be a funny classification scheme...
 

Well, I wanted to have the discussion to be general about this thing 
because I can imagine that this issue has been some point of discussion 
before, among others, but I will be more specific to explain :
- The structure will have categories within categories. (hierarchical 
categories)
- Each category can have custom properties which can be 'inherited' by 
the aqcuisition feature of zope.

- Within the categories you have object's.
- Each object can derive his properties through acquisition, or have 
their own properties (or override the acquisiton properties)
- Each object will have item groups,  with their own properties / 
files / comments / etc.
- Each item group will contain  items, each item will have 
properties, but also can have properties derived through acquisition 
from categories and objects :  so these items will all have different 
properties, depending in which category they exist.


With this rules I was thinking about the next structure :

Category (Object Manager, within other Categories) - Object (Object 
Manager) - Item Group (Object Manager) - Item (Simple Item)



But anyway: I have a completely different strategy for you:
lets see whether you will like it.

You do not materialize the classification scheme at all but you
have only your leaves (let's call them objects).

Each object has its classification as an attribute, say category.
A category thus has the form topic/subtopic/subsubtopc/

You index the category with a PathIndex (I would recommend
my Managable PathIndex) and use canned searches (so called topics)
the recreate the classification structure via searches (if needed).


If you do the last step (use topics for the complete recreation of the
classification structure), then the number of objects will
not decrease (what formerly was a classification folder is now
a topic). But the new structure is much more flexible.
You can now assign different categories (say along different
dimensions) to your objects and will get different hierarchical (topical)
views on your object set.
 

I have been thinking about this kind of structure to use for this 
specific project. But there is a problem that occures (too) often (in my 
experience) with this approach. By doing this you really are depending 
on the ZCatalog : If some conflict errors occure or for some reason the 
objects are not indexed (correctly) or not updated, some important 
information is not available for the user. I have experienced alot of 
problems with unindexed objects, or not reindexed objects due to 
'random' conflict errors'.  By making a complete hierarchical structure 
using 'Object Managers', you can always assure that data is accessible, 
and if the ZCatalog is not up to date, only the search results will not 
represent the actual structure.



30.000 is not yet very impressing.
 

That's good to know. It's hard to say offcourse, but what is in some way 
a 'limit' of the number of objects, for instance, if they all have to be 
indexed? Indexing objects uses ALOT of CPU time for example... In which 
amount of objects should you reconsider your design? (Speaking of a 
'general' guideline)



You should take care to use the correct folder implementation, however.
As soon as a folder is likely to have more than a few dozen of objects,
you should use a BTreeFolder2 rather than a normal folder.
 

I've used the BTreeFolder2 before for a single folder containing large 
number of objects, and indeed, it's really boosting the perfomance a lot...


Well thanks again for your thoughts, it helps in breaking patterns I'm 
used too,  let's reconsider it using some external input :)



Kind regards,

Martijn.


--
Martijn Jacobs
Four Digits, internet solutions
e-mail: [EMAIL PROTECTED] | web: http://www.fourdigits.nl
tel: +31 (0)26 44 22 700 | fax: +31 (0)84 22 06 117

___
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 in the source code repository

2005-11-30 Thread Chris Withers

Martin Aspeli wrote:
... and I'm one of those developers. I care, for the moment, about one  
thing: Plone. I want Plone to move to use more Zope 3 technology, sure,  
because it's clearly superior. But we're not going to re-write it from  
scratch, and neither, I suspect, will most large Z2 applications. 


That I don't know about. Plone probably should, for a number of reasons, 
but I guess it's quite a hard problem to tackle...


So my  
path to Z3 is through Z2, by way of Five. Frankly, without that 
migration  path, Z3 is nice and pretty and architecturally very cool and 
totally  irrelevant to me. 


Indeed, but why does that mean people in Z3-land who feel the same way 
as you about Z2 and Plone should have to put up with looking after all 
of Z2? ;)


cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
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] RFC: Reunite Zope 2 and Zope 3 in the source code repository

2005-11-30 Thread Chris Withers

Stephan Richter wrote:

On Thursday 24 November 2005 09:17, Jim Fulton wrote:


Now (well, after the December release :), I think it's time to revisit
what the core of Zope 3 is and how we manage the repository.  There has
been a trend to manage important components separately and link them in.  I
see this trend continuing.  The advent of eggs and continuing maturation of
zpkg and testing technology will accelerate this trend, IMO.

I think that in the future, there may be a much smaller core Zope 3 project
that represents the object filing system (zope.ofs? :). This core project
may be a client of a collection of much smaller projects, such as
zope.interface, zope.component. etc..  If that vision comes to pass, Zope 2
will no longer contain the Zope 3 core, but they will both share a large
number of components which neither of them contain. Obviously,  this
would radically change the nature of this debate.



I was counting on you making exactly this suggestion. :-) I agree with all of 
that.


+lots ;-)

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
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: [Zope3-dev] RFC: Reunite Zope 2 and Zope 3 in the source coderepository

2005-11-30 Thread Chris Withers

Philipp von Weitershausen wrote:


Bottom line: I find the risk of your having to dig through horrible Zope 2 code 
much lower
than the chance of joint efforts on Zope 3 technology. Of course, it'd be quite 
surprising
if I didn't believe that as the author of the proposal *wink*.


I agree with the points your raise but I worry about the arrival of the 
pragmatists and making nasty botch jobs to help out some half broken 
code in Zope or Plone...


cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
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] common datetime

2005-11-30 Thread Chris Withers

Alexander Limi wrote:

Can I add use a common datetime implementation? ;)


Philipp is already working on this :-)
(and I'm keen to help out too, if there's a sane way for me to do so...)

cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
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: [Zope3-dev] RFC: Reunite Zope 2 and Zope 3 in the source code repository

2005-11-30 Thread Chris Withers

Gary Poster wrote:

Zope 2 depends on Zope 3, via Five.  Zope 3 does not depend on Zope 2.


A very good point, but one which makes me feel that Zope 2 shouldn't be 
merged in with Zope 3 ;-)


Put differently, if we're merging in Zope 2 into the repository, then 
why not SchoolTool, or any of the other projects that _use_ Zope 3?


Zope 2 devs don't have to touch Zope 3 unless they want to leverage  
some cool new feature--in which case they are Zope Five devs,  
probably.  Zope 3 devs must touch Zope 2, in this new world order,  
whether they want to or not, when changes break the stuff that Zope 2  
has leveraged.


I don't agree. Again, if Zope 3 changes break SchoolTool, is that a Zope 
3 developer problem or a SchoolTool problem? FOrcing the maintenance of 
Zope 2 onto the already overloaded Zope 3 devs seems a little unfair...


The question here is effectively whether all Zope 3 developers must  
become Zope 'Five' developers.  As you said, Zope 2 developers can  
choose to proceed essentially unaffected.  Zope 3 devs could not.


And this for me, means that even if the repos merge, so evil 
svn:externals can be avoided, the tests should not be run together on 
the Zope 3 side, and Zope 3 should come bundled with Zope 2, even if 
Zope 2 comes bundled with Zope 3 and Five!


cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
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: [Zope3-dev] RFC: Reunite Zope 2 and Zope 3 in the source coderepository

2005-11-30 Thread Chris Withers

Lennart Regebro wrote:

I think this change can possibly make sense when we have replaced Zope
2 authentication with Zope 3s, and when we have replaces Zope 2
publisher with Zope 3s and when we have replaced the Zope 2 traversal
with Zope3s, and maybe a couple of other things.

At that point, Zope2 will more or less be Zope3 + App, DateTime, OFS,
Products and some other stuff. Then something more of a merge might
make sense.


This is a really really good point ;-)
I think unification is probably a good idea, but not yet...

Even so, I'd much prefer to see Z3 stay light of Zope 2 and just have 
Zope 2 become smaller and smaller as it leverages more and more of Zope 3.


Put differently, I have no problem with the repositories merging, but 
I'd like to see the bits of Zope 3 seperately available, without Z2. I 
know ZPT and testbrowser already work like that, and the more that works 
like that the better...


Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
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: [Zope3-dev] RFC: Reunite Zope 2 and Zope 3 in the source coderepository

2005-11-30 Thread Chris Withers

Stephan Richter wrote:
* We have been constantly trying to make the trunk smaller, and suddenly we 
blow it up? This does not fit. In fact, I would claim that zwiki and 
bugtracker should now be moved out of the trunk and placed into top-level 
dirs themselves. They should be tested using the buildbot.


This is a very very good point...

* I have a fear that people will be motivated to make Zope 3 changes to make 
them work better with Zope 2, inserting special code just for Zope 2. 


Another good point.

cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
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: DateTime mess

2005-11-30 Thread Philipp von Weitershausen
Tres Seaver wrote:
 Frankly, anything which attempts to fix pickles in-place smells bad to
 me.  Dump and reload is how the RDBMS world handles this kind of
 problem, and it isn't because they don't have smart folks working on them.
 
  You're right, as nice as generations might be, they can't work around
  some of the architectural flaws of the ZODB.

 I wouldn't call them flaws;  schema changes are *hard* in RDBMS land, too.

Of course; this is what I meant to intend with the quoation marks.

  And, of course, they've not been battle tested, but who's going to
  battle test them until they are battle tested? Chicken... egg... :).
 
  So, do I take it that you're suggesting the upgrade strategy should
  entail some sort of dump/reload?

 Yes, and for a perfect example of why (not related to DateTime, just to
 fix-in-place in general) prosecution calls  zope.org.

   Pros:  Is it true that you harbor pickles from software which
  pre-dates the original public release of the PTK, almost
  six years ago?

   Witness (sobbing):  Yes!  Yes!  it is true.  They could have cleaned
  me out by doing a data migration into a fresh ZODB, but they
  thought they were clever enough to update me in place.  I feel
  so *used*!

:)

By the way, would it be possible to just dump DateTime objects to some format 
and reload
them as datetime.datetime w/o having to operate on the whole database? Also, 
would the
GenericSetup infrastructure help here?

Maybe-I-should-read-some-docs-ly,

Philipp



This message was sent using IMP, the Internet Messaging Program.
___
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] here/content

2005-11-30 Thread Dieter Maurer
John Poltorak wrote at 2005-11-30 01:32 +:
Can someone tell me how 'here/content' is translated in these lines?

span tal:define=stx 
python:modules['Products'].PythonScripts.standard.structured_text;
   the_text here/content
   tal:content=structure python:stx(the_text)

The structured text goes here.

/span

here (i.e. the object viewed via the template) is asked
for content (calling here.restrictedTraverse('content')).
If the result is callable, it is called.
The result is bound to the_text.

When I use the URL  'www.mysite.org' the above resolves fine, but if I use 
'www.mysite.org:8080/mysite' I get a 'Resource not found' when selecting 
the same link from the homepage of the same site. Is there something I've 
overlooked?

This either means that your problem is elsewhere or that the here
are different in both cases.

-- 
Dieter
___
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 )


Re: [Zope] Re: Zope 2.8.4 strange behavior

2005-11-30 Thread Dieter Maurer
Florent Guillaume wrote at 2005-11-30 01:51 +0100:
 ... sending keepalive messages to ZEO ...

Why not use the max-disconnect-poll option of the zeoclient section in 
zope.conf ?

Our solution is quite old. At that time, there was definitely no
max-disconnect-poll yet.

In addition, max-disconnect-poll seems to target a completely different
use case: to control the time between connection attempts.

In our case, a connection was successfully established. However,
the firewall may cut it if it is inactive for a too long period --
in a way not noticed by the endpoints.

Thus, we must prevent the connection from being idle too long --
e.g. with a keepalive mechanism.


I think, Tim wanted to implement such a keep alive mechanism
inside ClientStorage (to reliably detect disconnects) but
in ZODB 3.4 it seems not yet available.

-- 
Dieter
___
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 )


Re: [Zope] Creating a DTM Document in a variable folder.

2005-11-30 Thread Jonathan Cyr




You might want to use index_html
rather than index.html in this example. The dot means other things in
Python, and index.html is a carryover from filesystem webservers. My
impression is that the acquisition mechanism doesn't like ids with a
dot, in some circumstances.

Not trying to nit-pick, just got hung-up on that item myself once
before.

...or maybe that's not true anymore and has been allowed for...

HTH,

-Jon



Peter Bengtsson wrote:

  folder = getattr(context, 'b')
adder = folder.manage_addProduct['OFSP'].methodAdd
adder('index.html', 'Some title')

That creates it with default content. To change it you'll have to call
dtmlm = getattr(context, 'index.html')
dtmlm.manage_edit("bla bla bla bla bla", 'Same title')
# or
f = open('/tmp/foobar.html')
dtmlm.manage_upload(f)




On 11/25/05, Martin Koekenberg [EMAIL PROTECTED] wrote:
  
  
 Hello,

I don't have any Python experience yet, so who has a solution for this
'problem'.

 Example:

I 've 3 folders a, b  c.
I want to create a dtml document in a folder by a form. The folder is a
variable in my form.
 The formis no problem, the form action is no problem. The python script to
craete that document is my problem.

 How can I create a DTM Document in a variable container ?

 Regards,

 Martin Koekenberg

___
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 )




  
  

--
Peter Bengtsson,
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com
___
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 )

  


-- 
Jonathan Cyr
http://www.cyr.info
http://www.weddingweblog.com
[EMAIL PROTECTED]


___
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 )


Re: [Zope] Re: Zope 2.8.4 strange behavior

2005-11-30 Thread Paul Winkler
On Wed, Nov 30, 2005 at 08:40:34PM +0100, Dieter Maurer wrote:
 Florent Guillaume wrote at 2005-11-30 01:51 +0100:
  ... sending keepalive messages to ZEO ...
 
 Why not use the max-disconnect-poll option of the zeoclient section in 
 zope.conf ?
 
 Our solution is quite old. At that time, there was definitely no
 max-disconnect-poll yet.

Aside from that, it's not even mentioned anywhere but ZODB/component.xml
so I had no idea it existed until now.

 In addition, max-disconnect-poll seems to target a completely different
 use case: to control the time between connection attempts.

I see. Thanks very much for your suggestion, Dieter - 
I'll look into that. It certainly sounds like we have the same symptom.

-- 

Paul Winkler
http://www.slinkp.com
___
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 )


Re: [Zope] Creating a DTM Document in a variable folder.

2005-11-30 Thread J Cameron Cooper

Jonathan Cyr wrote:
You might want to use index_html rather than index.html in this 
example.  The dot means other things in Python, and index.html is a 
carryover from filesystem webservers.  My impression is that the 
acquisition mechanism doesn't like ids with a dot, in some circumstances.


Not trying to nit-pick, just got hung-up on that item myself once before.

...or maybe that's not true anymore and has been allowed for...


That just means you can't traverse to it with attribute notation. For 
instance::


 self.plone.index.html

will not look for 'index.html' but rather the 'html' inside 'index'.

Same goes for dashes::

 self.plone.try-me

will try to subtract the value of the 'me' variable from the value of 
'self.plone.try'. But usually it will fail in trying to look up the 
first value.


In such cases, you can use subscript notation::

 self.plone['try-me']

or getattr (which doesn't use acquisition.)

--jcc


Peter Bengtsson wrote:


folder = getattr(context, 'b')
adder = folder.manage_addProduct['OFSP'].methodAdd
adder('index.html', 'Some title')

That creates it with default content. To change it you'll have to call
dtmlm = getattr(context, 'index.html')
dtmlm.manage_edit(bla bla bla bla bla, 'Same title')
# or
f = open('/tmp/foobar.html')
dtmlm.manage_upload(f)




On 11/25/05, Martin Koekenberg [EMAIL PROTECTED] wrote:
 


Hello,

I don't have any Python experience yet, so who has a solution for this
'problem'.

Example:

I 've 3 folders a, b  c.
I want to create a dtml document in a folder by a form. The folder is a
variable in my form.
The formis no problem, the form action is no problem. The python script to
craete that document is my problem.

How can I create a DTM Document in a variable container ?

Regards,

Martin Koekenberg

___
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 )



   




--
Peter Bengtsson,
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com
___
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 )

 



--
Jonathan Cyr
http://www.cyr.info
http://www.weddingweblog.com
[EMAIL PROTECTED]




___
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 )



--
Building Websites with Plone
http://plonebook.packtpub.com/

Enfold Systems, LLC
http://www.enfoldsystems.com
___
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 )


Re: [Zope] unicode problem

2005-11-30 Thread Maurits van Rees
On Wed, Nov 30, 2005 at 02:12:07PM +0100, [EMAIL PROTECTED] wrote:


 I've created a folder a put some dtml-methods, External python
 scripts and a Formulator Forms. It had worked fine till I put the
 Form's xml page the following line:
 actionint_bev_feldolgoz/action
 int_bev_feldolgoz is dtml method and at the moment only shows the
 value of REQUEST
 Having seen the result of this method I wanted to back to edit the
 content of the folder, but I couldn't continue. The following error
 message was displayed:
 Error Type: UnicodeEncodeError
 Error Value: 'latin-1' codec can't encode character u'\u0170' in position 
 22895: ordinal not in range(256)
 
 What shall I do? I don't want start it from scratch. All dtml-method
 with unicode characters worked smoothly. (Debian Sarge Zope2.7)

I had an issue with unicode a few weeks back and could solve it thanks
to the list, so it might help you to review this thread:

http://mail.zope.org/pipermail/zope/2005-September/161900.html

Partly that thread is about (Re)StructuredText, but don't let yourself
be thrown off by that.

You may want to check if your Python scripts do some explicit unicode
encoding, like this:

sometext = unicode(some_other_text,'iso-8859-1').encode('utf-8')

And you may have to change your Python's default encoding or have a
look at etc/zope.conf in your zope instance.

HTH,

-- 
Maurits van Rees | http://maurits.vanrees.org/ [Dutch/Nederlands] 
Public GnuPG key:  http://maurits.vanrees.org/var/gpgkey.asc
Make no little plans; they have no magic to stir men's blood and
probably in themselves will not be realized. Make big plans.
---Daniel Hudson Burnham.


signature.asc
Description: Digital signature
___
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] PHPGateway Issues

2005-11-30 Thread Asad Habib
Hello. I am trying to use PHPGateway with Zope but I get the following 
error:


'/usr/bin/php' may not be a PHP-CGI program. The result from the program 
is empty(0 byte).



Also, sometimes I get the error 'File Not Found' that is thrown by 
the browser. Has anyone successfully used this product with Zope and are 
there documents which cover common errors and solutions?


Lastly, I am running on Mac OS X Tiger Server which comes 
with PHP 4 and I am running Zope 2.7.0. Can I use this copy of PHP or do I 
have to download and build my own from source? Any help would be 
appreciated. Thanks.

___
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 )


Re: [Zope] Re: Zope 2.8.4 strange behavior

2005-11-30 Thread Tim Peters
[Dieter Maurer]
 ...
 I think, Tim wanted to implement such a keep alive mechanism
 inside ClientStorage (to reliably detect disconnects) but
 in ZODB 3.4 it seems not yet available.

Right on all counts:  I would like to add that, because it's currently
possible for ZEO to run forever without noticing a connection is
dead (when the OS/whatever doesn't inform it of socket death); this is
especially damning for clients that normally don't try to commit
changes, as they can continue serving stale cached content
indefinitely.  And it's not in ZODB 3.4.  It's not in ZODBs 3.5 or 3.6
either -- haven't had time to work on it.
___
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] Displaying pdf

2005-11-30 Thread Rick Smith

Perhaps someone can point me in the right direction.

I am trying to display a pdf file (actually stored in LocalFS) from a
python script.  To do this my approach (probably there's a better way) is :-

RESPONSE.setHeader('Content-Type','application/pdf')
RESPONSE.redirect(path)

My main problem is that  on some occasions the file is properly opened
in acrobat (I'm using firefox on linux, but similar effects are obtained
using ie6/windows), while on other occasions raw pdf is displayed in the
browser field with a content-type of text/html. I'm unable to see any
difference to explain this difference - the documents are all scanned in
the same way and imported into acrobat in the same way, yet Zope (I
presume) interprets them as have differing content-type.

I presume that this problem would go away if I didn't use the redirect.
I'm sure it's blindingly obvious but I can't see how to do it another
way.  I'd also be happy to display the pdf within an html document/frame
but my knowledge of html is missing something at this point...

Please help me in my weakness...

Rick

.




___ 
WIN ONE OF THREE YAHOO! VESPAS - Enter now! - http://uk.cars.yahoo.com/features/competitions/vespa.html

___
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 )


Re: [Zope] Displaying pdf

2005-11-30 Thread Peter Bengtsson
Why the fancy RESPONSE stuff. What's wrong with just clicking on the pdf URL?
Or like this from a python script called showPDF()

pdffile = getattr(context, 'some.pdf')
return pdffile

On 12/1/05, Rick Smith [EMAIL PROTECTED] wrote:
 Perhaps someone can point me in the right direction.

 I am trying to display a pdf file (actually stored in LocalFS) from a
 python script.  To do this my approach (probably there's a better way) is :-

 RESPONSE.setHeader('Content-Type','application/pdf')
 RESPONSE.redirect(path)

 My main problem is that  on some occasions the file is properly opened
 in acrobat (I'm using firefox on linux, but similar effects are obtained
 using ie6/windows), while on other occasions raw pdf is displayed in the
 browser field with a content-type of text/html. I'm unable to see any
 difference to explain this difference - the documents are all scanned in
 the same way and imported into acrobat in the same way, yet Zope (I
 presume) interprets them as have differing content-type.

 I presume that this problem would go away if I didn't use the redirect.
 I'm sure it's blindingly obvious but I can't see how to do it another
 way.  I'd also be happy to display the pdf within an html document/frame
 but my knowledge of html is missing something at this point...

 Please help me in my weakness...

 Rick

 .




 ___
 WIN ONE OF THREE YAHOO! VESPAS - Enter now! - 
 http://uk.cars.yahoo.com/features/competitions/vespa.html
 ___
 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 )



--
Peter Bengtsson,
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com
___
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 )


Re: [Zope] Question about Stepper

2005-11-30 Thread Chris Withers

Jens Vagelpohl wrote:


Pardon my stupidity but is Chris Withers' Stepper the right thing  for 
me...?


yes


What he said ;-)


The call to sendAllUnsent() I would prefer if it was done
asyncronously in case it takes several seconds. I could accomplish
this by having a cron job calling it every 5 minutes but ldeally I
don't want to rely on cron for this setup. Is Stepper the right thing
for me?


Stepper still needs cron. It is not a cron replacement.


...but it does make building a cron job that does stuff with Zope a 
whole lot easier, and covers all the edge cases you'd forget ;-)


cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
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 )


Re: [Zope] DateTime mess

2005-11-30 Thread Chris Withers

A piece of code calls bobobase_modification_time() which currently
returns a DateTime; after that the piece of code calls some
DateTime-specific methods on the returned object. Now in Zope 2.12 we
make bobobase_modification_time() return a datetime.datetime and
subsequently the piece of code would fail. There are a lot of pieces of
code like this in third party products...


Good point, I don't see a nice way around this though :-S
Your frankendatetime is one possibility, but for me it feels just as 
nasty as the scenario you describe above :-S



We could deprecate DateTime now to warn people about that. But then
their product would only either work with Zope 2.12 or with Zope 2.12
(depending on whether it still expects the DateTime API or the
datetime.datetime API); it would not with both versions. That's a harsh
upgrade plan and it would probably take ages before people would adopt
Zope 2.12.


Yup...


With a frankendatetime in Zope 2.10, however, they could still call
DateTime-specific methods on the return value of
bobobase_modification_time(). They'd get deprecation warnings telling
them to use the datetime.datetime API instead. That would work
instantly, not only in Zope 2.12. That way they could smoothly upgrade
their products.


OK, I'm convinced, _if_ you can make it work ;-)


By the way, I've come to think that touching the current DateTime
implementation wouldn't be a good idea, mostly because of the old
pickles issue. 


My thoughts exactly.



The frankendatetime should be a separate class that
subclasses datetime.datetime, provides old-style DateTime compatability
and has datetime.datetime-compatible pickles.


sounds good to me :-)

cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
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 )


Re: [Zope] Epoz interface not showing in my web page...

2005-11-30 Thread Chris Withers
I'd suggest contact the epoz author directly, of finding an epoz mailing 
list...


Chris

Allen Huang wrote:

I have integrated Epoz module into my product director and reboot ZOPE.
   
  At first it was alright at first, but I started getting call telling me that all the Epoz module shows is the save change button. I had a look through my browser and it was alright, but it just display anything besides the botton on some computers...
   
  Can anyone tell me what is wrong? 



-
 Yahoo! Music Unlimited - Access over 1 million songs. Try it free.




___
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 )


--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
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 )