[Zope-Checkins] SVN: Zope/branches/philikon-aq-and-__parent__/lib/python/Acquisition/tests.py Added a test to Acquisition that shows the current segmentation fault problem, when Acquisition goes in c

2007-05-06 Thread Hanno Schlichting
Log message for revision 75578:
  Added a test to Acquisition that shows the current segmentation fault 
problem, when Acquisition goes in circles.
  

Changed:
  U   Zope/branches/philikon-aq-and-__parent__/lib/python/Acquisition/tests.py

-=-
Modified: 
Zope/branches/philikon-aq-and-__parent__/lib/python/Acquisition/tests.py
===
--- Zope/branches/philikon-aq-and-__parent__/lib/python/Acquisition/tests.py
2007-05-06 16:49:33 UTC (rev 75577)
+++ Zope/branches/philikon-aq-and-__parent__/lib/python/Acquisition/tests.py
2007-05-06 17:41:06 UTC (rev 75578)
@@ -1998,6 +1998,37 @@
   True
 """
 
+def test___parent__aq_parent_cycles():
+"""
+Sometimes __parent__ pointers and normal Acquisition can cause aq_chains
+to go in circles:
+
+  >>> class Expl(Acquisition.Explicit):
+  ... hello = 'world'
+
+  >>> class Expl2(Acquisition.Explicit):
+  ... hello = 'world2'
+
+  >>> x = Expl()
+  >>> y = Expl2().__of__(x)
+  >>> x.__parent__ = y
+
+  >>> x.__parent__.aq_base is y.aq_base
+  True
+
+  >>> x.__parent__.__parent__ is x
+  True
+
+  >>> Acquisition.aq_get(x, 'hello')
+  'world'
+
+  XXX This causes a segmentation fault, as some tests in Products.Five do
+  as well
+  >>> Acquisition.aq_get(x, 'hello2')
+  
+
+"""
+
 import unittest
 from zope.testing.doctest import DocTestSuite
 

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


[Zope-Checkins] SVN: Zope/branches/2.10/ Collector #2320: HTTPResponse setHeader lowercased keys but getHeader did not, causing lookups of 'Content-Type' to fail

2007-05-06 Thread Hanno Schlichting
Log message for revision 75581:
  Collector #2320: HTTPResponse setHeader lowercased keys but getHeader did 
not, causing lookups of 'Content-Type' to fail
  

Changed:
  U   Zope/branches/2.10/doc/CHANGES.txt
  U   Zope/branches/2.10/lib/python/ZPublisher/HTTPResponse.py
  U   Zope/branches/2.10/lib/python/ZPublisher/tests/testHTTPResponse.py

-=-
Modified: Zope/branches/2.10/doc/CHANGES.txt
===
--- Zope/branches/2.10/doc/CHANGES.txt  2007-05-06 19:47:41 UTC (rev 75580)
+++ Zope/branches/2.10/doc/CHANGES.txt  2007-05-06 19:47:41 UTC (rev 75581)
@@ -8,6 +8,9 @@
 
 Bugs fixed
 
+  - Collector #2320: HTTPResponse setHeader lowercased keys but getHeader
+did not, causing lookups of 'Content-Type' to fail
+
   - Collector #2321: Skip trusted proxies when extracting the client IP
 address from the request.
 

Modified: Zope/branches/2.10/lib/python/ZPublisher/HTTPResponse.py
===
--- Zope/branches/2.10/lib/python/ZPublisher/HTTPResponse.py2007-05-06 
19:47:41 UTC (rev 75580)
+++ Zope/branches/2.10/lib/python/ZPublisher/HTTPResponse.py2007-05-06 
19:47:41 UTC (rev 75581)
@@ -247,8 +247,7 @@
 Sets an HTTP return header "name" with value "value", clearing
 the previous value set for the header, if one exists. If the
 literal flag is true, the case of the header name is preserved,
-otherwise word-capitalization will be performed on the header
-name on output.'''
+otherwise the header name will be lowercased.'''
 name = str(name)
 value = str(value)
 key = name.lower()
@@ -259,6 +258,18 @@
 name = literal and name or key
 self.headers[name] = value
 
+def getHeader(self, name, literal=0):
+'''\
+Get a header value
+
+Returns the value associated with a HTTP return header, or
+"None" if no such header has been set in the response
+yet. If the literal flag is true, the case of the header name is
+preserved, otherwise the header name will be lowercased.'''
+key = name.lower()
+name = literal and name or key
+return self.headers.get(name, None)
+
 def addHeader(self, name, value):
 '''\
 Set a new HTTP return header with the given value, while retaining

Modified: Zope/branches/2.10/lib/python/ZPublisher/tests/testHTTPResponse.py
===
--- Zope/branches/2.10/lib/python/ZPublisher/tests/testHTTPResponse.py  
2007-05-06 19:47:41 UTC (rev 75580)
+++ Zope/branches/2.10/lib/python/ZPublisher/tests/testHTTPResponse.py  
2007-05-06 19:47:41 UTC (rev 75581)
@@ -77,6 +77,23 @@
 response.appendHeader('XXX', 'foo')
 self.assertEqual(response.headers.get('xxx'), 'bar,\n\tfoo')
 
+def test_setHeader(self):
+response = self._makeOne()
+response.setHeader('foo', 'bar')
+self.assertEqual(response.getHeader('foo'), 'bar')
+self.assertEqual(response.headers.get('foo'), 'bar')
+response.setHeader('SPAM', 'eggs')
+self.assertEqual(response.getHeader('spam'), 'eggs')
+self.assertEqual(response.getHeader('SPAM'), 'eggs')
+
+def test_setHeader_literal(self):
+response = self._makeOne()
+response.setHeader('foo', 'bar', literal=True)
+self.assertEqual(response.getHeader('foo'), 'bar')
+response.setHeader('SPAM', 'eggs', literal=True)
+self.assertEqual(response.getHeader('SPAM', literal=True), 'eggs')
+self.assertEqual(response.getHeader('spam'), None)
+
 def test_setStatus_ResourceLockedError(self):
 response = self._makeOne()
 from webdav.Lockable import ResourceLockedError

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


[Zope-Checkins] SVN: Zope/trunk/ Merged from 2.10 branch - Collector #2320: HTTPResponse setHeader lowercased keys but getHeader did not, causing lookups of 'Content-Type' to fail

2007-05-06 Thread Hanno Schlichting
Log message for revision 75582:
  Merged from 2.10 branch - Collector #2320: HTTPResponse setHeader lowercased 
keys but getHeader did not, causing lookups of 'Content-Type' to fail
  

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  U   Zope/trunk/lib/python/ZPublisher/HTTPResponse.py
  U   Zope/trunk/lib/python/ZPublisher/tests/testHTTPResponse.py

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===
--- Zope/trunk/doc/CHANGES.txt  2007-05-06 19:47:41 UTC (rev 75581)
+++ Zope/trunk/doc/CHANGES.txt  2007-05-06 19:58:13 UTC (rev 75582)
@@ -97,6 +97,9 @@
 
 Bugs Fixed
 
+  - Collector #2320: HTTPResponse setHeader lowercased keys but getHeader
+did not, causing lookups of 'Content-Type' to fail
+
   - Collector #2307: ObjectCopiedEvent not dispatched to sublocations.
 
   - Collector #2298: webdav.Resource.COPY and webdav.Resource.MOVE did

Modified: Zope/trunk/lib/python/ZPublisher/HTTPResponse.py
===
--- Zope/trunk/lib/python/ZPublisher/HTTPResponse.py2007-05-06 19:47:41 UTC 
(rev 75581)
+++ Zope/trunk/lib/python/ZPublisher/HTTPResponse.py2007-05-06 19:58:13 UTC 
(rev 75582)
@@ -247,8 +247,7 @@
 Sets an HTTP return header "name" with value "value", clearing
 the previous value set for the header, if one exists. If the
 literal flag is true, the case of the header name is preserved,
-otherwise word-capitalization will be performed on the header
-name on output.'''
+otherwise the header name will be lowercased.'''
 
 name = str(name)
 value = str(value)
@@ -260,6 +259,18 @@
 name = literal and name or key
 self.headers[name] = value
 
+def getHeader(self, name, literal=0):
+'''\
+Get a header value
+
+Returns the value associated with a HTTP return header, or
+"None" if no such header has been set in the response
+yet. If the literal flag is true, the case of the header name is
+preserved, otherwise the header name will be lowercased.'''
+key = name.lower()
+name = literal and name or key
+return self.headers.get(name, None)
+
 def addHeader(self, name, value):
 '''\
 Set a new HTTP return header with the given value, while retaining

Modified: Zope/trunk/lib/python/ZPublisher/tests/testHTTPResponse.py
===
--- Zope/trunk/lib/python/ZPublisher/tests/testHTTPResponse.py  2007-05-06 
19:47:41 UTC (rev 75581)
+++ Zope/trunk/lib/python/ZPublisher/tests/testHTTPResponse.py  2007-05-06 
19:58:13 UTC (rev 75582)
@@ -77,6 +77,23 @@
 response.appendHeader('XXX', 'foo')
 self.assertEqual(response.headers.get('xxx'), 'bar,\n\tfoo')
 
+def test_setHeader(self):
+response = self._makeOne()
+response.setHeader('foo', 'bar')
+self.assertEqual(response.getHeader('foo'), 'bar')
+self.assertEqual(response.headers.get('foo'), 'bar')
+response.setHeader('SPAM', 'eggs')
+self.assertEqual(response.getHeader('spam'), 'eggs')
+self.assertEqual(response.getHeader('SPAM'), 'eggs')
+
+def test_setHeader_literal(self):
+response = self._makeOne()
+response.setHeader('foo', 'bar', literal=True)
+self.assertEqual(response.getHeader('foo'), 'bar')
+response.setHeader('SPAM', 'eggs', literal=True)
+self.assertEqual(response.getHeader('SPAM', literal=True), 'eggs')
+self.assertEqual(response.getHeader('spam'), None)
+
 def test_setStatus_ResourceLockedError(self):
 response = self._makeOne()
 from webdav.Lockable import ResourceLockedError

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


[Zope-Checkins] SVN: Zope/branches/philikon-aq-and-__parent__/lib/python/Acquisition/ First attempt to fix 'Acquisition problem' when encountering cyclic hierarchies via __parent__ pointers. [hannosc

2007-06-01 Thread Hanno Schlichting
Log message for revision 76140:
  First attempt to fix 'Acquisition problem' when encountering cyclic 
hierarchies via __parent__ pointers. [hannosch, nouri]
  

Changed:
  U   
Zope/branches/philikon-aq-and-__parent__/lib/python/Acquisition/_Acquisition.c
  U   Zope/branches/philikon-aq-and-__parent__/lib/python/Acquisition/tests.py

-=-
Modified: 
Zope/branches/philikon-aq-and-__parent__/lib/python/Acquisition/_Acquisition.c
===
--- 
Zope/branches/philikon-aq-and-__parent__/lib/python/Acquisition/_Acquisition.c  
2007-06-01 20:55:13 UTC (rev 76139)
+++ 
Zope/branches/philikon-aq-and-__parent__/lib/python/Acquisition/_Acquisition.c  
2007-06-01 22:49:26 UTC (rev 76140)
@@ -574,7 +574,16 @@
 {
   ASSIGN(self->container, newWrapper(self->container, r,
  (PyTypeObject*)&Wrappertype));
+
+  /* Don't try to get any attributes when the parent object of the
+ parent object is the same as the object itself. */
+  if (WRAPPER(r)->obj==WRAPPER(self)->obj) {
+Py_DECREF(r);
+PyErr_SetObject(PyExc_AttributeError,oname);
+return NULL;
+  }
   Py_DECREF(r); /* don't need __parent__ anymore */
+
   r=Wrapper_findattr((Wrapper*)self->container,
  oname, filter, extra, orig, sob, sco, explicit, 
  containment);

Modified: 
Zope/branches/philikon-aq-and-__parent__/lib/python/Acquisition/tests.py
===
--- Zope/branches/philikon-aq-and-__parent__/lib/python/Acquisition/tests.py
2007-06-01 20:55:13 UTC (rev 76139)
+++ Zope/branches/philikon-aq-and-__parent__/lib/python/Acquisition/tests.py
2007-06-01 22:49:26 UTC (rev 76140)
@@ -2010,23 +2010,20 @@
   ... hello = 'world2'
 
   >>> x = Expl()
-  >>> y = Expl2().__of__(x)
+  >>> y = Expl2()
   >>> x.__parent__ = y
+  >>> y.__parent__ = x
 
-  >>> x.__parent__.aq_base is y.aq_base
-  True
-
   >>> x.__parent__.__parent__ is x
   True
 
   >>> Acquisition.aq_get(x, 'hello')
   'world'
 
-  XXX This causes a segmentation fault, as some tests in Products.Five do
-  as well
-  >>> Acquisition.aq_get(x, 'hello2')
-  
-
+  >>> Acquisition.aq_get(x, 'hello2') #doctest:+ELLIPSIS
+  Traceback (most recent call last):
+  ...
+  AttributeError: hello2
 """
 
 import unittest

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


[Zope-Checkins] SVN: Zope/branches/philikon-aq-and-__parent__/lib/python/Shared/DC/Scripts/Bindings.py Added comment that marks the place in UnauthorizedBinding where the one test failure happens in

2007-06-17 Thread Hanno Schlichting
Log message for revision 76749:
  Added comment that marks the place in UnauthorizedBinding where the one test 
failure happens in test_bound_used_context_method_w_roles and why that might 
happen.
  

Changed:
  U   
Zope/branches/philikon-aq-and-__parent__/lib/python/Shared/DC/Scripts/Bindings.py

-=-
Modified: 
Zope/branches/philikon-aq-and-__parent__/lib/python/Shared/DC/Scripts/Bindings.py
===
--- 
Zope/branches/philikon-aq-and-__parent__/lib/python/Shared/DC/Scripts/Bindings.py
   2007-06-17 22:47:32 UTC (rev 76748)
+++ 
Zope/branches/philikon-aq-and-__parent__/lib/python/Shared/DC/Scripts/Bindings.py
   2007-06-17 23:06:57 UTC (rev 76749)
@@ -179,7 +179,14 @@
 # Make *extra* sure that the wrapper isn't used to access
 # __call__, etc.
 if name.startswith('__'):
-self.__you_lose()
+if name == '__parent__':
+# XXX For some reason the test in testBindings calls __parent__
+# for bound_used_context_methodWithRoles_ps.
+# I couldn't figure out why it tries that, but guess that it
+# tried aq_parent so far.
+pass
+else:
+self.__you_lose()
 
 return guarded_getattr(self._wrapped, name, default)
 #return getattr(self._wrapped, name, default)

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


[Zope-Checkins] SVN: Zope/branches/philikon-aq-and-__parent__/lib/python/Shared/DC/Scripts/Bindings.py Note result from comparing the code with Zope trunk.

2007-06-17 Thread Hanno Schlichting
Log message for revision 76750:
  Note result from comparing the code with Zope trunk.
  

Changed:
  U   
Zope/branches/philikon-aq-and-__parent__/lib/python/Shared/DC/Scripts/Bindings.py

-=-
Modified: 
Zope/branches/philikon-aq-and-__parent__/lib/python/Shared/DC/Scripts/Bindings.py
===
--- 
Zope/branches/philikon-aq-and-__parent__/lib/python/Shared/DC/Scripts/Bindings.py
   2007-06-17 23:06:57 UTC (rev 76749)
+++ 
Zope/branches/philikon-aq-and-__parent__/lib/python/Shared/DC/Scripts/Bindings.py
   2007-06-18 01:02:19 UTC (rev 76750)
@@ -182,8 +182,9 @@
 if name == '__parent__':
 # XXX For some reason the test in testBindings calls __parent__
 # for bound_used_context_methodWithRoles_ps.
-# I couldn't figure out why it tries that, but guess that it
-# tried aq_parent so far.
+# I couldn't figure out why it tries that. So far it tried to
+# call methodWithRoles twice. Now it's only called once and
+# __parent__ is called the second time.
 pass
 else:
 self.__you_lose()

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


[Zope-Checkins] SVN: Zope/branches/philikon-aq-and-__parent__/lib/python/Shared/DC/Scripts/Bindings.py Found and fixed the you_lose problem found during tests for the UnauthorizedBinding. We define o

2007-06-18 Thread Hanno Schlichting
Log message for revision 76770:
  Found and fixed the you_lose problem found during tests for the 
UnauthorizedBinding. We define our own __parent__ method on it now. See more 
explanation in the comment.
  

Changed:
  U   
Zope/branches/philikon-aq-and-__parent__/lib/python/Shared/DC/Scripts/Bindings.py

-=-
Modified: 
Zope/branches/philikon-aq-and-__parent__/lib/python/Shared/DC/Scripts/Bindings.py
===
--- 
Zope/branches/philikon-aq-and-__parent__/lib/python/Shared/DC/Scripts/Bindings.py
   2007-06-18 19:50:08 UTC (rev 76769)
+++ 
Zope/branches/philikon-aq-and-__parent__/lib/python/Shared/DC/Scripts/Bindings.py
   2007-06-18 21:12:32 UTC (rev 76770)
@@ -175,19 +175,18 @@
 def __repr__(self):
 return '' % self._name
 
+def __parent__(self):
+# Acquisition will nowadays try to do an getattr on all objects which
+# aren't Acquisition wrappers asking for a __parent__ pointer. We need
+# to provide a fake one, or our normal __getattr__ method will be used
+# and fail as __parent__ starts with a __.
+return None
+
 def __getattr__(self, name, default=None):
 # Make *extra* sure that the wrapper isn't used to access
 # __call__, etc.
 if name.startswith('__'):
-if name == '__parent__':
-# XXX For some reason the test in testBindings calls __parent__
-# for bound_used_context_methodWithRoles_ps.
-# I couldn't figure out why it tries that. So far it tried to
-# call methodWithRoles twice. Now it's only called once and
-# __parent__ is called the second time.
-pass
-else:
-self.__you_lose()
+self.__you_lose()
 
 return guarded_getattr(self._wrapped, name, default)
 #return getattr(self._wrapped, name, default)

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


[Zope-Checkins] SVN: Products.Five/branches/philikon-aq-and-__parent__/ Make a branch of Five from trunk at r70998 for the aq vs. __parent__ work

2007-06-18 Thread Hanno Schlichting
Log message for revision 76771:
  Make a branch of Five from trunk at r70998 for the aq vs. __parent__ work
  

Changed:
  A   Products.Five/branches/philikon-aq-and-__parent__/

-=-
Copied: Products.Five/branches/philikon-aq-and-__parent__ (from rev 76770, 
Products.Five/trunk)

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


[Zope-Checkins] SVN: Products.Five/branches/philikon-aq-and-__parent__/ Removed dead branch again, Five trunk is empty...

2007-06-18 Thread Hanno Schlichting
Log message for revision 76772:
  Removed dead branch again, Five trunk is empty...
  

Changed:
  D   Products.Five/branches/philikon-aq-and-__parent__/

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


[Zope-Checkins] SVN: Products.Five/branches/philikon-aq-and-__parent__/ Next attempt of making a branch of Five trunk, now from r70998. Including the Five from Zope trunk turned out to be to difficul

2007-06-18 Thread Hanno Schlichting
Log message for revision 76773:
  Next attempt of making a branch of Five trunk, now from r70998. Including the 
Five from Zope trunk turned out to be to difficult because of various other 
changes...
  

Changed:
  A   Products.Five/branches/philikon-aq-and-__parent__/

-=-
Copied: Products.Five/branches/philikon-aq-and-__parent__ (from rev 70998, 
Products.Five/trunk)

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


[Zope-Checkins] SVN: Zope/branches/philikon-aq-and-__parent__/lib/python/Products/ Use our own new branch of Five

2007-06-18 Thread Hanno Schlichting
Log message for revision 76774:
  Use our own new branch of Five
  

Changed:
  _U  Zope/branches/philikon-aq-and-__parent__/lib/python/Products/

-=-

Property changes on: 
Zope/branches/philikon-aq-and-__parent__/lib/python/Products
___
Name: svn:externals
   - Five-r 70998 svn://svn.zope.org/repos/main/Products.Five/trunk

   + Five 
svn+ssh://svn.zope.org/repos/main/Products.Five/branches/philikon-aq-and-__parent__


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


[Zope-Checkins] SVN: Products.Five/branches/philikon-aq-and-__parent__/browser/providerexpression.py Added explanation about the last test failure that happens with providerexpressions / viewlets.

2007-06-18 Thread Hanno Schlichting
Log message for revision 76775:
  Added explanation about the last test failure that happens with 
providerexpressions / viewlets.
  

Changed:
  U   
Products.Five/branches/philikon-aq-and-__parent__/browser/providerexpression.py

-=-
Modified: 
Products.Five/branches/philikon-aq-and-__parent__/browser/providerexpression.py
===
--- 
Products.Five/branches/philikon-aq-and-__parent__/browser/providerexpression.py 
2007-06-18 23:12:16 UTC (rev 76774)
+++ 
Products.Five/branches/philikon-aq-and-__parent__/browser/providerexpression.py 
2007-06-18 23:16:56 UTC (rev 76775)
@@ -24,6 +24,11 @@
 if provider is None:
 raise cp_interfaces.ContentProviderLookupError(name)
 
+# XXX We can either wrap this in the context and have three test
+# failures in directives.txt or wrap it in the view (aka our
+# __parent__) and have one test failure in provider.txt which also
+# happens when we don't wrap this at all anymore :(
+# Removing all the AQ-wrapping is probably the way to go here.
 if getattr(provider, '__of__', None) is not None:
 provider = provider.__of__(context)
 

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


[Zope-Checkins] SVN: Zope/branches/philikon-aq-and-__parent__/lib/python/Shared/DC/Scripts/Bindings.py Turned method into a property, as per philiKON's suggestion.

2007-06-24 Thread Hanno Schlichting
Log message for revision 77023:
  Turned method into a property, as per philiKON's suggestion.
  

Changed:
  U   
Zope/branches/philikon-aq-and-__parent__/lib/python/Shared/DC/Scripts/Bindings.py

-=-
Modified: 
Zope/branches/philikon-aq-and-__parent__/lib/python/Shared/DC/Scripts/Bindings.py
===
--- 
Zope/branches/philikon-aq-and-__parent__/lib/python/Shared/DC/Scripts/Bindings.py
   2007-06-24 19:37:05 UTC (rev 77022)
+++ 
Zope/branches/philikon-aq-and-__parent__/lib/python/Shared/DC/Scripts/Bindings.py
   2007-06-25 00:01:39 UTC (rev 77023)
@@ -172,16 +172,16 @@
 __allow_access_to_unprotected_subobjects__ = 1
 __roles__ = _what_not_even_god_should_do
 
+# Acquisition will nowadays try to do an getattr on all objects which
+# aren't Acquisition wrappers, asking for a __parent__ pointer. We need
+# to provide a fake one, or our normal __getattr__ method will be used
+# and fail as __parent__ starts with a __.
+
+__parent__ = None
+
 def __repr__(self):
 return '' % self._name
 
-def __parent__(self):
-# Acquisition will nowadays try to do an getattr on all objects which
-# aren't Acquisition wrappers asking for a __parent__ pointer. We need
-# to provide a fake one, or our normal __getattr__ method will be used
-# and fail as __parent__ starts with a __.
-return None
-
 def __getattr__(self, name, default=None):
 # Make *extra* sure that the wrapper isn't used to access
 # __call__, etc.

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


[Zope-Checkins] SVN: Zope/branches/philikon-aq-and-__parent__/lib/python/Shared/DC/Scripts/Bindings.py Read that mail again, we agreed on raising an AttributeError instead of returning None.

2007-06-24 Thread Hanno Schlichting
Log message for revision 77024:
  Read that mail again, we agreed on raising an AttributeError instead of 
returning None.
  

Changed:
  U   
Zope/branches/philikon-aq-and-__parent__/lib/python/Shared/DC/Scripts/Bindings.py

-=-
Modified: 
Zope/branches/philikon-aq-and-__parent__/lib/python/Shared/DC/Scripts/Bindings.py
===
--- 
Zope/branches/philikon-aq-and-__parent__/lib/python/Shared/DC/Scripts/Bindings.py
   2007-06-25 00:01:39 UTC (rev 77023)
+++ 
Zope/branches/philikon-aq-and-__parent__/lib/python/Shared/DC/Scripts/Bindings.py
   2007-06-25 00:14:53 UTC (rev 77024)
@@ -172,13 +172,6 @@
 __allow_access_to_unprotected_subobjects__ = 1
 __roles__ = _what_not_even_god_should_do
 
-# Acquisition will nowadays try to do an getattr on all objects which
-# aren't Acquisition wrappers, asking for a __parent__ pointer. We need
-# to provide a fake one, or our normal __getattr__ method will be used
-# and fail as __parent__ starts with a __.
-
-__parent__ = None
-
 def __repr__(self):
 return '' % self._name
 
@@ -186,6 +179,12 @@
 # Make *extra* sure that the wrapper isn't used to access
 # __call__, etc.
 if name.startswith('__'):
+# Acquisition will nowadays try to do an getattr on all objects 
which
+# aren't Acquisition wrappers, asking for a __parent__ pointer. We
+# don't want to fail in this case but simply raise an 
AttributeError.
+if name in ('__parent__', '__name__'):
+raise AttributeError
+
 self.__you_lose()
 
 return guarded_getattr(self._wrapped, name, default)

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


[Zope-Checkins] SVN: Zope/branches/2.10/ Fixed bug in ZPublisher.BaseRequest with persistent site managers. An EndRequestEvent was thrown after the ZODB connection was already closed and thus the site

2007-06-25 Thread Hanno Schlichting
Log message for revision 77042:
  Fixed bug in ZPublisher.BaseRequest with persistent site managers. An 
EndRequestEvent was thrown after the ZODB connection was already closed and 
thus the site manager not being available anymore.
  

Changed:
  U   Zope/branches/2.10/doc/CHANGES.txt
  U   Zope/branches/2.10/lib/python/ZPublisher/BaseRequest.py

-=-
Modified: Zope/branches/2.10/doc/CHANGES.txt
===
--- Zope/branches/2.10/doc/CHANGES.txt  2007-06-25 14:07:04 UTC (rev 77041)
+++ Zope/branches/2.10/doc/CHANGES.txt  2007-06-25 14:10:23 UTC (rev 77042)
@@ -8,6 +8,10 @@
 
 Bugs fixed
 
+  - Fixed bug in ZPublisher.BaseRequest with persistent site managers. An
+EndRequestEvent was thrown after the ZODB connection was already
+closed and thus the site manager not being available anymore.
+
   - Collector #2295: Comments in PythonScripts could lead to syntax
 errors
 

Modified: Zope/branches/2.10/lib/python/ZPublisher/BaseRequest.py
===
--- Zope/branches/2.10/lib/python/ZPublisher/BaseRequest.py 2007-06-25 
14:07:04 UTC (rev 77041)
+++ Zope/branches/2.10/lib/python/ZPublisher/BaseRequest.py 2007-06-25 
14:10:23 UTC (rev 77042)
@@ -202,8 +202,8 @@
 
 def close(self):
 self.other.clear()
+notify(EndRequestEvent(None, self))
 self._held=None
-notify(EndRequestEvent(None, self))
 
 def processInputs(self):
 """Do any input processing that could raise errors

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


[Zope-Checkins] SVN: Zope/trunk/ Merged r77042 from the 2.10 branch.

2007-06-25 Thread Hanno Schlichting
Log message for revision 77043:
  Merged r77042 from the 2.10 branch.
  

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  U   Zope/trunk/lib/python/ZPublisher/BaseRequest.py

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===
--- Zope/trunk/doc/CHANGES.txt  2007-06-25 14:10:23 UTC (rev 77042)
+++ Zope/trunk/doc/CHANGES.txt  2007-06-25 14:22:46 UTC (rev 77043)
@@ -97,6 +97,10 @@
 
 Bugs Fixed
 
+  - Fixed bug in ZPublisher.BaseRequest with persistent site managers.
+An EndRequestEvent was thrown after the ZODB connection was already
+closed and thus the site manager not being available anymore.
+
   - Collector #2295: Comments in PythonScripts could lead to syntax
 errors
 

Modified: Zope/trunk/lib/python/ZPublisher/BaseRequest.py
===
--- Zope/trunk/lib/python/ZPublisher/BaseRequest.py 2007-06-25 14:10:23 UTC 
(rev 77042)
+++ Zope/trunk/lib/python/ZPublisher/BaseRequest.py 2007-06-25 14:22:46 UTC 
(rev 77043)
@@ -202,8 +202,8 @@
 
 def close(self):
 self.other.clear()
+notify(EndRequestEvent(None, self))
 self._held=None
-notify(EndRequestEvent(None, self))
 
 def processInputs(self):
 """Do any input processing that could raise errors

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


[Zope-Checkins] SVN: Zope/trunk/ Merged r78365 from 2.10 branch.

2007-07-26 Thread Hanno Schlichting
Log message for revision 78366:
  Merged r78365 from 2.10 branch.
  

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  U   Zope/trunk/lib/python/Products/PageTemplates/ZopePageTemplate.py
  U   Zope/trunk/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===
--- Zope/trunk/doc/CHANGES.txt  2007-07-26 22:04:15 UTC (rev 78365)
+++ Zope/trunk/doc/CHANGES.txt  2007-07-26 22:10:30 UTC (rev 78366)
@@ -132,6 +132,9 @@
 
 Bugs Fixed
 
+  - ZopePageTemplate's pt_edit did not recognize content type arguments
+which had a charset information included.
+
   - "version.txt" file was being written to the wrong place by the
 Makefile, causing Zope to report "unreleased version" even for
 released versions.

Modified: Zope/trunk/lib/python/Products/PageTemplates/ZopePageTemplate.py
===
--- Zope/trunk/lib/python/Products/PageTemplates/ZopePageTemplate.py
2007-07-26 22:04:15 UTC (rev 78365)
+++ Zope/trunk/lib/python/Products/PageTemplates/ZopePageTemplate.py
2007-07-26 22:10:30 UTC (rev 78366)
@@ -126,7 +126,7 @@
 encoding = None
 output_encoding = None
 
-if content_type in ('text/xml',):
+if content_type.startswith('text/xml'):
 
 if is_unicode:
 encoding = None
@@ -134,9 +134,8 @@
 else:
 encoding = encodingFromXMLPreamble(text)
 output_encoding = 'utf-8'
-
 
-elif content_type in ('text/html',) :
+elif content_type.startswith('text/html'):
 
 charset = charsetFromMetaEquiv(text)
 
@@ -156,8 +155,8 @@
 output_encoding = 'iso-8859-15'
 
 else:
-utext, encoding = convertToUnicode(text, 
-   content_type, 
+utext, encoding = convertToUnicode(text,
+   content_type,
preferred_encodings)
 output_encoding = encoding
 

Modified: 
Zope/trunk/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py
===
--- Zope/trunk/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py  
2007-07-26 22:04:15 UTC (rev 78365)
+++ Zope/trunk/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py  
2007-07-26 22:10:30 UTC (rev 78366)
@@ -165,6 +165,13 @@
 self.assertEqual(zpt.read(), s)
 self.assertEqual(isinstance(zpt.read(), unicode), True)
 
+def testEditWithContentTypeCharset(self):
+manage_addPageTemplate(self.app, 'test', xml_utf8, encoding='utf-8')
+zpt = self.app['test']
+xml_unicode = unicode(xml_utf8, 'utf-8').strip()
+zpt.pt_edit(xml_unicode, 'text/xml')
+zpt.pt_edit(xml_unicode, 'text/xml; charset=utf-8')
+self.assertEqual(zpt.read(), xml_unicode)
 
 def _createZPT(self):
 manage_addPageTemplate(self.app, 'test', text=utf8_str, 
encoding='utf-8')

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


[Zope-Checkins] SVN: Zope/branches/2.10/ ZopePageTemplate's pt_edit did not recognize content type arguments which had a charset information included.

2007-07-26 Thread Hanno Schlichting
Log message for revision 78365:
  ZopePageTemplate's pt_edit did not recognize content type arguments which had 
a charset information included.
  

Changed:
  U   Zope/branches/2.10/doc/CHANGES.txt
  U   Zope/branches/2.10/lib/python/Products/PageTemplates/ZopePageTemplate.py
  U   
Zope/branches/2.10/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py

-=-
Modified: Zope/branches/2.10/doc/CHANGES.txt
===
--- Zope/branches/2.10/doc/CHANGES.txt  2007-07-26 20:15:50 UTC (rev 78364)
+++ Zope/branches/2.10/doc/CHANGES.txt  2007-07-26 22:04:15 UTC (rev 78365)
@@ -4,6 +4,13 @@
   Change information for previous versions of Zope can be found in the
   file HISTORY.txt.
 
+  Zope 2.10.5 (unreleased)
+
+Bugs fixed
+
+  - ZopePageTemplate's pt_edit did not recognize content type arguments
+which had a charset information included.
+
   Zope 2.10.4 (23.06.2007)
 
 Other changes

Modified: 
Zope/branches/2.10/lib/python/Products/PageTemplates/ZopePageTemplate.py
===
--- Zope/branches/2.10/lib/python/Products/PageTemplates/ZopePageTemplate.py
2007-07-26 20:15:50 UTC (rev 78364)
+++ Zope/branches/2.10/lib/python/Products/PageTemplates/ZopePageTemplate.py
2007-07-26 22:04:15 UTC (rev 78365)
@@ -126,7 +126,7 @@
 encoding = None
 output_encoding = None
 
-if content_type in ('text/xml',):
+if content_type.startswith('text/xml'):
 
 if is_unicode:
 encoding = None
@@ -134,9 +134,8 @@
 else:
 encoding = encodingFromXMLPreamble(text)
 output_encoding = 'utf-8'
-
 
-elif content_type in ('text/html',) :
+elif content_type.startswith('text/html'):
 
 charset = charsetFromMetaEquiv(text)
 

Modified: 
Zope/branches/2.10/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py
===
--- 
Zope/branches/2.10/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py
  2007-07-26 20:15:50 UTC (rev 78364)
+++ 
Zope/branches/2.10/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py
  2007-07-26 22:04:15 UTC (rev 78365)
@@ -165,6 +165,14 @@
 self.assertEqual(zpt.read(), s)
 self.assertEqual(isinstance(zpt.read(), unicode), True)
 
+def testEditWithContentTypeCharset(self):
+manage_addPageTemplate(self.app, 'test', xml_utf8, encoding='utf-8')
+zpt = self.app['test']
+xml_unicode = unicode(xml_utf8, 'utf-8').strip()
+zpt.pt_edit(xml_unicode, 'text/xml')
+zpt.pt_edit(xml_unicode, 'text/xml; charset=utf-8')
+self.assertEqual(zpt.read(), xml_unicode)
+
 def _createZPT(self):
 manage_addPageTemplate(self.app, 'test', text=utf8_str, 
encoding='utf-8')
 zpt = self.app['test']

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


[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/AccessControl/ Use new module level aq_inContextOf method, so this works for non-wrappers as well. Still needs to be made aware of __parent__

2007-07-28 Thread Hanno Schlichting
Log message for revision 78422:
  Use new module level aq_inContextOf method, so this works for non-wrappers as 
well. Still needs to be made aware of __parent__ pointers
  

Changed:
  U   Zope/branches/philikon-aq/lib/python/AccessControl/ImplPython.py
  U   Zope/branches/philikon-aq/lib/python/AccessControl/User.py

-=-
Modified: Zope/branches/philikon-aq/lib/python/AccessControl/ImplPython.py
===
--- Zope/branches/philikon-aq/lib/python/AccessControl/ImplPython.py
2007-07-28 09:58:54 UTC (rev 78421)
+++ Zope/branches/philikon-aq/lib/python/AccessControl/ImplPython.py
2007-07-28 10:33:33 UTC (rev 78422)
@@ -20,6 +20,7 @@
 from Acquisition import aq_base
 from Acquisition import aq_parent
 from Acquisition import aq_inner
+from Acquisition import aq_inContextOf
 from Acquisition import aq_acquire
 from ExtensionClass import Base
 from zope.interface import implements
@@ -840,17 +841,10 @@
 # This is a strange rule, though
 # it doesn't cause any security holes. SDH
 return 1
-if not hasattr(object, 'aq_inContextOf'):
-if hasattr(object, 'im_self'):
-# This is a method.  Grab its self.
-object=object.im_self
-if not hasattr(object, 'aq_inContextOf'):
-# object is not wrapped, therefore we
-# can't determine context.
-# Fail the access attempt.  Otherwise
-# this would be a security hole.
-return None
-if not object.aq_inContextOf(ucontext, 1):
+if hasattr(object, 'im_self'):
+# This is a method.  Grab its self.
+object=object.im_self
+if not aq_inContextOf(object, ucontext, 1):
 if 'Shared' in object_roles:
 # Old role setting. Waaa
 object_roles=user._shared_roles(object)

Modified: Zope/branches/philikon-aq/lib/python/AccessControl/User.py
===
--- Zope/branches/philikon-aq/lib/python/AccessControl/User.py  2007-07-28 
09:58:54 UTC (rev 78421)
+++ Zope/branches/philikon-aq/lib/python/AccessControl/User.py  2007-07-28 
10:33:33 UTC (rev 78422)
@@ -20,6 +20,7 @@
 import socket
 from base64 import decodestring
 
+from Acquisition import aq_inContextOf
 from Acquisition import Implicit
 from App.Management import Navigation, Tabs
 from Globals import DTMLFile, MessageDialog, Persistent, PersistentMapping
@@ -165,14 +166,10 @@
 if context is not None:
 if object is None:
 return 1
-if not hasattr(object, 'aq_inContextOf'):
-if hasattr(object, 'im_self'):
-# This is a method.  Grab its self.
-object=object.im_self
-if not hasattr(object, 'aq_inContextOf'):
-# Object is not wrapped, so return false.
-return 0
-return object.aq_inContextOf(context, 1)
+if hasattr(object, 'im_self'):
+# This is a method.  Grab its self.
+object=object.im_self
+return aq_inContextOf(object, context, 1)
 
 # This is lame, but required to keep existing behavior.
 return 1

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


[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py __of__ should take an argument, even if we ignore it

2007-07-28 Thread Hanno Schlichting
Log message for revision 78434:
  __of__ should take an argument, even if we ignore it

Changed:
  U   Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py

-=-
Modified: Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py
===
--- Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py  
2007-07-28 18:44:05 UTC (rev 78433)
+++ Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py  
2007-07-28 19:52:46 UTC (rev 78434)
@@ -22,7 +22,7 @@
 # BBB for code that expects BrowserView to still inherit from
 # Acquisition.Explicit.
 
-def __of__(self):
+def __of__(self, context):
 return self
 
 # TODO we probably want to provide the aq_* properties as well

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


[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py Avoid infinite recursion for messed up aq_chains.

2007-07-28 Thread Hanno Schlichting
Log message for revision 78435:
  Avoid infinite recursion for messed up aq_chains.

Changed:
  U   
Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py

-=-
Modified: 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py
===
--- 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py  
2007-07-28 19:52:46 UTC (rev 78434)
+++ 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py  
2007-07-28 20:11:10 UTC (rev 78435)
@@ -17,6 +17,7 @@
 """
 import zope.app.pagetemplate
 
+from Acquisition import aq_base
 from Acquisition import aq_parent
 from AccessControl import getSecurityManager
 from Products.PageTemplates.Expressions import SecureModuleImporter
@@ -38,7 +39,7 @@
 # get the root
 obj = context['context']
 root = None
-while (getattr(obj, 'getPhysicalRoot', None) is None
+while (getattr(aq_base(obj), 'getPhysicalRoot', None) is None
and aq_parent(obj) is not None):
 obj = aq_parent(obj)
 if getattr(obj, 'getPhysicalRoot', None) is not None:

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


[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py Provide the aq_ properties for BBB

2007-07-28 Thread Hanno Schlichting
Log message for revision 78436:
  Provide the aq_ properties for BBB
  

Changed:
  U   Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py

-=-
Modified: Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py
===
--- Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py  
2007-07-28 20:11:10 UTC (rev 78435)
+++ Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py  
2007-07-28 20:52:49 UTC (rev 78436)
@@ -25,4 +25,18 @@
 def __of__(self, context):
 return self
 
-# TODO we probably want to provide the aq_* properties as well
+# We provide the aq_* properties here for BBB
+
+@property
+def aq_base(self):
+return self
+
+aq_self = aq_inner = aq_base
+
+@property
+def aq_parent(self):
+return self.__parent__
+
+@property
+def aq_chain(self):
+return [self]

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


[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/Zope2/App/startup.py Use the proper aq_ methods instead of attribute access

2007-07-28 Thread Hanno Schlichting
Log message for revision 78437:
  Use the proper aq_ methods instead of attribute access
  

Changed:
  U   Zope/branches/philikon-aq/lib/python/Zope2/App/startup.py

-=-
Modified: Zope/branches/philikon-aq/lib/python/Zope2/App/startup.py
===
--- Zope/branches/philikon-aq/lib/python/Zope2/App/startup.py   2007-07-28 
20:52:49 UTC (rev 78436)
+++ Zope/branches/philikon-aq/lib/python/Zope2/App/startup.py   2007-07-28 
20:53:59 UTC (rev 78437)
@@ -18,6 +18,8 @@
 from AccessControl.SecurityManagement import newSecurityManager
 from AccessControl.SecurityManagement import noSecurityManager
 from Acquisition import aq_acquire
+from Acquisition import aq_inner
+from Acquisition import aq_parent
 from App.config import getConfiguration
 from time import asctime
 from types import StringType, ListType
@@ -125,7 +127,7 @@
 newSecurityManager(request, user)
 version = request.get(Globals.VersionNameName, '')
 if version:
-object = user.aq_parent
+object = aq_parent(user)
 if not getSecurityManager().checkPermission(
 'Join/leave Versions', object):
 request['RESPONSE'].setCookie(
@@ -226,7 +228,7 @@
 while 1:
 f = getattr(published, self.raise_error_message, None)
 if f is None:
-published = getattr(published, 'aq_parent', None)
+published = aq_parent(published)
 if published is None:
 raise t, v, traceback
 else:
@@ -236,7 +238,7 @@
 while 1:
 if getattr(client, self.error_message, None) is not None:
 break
-client = getattr(client, 'aq_parent', None)
+client = aq_parent(client)
 if client is None:
 raise t, v, traceback
 
@@ -291,8 +293,7 @@
 object = None
 break
 to_append = (object.__name__,) + to_append
-object = getattr(object, 'aq_inner', object)
-object = getattr(object, 'aq_parent', None)
+object = aq_parent(aq_inner(object))
 
 if object is not None:
 path = '/'.join(object.getPhysicalPath() + to_append)
@@ -307,11 +308,8 @@
 T.note(path)
 auth_user=request_get('AUTHENTICATED_USER',None)
 if auth_user is not None:
-try:
-auth_folder = auth_user.aq_parent
-except AttributeError:
-# Most likely some product forgot to call __of__()
-# on the user object.
+auth_folder = aq_parent(auth_user)
+if auth_folder is None:
 ac_logger.warning(
 'A user object of type %s has no aq_parent.',
 type(auth_user)
@@ -321,6 +319,3 @@
 auth_path = '/'.join(auth_folder.getPhysicalPath()[1:-1])
 
 T.setUser(auth_user.getId(), auth_path)
-
-
-

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


[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/AccessControl/ More proper usage of the aq_* methods

2007-07-28 Thread Hanno Schlichting
Log message for revision 78438:
  More proper usage of the aq_* methods
  

Changed:
  U   Zope/branches/philikon-aq/lib/python/AccessControl/Permission.py
  U   Zope/branches/philikon-aq/lib/python/AccessControl/User.py

-=-
Modified: Zope/branches/philikon-aq/lib/python/AccessControl/Permission.py
===
--- Zope/branches/philikon-aq/lib/python/AccessControl/Permission.py
2007-07-28 20:53:59 UTC (rev 78437)
+++ Zope/branches/philikon-aq/lib/python/AccessControl/Permission.py
2007-07-28 21:09:57 UTC (rev 78438)
@@ -17,6 +17,7 @@
 
 import string, Products, Globals
 
+from Acquisition import aq_base
 
 name_trans=filter(lambda c, an=string.letters+string.digits+'_': c not in an,
   map(chr,range(256)))
@@ -36,8 +37,7 @@
 self.name=name
 self._p='_'+string.translate(name,name_trans)+"_Permission"
 self.data=data
-if hasattr(obj, 'aq_base'): obj=obj.aq_base
-self.obj=obj
+self.obj=aq_base(obj)
 self.default=default
 
 def getRoles(self, default=_marker):

Modified: Zope/branches/philikon-aq/lib/python/AccessControl/User.py
===
--- Zope/branches/philikon-aq/lib/python/AccessControl/User.py  2007-07-28 
20:53:59 UTC (rev 78437)
+++ Zope/branches/philikon-aq/lib/python/AccessControl/User.py  2007-07-28 
21:09:57 UTC (rev 78438)
@@ -20,6 +20,8 @@
 import socket
 from base64 import decodestring
 
+from Acquisition import aq_base
+from Acquisition import aq_parent
 from Acquisition import aq_inContextOf
 from Acquisition import Implicit
 from App.Management import Navigation, Tabs
@@ -152,7 +154,7 @@
 if getattr(parent, '__parent__', None) is not None:
 while hasattr(parent.aq_self,'aq_self'):
 parent = parent.aq_self
-parent = parent.__parent__
+parent = aq_parent(parent)
 else: return r
 
 def _check_context(self, object):
@@ -772,7 +774,7 @@
 
 def _isTop(self):
 try:
-return self.__parent__.aq_base.isTopLevelPrincipiaApplicationObject
+return 
aq_base(aq_parent(self)).isTopLevelPrincipiaApplicationObject
 except:
 return 0
 
@@ -987,8 +989,8 @@
 
 def manage_afterAdd(self, item, container):
 if item is self:
-if hasattr(self, 'aq_base'): self=self.aq_base
-container.__allow_groups__=self
+self = aq_base(self)
+container.__allow_groups__ = self
 
 def __creatable_by_emergency_user__(self): return 1
 

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


[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/Products/Five/i18n.py Do not attempt to acquire REQUEST from the context, when we already got a request as the context.

2007-07-28 Thread Hanno Schlichting
Log message for revision 78439:
  Do not attempt to acquire REQUEST from the context, when we already got a 
request as the context.
  

Changed:
  U   Zope/branches/philikon-aq/lib/python/Products/Five/i18n.py

-=-
Modified: Zope/branches/philikon-aq/lib/python/Products/Five/i18n.py
===
--- Zope/branches/philikon-aq/lib/python/Products/Five/i18n.py  2007-07-28 
21:09:57 UTC (rev 78438)
+++ Zope/branches/philikon-aq/lib/python/Products/Five/i18n.py  2007-07-28 
21:24:03 UTC (rev 78439)
@@ -23,6 +23,7 @@
 from zope.i18n.negotiator import normalize_lang
 from zope.component import queryUtility
 from zope.i18nmessageid import Message
+from zope.publisher.interfaces.browser import IBrowserRequest
 
 
 class FiveTranslationService:
@@ -60,8 +61,11 @@
 
 # in Zope3, context is adapted to IUserPreferredLanguages,
 # which means context should be the request in this case.
+# Do not attempt to acquire REQUEST from the context, when we already
+# got a request as the context
 if context is not None:
-context = aq_acquire(context, 'REQUEST', None)
+if not IBrowserRequest.providedBy(context):
+context = aq_acquire(context, 'REQUEST', None)
 return util.translate(msgid, mapping=mapping, context=context,
   target_language=target_language, default=default)
 

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


[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/OFS/ Use even more proper aq_* method calls

2007-07-28 Thread Hanno Schlichting
Log message for revision 78440:
  Use even more proper aq_* method calls
  

Changed:
  U   Zope/branches/philikon-aq/lib/python/OFS/FindSupport.py
  U   Zope/branches/philikon-aq/lib/python/OFS/PropertySheets.py
  U   Zope/branches/philikon-aq/lib/python/OFS/SimpleItem.py
  U   Zope/branches/philikon-aq/lib/python/OFS/ZDOM.py

-=-
Modified: Zope/branches/philikon-aq/lib/python/OFS/FindSupport.py
===
--- Zope/branches/philikon-aq/lib/python/OFS/FindSupport.py 2007-07-28 
21:24:03 UTC (rev 78439)
+++ Zope/branches/philikon-aq/lib/python/OFS/FindSupport.py 2007-07-28 
21:46:18 UTC (rev 78440)
@@ -22,6 +22,7 @@
 from AccessControl.DTML import RestrictedDTML
 from AccessControl.Permission import name_trans
 from AccessControl.Permissions import view_management_screens
+from Acquisition import aq_base
 from DateTime import DateTime
 from DocumentTemplate.DT_Util import Eval
 from DocumentTemplate.DT_Util import InstanceDict, TemplateDict
@@ -92,9 +93,8 @@
 md=td()
 obj_expr=(Eval(obj_expr), md, md._push, md._pop)
 
-base=obj
-if hasattr(obj, 'aq_base'):
-base=obj.aq_base
+base = obj
+base = aq_base(obj)
 
 if hasattr(base, 'objectItems'):
 try:items=obj.objectItems()
@@ -118,9 +118,7 @@
 if hasattr(ob, '_p_changed') and (ob._p_changed == None):
 dflag=1
 
-if hasattr(ob, 'aq_base'):
-bs=ob.aq_base
-else: bs=ob
+bs = aq_base(ob)
 if (
 (not obj_ids or absattr(bs.getId()) in obj_ids)
 and
@@ -200,9 +198,8 @@
 md=td()
 obj_expr=(Eval(obj_expr), md, md._push, md._pop)
 
-base=obj
-if hasattr(obj, 'aq_base'):
-base=obj.aq_base
+base = obj
+base = aq_base(obj)
 
 if not hasattr(base, 'objectItems'):
 return result
@@ -221,10 +218,7 @@
 if hasattr(ob, '_p_changed') and (ob._p_changed == None):
 dflag=1
 
-if hasattr(ob, 'aq_base'):
-bs=ob.aq_base
-else: bs=ob
-
+bs = aq_base(ob)
 if (
 (not obj_ids or absattr(bs.getId()) in obj_ids)
 and

Modified: Zope/branches/philikon-aq/lib/python/OFS/PropertySheets.py
===
--- Zope/branches/philikon-aq/lib/python/OFS/PropertySheets.py  2007-07-28 
21:24:03 UTC (rev 78439)
+++ Zope/branches/philikon-aq/lib/python/OFS/PropertySheets.py  2007-07-28 
21:46:18 UTC (rev 78440)
@@ -20,13 +20,14 @@
 from ZPublisher.Converters import type_converters
 from Globals import InitializeClass
 from Globals import DTMLFile, MessageDialog
+from Acquisition import aq_base
+from Acquisition import aq_parent
 from Acquisition import Implicit, Explicit
 from App.Common import rfc1123_date, iso8601_date
 from webdav.common import urlbase
 from ExtensionClass import Base
 from Globals import Persistent
 from Traversable import Traversable
-from Acquisition import aq_base
 from AccessControl import ClassSecurityInfo
 from AccessControl.Permissions import access_contents_information
 from AccessControl.Permissions import manage_properties
@@ -71,7 +72,7 @@
 pre=pre+'/'
 
 r=[]
-for d in self.aq_parent.aq_parent.manage_options:
+for d in aq_parent(aq_parent(self)).manage_options:
 path=d['action']
 option={'label': d['label'],
   'action': pre+path,
@@ -92,7 +93,7 @@
 self, script, path)
 
 def meta_type(self):
-try: return self.aq_parent.aq_parent.meta_type
+try: return aq_parent(aq_parent(self)).meta_type
 except: return ''
 
 
@@ -489,7 +490,7 @@
 pass
 
 def v_self(self):
-return self.aq_parent.aq_parent
+return aq_parent(aq_parent(self))
 
 
 class DefaultProperties(Virtual, PropertySheet, View):
@@ -635,7 +636,7 @@
 return (self.webdav,)
 
 def __propsets__(self):
-propsets=self.aq_parent.__propsets__
+propsets = aq_parent(self).__propsets__
 __traceback_info__= propsets, type(propsets)
 return self._get_defaults() + propsets
 
@@ -684,17 +685,17 @@
 
 security.declareProtected(manage_properties, 'addPropertySheet')
 def addPropertySheet(self, propset):
-propsets=self.aq_parent.__propsets__
-propsets=propsets+(propset,)
-self.aq_parent.__propsets__=propsets
+propsets = aq_parent(self).__propsets__
+propsets = propsets+(propset,)
+aq_parent(self).__propsets__ = propsets
 
 security.declareProtected(manage_properties, 'delPropertySheet')
 def delPropertySheet(self, name):
 result=[]
-for propset in self.aq_parent.__propsets__:
+for propset in aq_parent(self)._

[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py Fix aq_chain

2007-07-28 Thread Hanno Schlichting
Log message for revision 78442:
  Fix aq_chain

Changed:
  U   Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py

-=-
Modified: Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py
===
--- Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py  
2007-07-28 22:07:02 UTC (rev 78441)
+++ Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py  
2007-07-28 22:18:08 UTC (rev 78442)
@@ -15,7 +15,9 @@
 
 $Id$
 """
+
 import zope.publisher.browser
+import Acquisition
 
 class BrowserView(zope.publisher.browser.BrowserView):
 
@@ -39,4 +41,4 @@
 
 @property
 def aq_chain(self):
-return [self]
+return Acquisition.aq_chain(self)

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


[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/Zope2/App/startup.py If we are going in circles without getting the error_message just raise

2007-07-28 Thread Hanno Schlichting
Log message for revision 78443:
  If we are going in circles without getting the error_message just raise
  

Changed:
  U   Zope/branches/philikon-aq/lib/python/Zope2/App/startup.py

-=-
Modified: Zope/branches/philikon-aq/lib/python/Zope2/App/startup.py
===
--- Zope/branches/philikon-aq/lib/python/Zope2/App/startup.py   2007-07-28 
22:18:08 UTC (rev 78442)
+++ Zope/branches/philikon-aq/lib/python/Zope2/App/startup.py   2007-07-28 
22:30:37 UTC (rev 78443)
@@ -18,6 +18,7 @@
 from AccessControl.SecurityManagement import newSecurityManager
 from AccessControl.SecurityManagement import noSecurityManager
 from Acquisition import aq_acquire
+from Acquisition import aq_base
 from Acquisition import aq_inner
 from Acquisition import aq_parent
 from App.config import getConfiguration
@@ -239,7 +240,9 @@
 if getattr(client, self.error_message, None) is not None:
 break
 client = aq_parent(client)
-if client is None:
+# If we are going in circles without getting the error_message
+# just raise
+if client is None or aq_base(client) is aq_base(published):
 raise t, v, traceback
 
 if REQUEST.get('AUTHENTICATED_USER', None) is None:

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


[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/Products/Five/formlib/formbase.py Removed one more Acquisition.Explicit mixing, one less failing test :)

2007-07-28 Thread Hanno Schlichting
Log message for revision 78444:
  Removed one more Acquisition.Explicit mixing, one less failing test :)
  

Changed:
  U   Zope/branches/philikon-aq/lib/python/Products/Five/formlib/formbase.py

-=-
Modified: Zope/branches/philikon-aq/lib/python/Products/Five/formlib/formbase.py
===
--- Zope/branches/philikon-aq/lib/python/Products/Five/formlib/formbase.py  
2007-07-28 22:30:37 UTC (rev 78443)
+++ Zope/branches/philikon-aq/lib/python/Products/Five/formlib/formbase.py  
2007-07-28 23:46:54 UTC (rev 78444)
@@ -18,7 +18,6 @@
 import os.path
 
 from datetime import datetime
-import Acquisition
 
 import zope.event
 import zope.formlib
@@ -36,7 +35,7 @@
 _SUBPAGEFORM_PATH = os.path.join(_FORMLIB_DIR, 'subpageform.pt')
 
 
-class FiveFormlibMixin(Acquisition.Explicit):
+class FiveFormlibMixin(object):
 
 # Overrides the formlib.form.FormBase.template attributes implemented 
 # using NamedTemplates. NamedTemplates using ViewPageTemplateFile (like

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


[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py simplify getting the root

2007-07-28 Thread Hanno Schlichting
Log message for revision 78449:
  simplify getting the root

Changed:
  U   
Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py

-=-
Modified: 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py
===
--- 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py  
2007-07-29 00:12:25 UTC (rev 78448)
+++ 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py  
2007-07-29 00:27:36 UTC (rev 78449)
@@ -18,6 +18,7 @@
 import zope.app.pagetemplate
 
 from Acquisition import aq_base
+from Acquisition import aq_get
 from Acquisition import aq_parent
 from AccessControl import getSecurityManager
 from Products.PageTemplates.Expressions import SecureModuleImporter
@@ -39,11 +40,9 @@
 # get the root
 obj = context['context']
 root = None
-while (getattr(aq_base(obj), 'getPhysicalRoot', None) is None
-   and aq_parent(obj) is not None):
-obj = aq_parent(obj)
-if getattr(obj, 'getPhysicalRoot', None) is not None:
-root = obj.getPhysicalRoot()
+meth = aq_get(obj, 'getPhysicalRoot', None)
+if meth is not None:
+root = meth()
 
 context.update(here=context['context'],
# philiKON thinks container should be the view,

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


[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/OFS/Traversable.py Replace self.REQUEST with ac_acquire(self, 'REQUEST')

2007-07-28 Thread Hanno Schlichting
Log message for revision 78450:
  Replace self.REQUEST with ac_acquire(self, 'REQUEST')
  

Changed:
  U   Zope/branches/philikon-aq/lib/python/OFS/Traversable.py

-=-
Modified: Zope/branches/philikon-aq/lib/python/OFS/Traversable.py
===
--- Zope/branches/philikon-aq/lib/python/OFS/Traversable.py 2007-07-29 
00:27:36 UTC (rev 78449)
+++ Zope/branches/philikon-aq/lib/python/OFS/Traversable.py 2007-07-29 
00:43:22 UTC (rev 78450)
@@ -22,7 +22,7 @@
 from AccessControl import getSecurityManager
 from AccessControl import Unauthorized
 from AccessControl.ZopeGuards import guarded_getattr
-from Acquisition import Acquired, aq_inner, aq_parent, aq_base
+from Acquisition import Acquired, aq_inner, aq_parent, aq_acquire, aq_base
 from zExceptions import NotFound
 from ZODB.POSException import ConflictError
 from OFS.interfaces import ITraversable
@@ -64,7 +64,7 @@
 spp = self.getPhysicalPath()
 
 try:
-toUrl = self.REQUEST.physicalPathToURL
+toUrl = aq_acquire(self, 'REQUEST').physicalPathToURL
 except AttributeError:
 return path2url(spp[1:])
 return toUrl(spp)
@@ -78,7 +78,7 @@
 """
 spp = self.getPhysicalPath()
 try:
-toUrl = self.REQUEST.physicalPathToURL
+toUrl = aq_acquire(self, 'REQUEST').physicalPathToURL
 except AttributeError:
 return path2url(spp) or '/'
 return toUrl(spp, relative=1) or '/'
@@ -93,7 +93,7 @@
 """
 spp = self.getPhysicalPath()
 try:
-toVirt = self.REQUEST.physicalPathToVirtualPath
+toVirt = aq_acquire(self, 'REQUEST').physicalPathToVirtualPath
 except AttributeError:
 return path2url(spp[1:])
 return path2url(toVirt(spp))
@@ -192,7 +192,7 @@
 if ns:
 try:
 next = namespaceLookup(
-ns, nm, obj, self.REQUEST)
+ns, nm, obj, aq_acquire(self, 'REQUEST'))
 if restricted and not validate(
 obj, obj, name, next):
 raise Unauthorized(name)
@@ -256,7 +256,7 @@
 
 except (AttributeError, NotFound, KeyError), e:
 # Try to look for a view
-next = queryMultiAdapter((obj, self.REQUEST),
+next = queryMultiAdapter((obj, aq_acquire(self, 
'REQUEST')),
  Interface, name)
 
 if next is not None:

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


[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/Products/PageTemplates/ Synced the old pt's with the new code in Five.

2007-07-29 Thread Hanno Schlichting
Log message for revision 78452:
  Synced the old pt's with the new code in Five.
  

Changed:
  U   
Zope/branches/philikon-aq/lib/python/Products/PageTemplates/PageTemplateFile.py
  U   
Zope/branches/philikon-aq/lib/python/Products/PageTemplates/ZopePageTemplate.py

-=-
Modified: 
Zope/branches/philikon-aq/lib/python/Products/PageTemplates/PageTemplateFile.py
===
--- 
Zope/branches/philikon-aq/lib/python/Products/PageTemplates/PageTemplateFile.py 
2007-07-29 01:48:18 UTC (rev 78451)
+++ 
Zope/branches/philikon-aq/lib/python/Products/PageTemplates/PageTemplateFile.py 
2007-07-29 10:49:45 UTC (rev 78452)
@@ -17,7 +17,7 @@
 import AccessControl
 from Globals import package_home, InitializeClass, DevelopmentMode
 from App.config import getConfiguration
-from Acquisition import aq_parent, aq_inner
+from Acquisition import aq_parent, aq_inner, aq_get
 from ComputedAttribute import ComputedAttribute
 from OFS.SimpleItem import SimpleItem
 from OFS.Traversable import Traversable
@@ -90,7 +90,10 @@
 self.pt_edit( content, guess_type(filename, content))
 
 def pt_getContext(self):
-root = self.getPhysicalRoot()
+root = None
+meth = aq_get(self, 'getPhysicalRoot', None)
+if meth is not None:
+root = meth()
 context = self._getContext()
 c = {'template': self,
  'here': context,
@@ -99,7 +102,7 @@
  'nothing': None,
  'options': {},
  'root': root,
- 'request': getattr(root, 'REQUEST', None),
+ 'request': aq_get(root, 'REQUEST', None),
  'modules': SecureModuleImporter,
  }
 return c
@@ -111,12 +114,11 @@
 kw['args'] = args
 bound_names['options'] = kw
 
-try:
-response = self.REQUEST.RESPONSE
+request = aq_get(self, 'REQUEST', None)
+if request is not None:
+response = request.response
 if not response.headers.has_key('content-type'):
 response.setHeader('content-type', self.content_type)
-except AttributeError:
-pass
 
 # Execute the template in a new security context.
 security = AccessControl.getSecurityManager()

Modified: 
Zope/branches/philikon-aq/lib/python/Products/PageTemplates/ZopePageTemplate.py
===
--- 
Zope/branches/philikon-aq/lib/python/Products/PageTemplates/ZopePageTemplate.py 
2007-07-29 01:48:18 UTC (rev 78451)
+++ 
Zope/branches/philikon-aq/lib/python/Products/PageTemplates/ZopePageTemplate.py 
2007-07-29 10:49:45 UTC (rev 78452)
@@ -17,6 +17,7 @@
 import re
 import os
 import Acquisition 
+from Acquisition import aq_get
 from Globals import ImageFile, package_home, InitializeClass
 from DateTime.DateTime import DateTime
 from Shared.DC.Scripts.Script import Script 
@@ -272,7 +273,10 @@
 historyComparisonResults=html_diff(rev1._text, rev2._text) )
 
 def pt_getContext(self, *args, **kw):
-root = self.getPhysicalRoot()
+root = None
+meth = aq_get(self, 'getPhysicalRoot', None)
+if meth is not None:
+root = meth()
 context = self._getContext()
 c = {'template': self,
  'here': context,
@@ -281,7 +285,7 @@
  'nothing': None,
  'options': {},
  'root': root,
- 'request': getattr(root, 'REQUEST', None),
+ 'request': aq_get(root, 'REQUEST', None),
  'modules': SecureModuleImporter,
  }
 return c
@@ -303,12 +307,11 @@
 kw['args'] = args
 bound_names['options'] = kw
 
-try:
-response = self.REQUEST.RESPONSE
+request = aq_get(self, 'REQUEST', None)
+if request is not None:
+response = request.response
 if not response.headers.has_key('content-type'):
 response.setHeader('content-type', self.content_type)
-except AttributeError:
-pass
 
 security = getSecurityManager()
 bound_names['user'] = security.getUser()

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


[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/Products/Five/browser/resource.py Remove no longer needed workaround

2007-07-29 Thread Hanno Schlichting
Log message for revision 78453:
  Remove no longer needed workaround
  

Changed:
  U   Zope/branches/philikon-aq/lib/python/Products/Five/browser/resource.py

-=-
Modified: Zope/branches/philikon-aq/lib/python/Products/Five/browser/resource.py
===
--- Zope/branches/philikon-aq/lib/python/Products/Five/browser/resource.py  
2007-07-29 10:49:45 UTC (rev 78452)
+++ Zope/branches/philikon-aq/lib/python/Products/Five/browser/resource.py  
2007-07-29 10:50:15 UTC (rev 78453)
@@ -187,9 +187,6 @@
 
 def __init__(self, context, request):
 BrowserView.__init__(self, context, request)
-# OFSTraversable.absolute_url() assumes self.REQUEST being
-# accessible:
-self.REQUEST = request
 
 def getId(self):
 name = self.__name__

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


[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/Products/Five/viewlet/ Freed viewlets from their Acquisition chains

2007-07-29 Thread Hanno Schlichting
Log message for revision 78454:
  Freed viewlets from their Acquisition chains
  

Changed:
  U   Zope/branches/philikon-aq/lib/python/Products/Five/viewlet/README.txt
  U   Zope/branches/philikon-aq/lib/python/Products/Five/viewlet/manager.py
  U   Zope/branches/philikon-aq/lib/python/Products/Five/viewlet/viewlet.py

-=-
Modified: Zope/branches/philikon-aq/lib/python/Products/Five/viewlet/README.txt
===
--- Zope/branches/philikon-aq/lib/python/Products/Five/viewlet/README.txt   
2007-07-29 10:50:15 UTC (rev 78453)
+++ Zope/branches/philikon-aq/lib/python/Products/Five/viewlet/README.txt   
2007-07-29 10:58:03 UTC (rev 78454)
@@ -89,8 +89,7 @@
   >>> from zope.publisher.interfaces.browser import IDefaultBrowserLayer
   >>> from zope.publisher.interfaces.browser import IBrowserView
 
-  >>> from Acquisition import Explicit
-  >>> class WeatherBox(Explicit):
+  >>> class WeatherBox(object):
   ... zope.interface.implements(interfaces.IViewlet)
   ...
   ... def __init__(self, context, request, view, manager):
@@ -109,7 +108,7 @@
   ... IBrowserView, ILeftColumn),
   ... interfaces.IViewlet, name='weather')
 
-  >>> class SportBox(Explicit):
+  >>> class SportBox(object):
   ... zope.interface.implements(interfaces.IViewlet)
   ...
   ... def __init__(self, context, request, view, manager):
@@ -311,7 +310,7 @@
   >>> foo.render()
   Traceback (most recent call last):
   ...
-  AttributeError: bar
+  AttributeError: 'FooViewlet' object has no attribute 'bar'
 
 To create simple template-based viewlets you can use the
 ``SimpleViewletClass()`` function. This function is very similar to its view
@@ -365,7 +364,7 @@
 The viewlet will look up the resource it was given and tries to produce the
 absolute URL for it:
 
-  >>> class JSResource(Explicit):
+  >>> class JSResource(object):
   ... def __init__(self, request):
   ... self.request = request
   ...
@@ -381,7 +380,7 @@
 
 The same works for the CSS resource viewlet:
 
-  >>> class CSSResource(Explicit):
+  >>> class CSSResource(object):
   ... def __init__(self, request):
   ... self.request = request
   ...
@@ -487,7 +486,7 @@
 
   >>> shownColumns = []
 
-  >>> class ContentsViewletManager(Explicit):
+  >>> class ContentsViewletManager(object):
   ... zope.interface.implements(interfaces.IViewletManager)
   ... index = None
   ...
@@ -562,7 +561,7 @@
 
 Now let's create a first viewlet for the manager...
 
-  >>> class NameViewlet(Explicit):
+  >>> class NameViewlet(object):
   ...
   ... def __init__(self, context, request, view, manager):
   ... self.__parent__ = view
@@ -635,7 +634,7 @@
 Let's now write a second viewlet that will display the size of the object for
 us:
 
-  >>> class SizeViewlet(Explicit):
+  >>> class SizeViewlet(object):
   ...
   ... def __init__(self, context, request, view, manager):
   ... self.__parent__ = view

Modified: Zope/branches/philikon-aq/lib/python/Products/Five/viewlet/manager.py
===
--- Zope/branches/philikon-aq/lib/python/Products/Five/viewlet/manager.py   
2007-07-29 10:50:15 UTC (rev 78453)
+++ Zope/branches/philikon-aq/lib/python/Products/Five/viewlet/manager.py   
2007-07-29 10:58:03 UTC (rev 78454)
@@ -15,7 +15,7 @@
 
 $Id$
 """
-import Acquisition
+from Acquisition import aq_base
 from AccessControl.ZopeGuards import guarded_hasattr
 import zope.interface
 import zope.security
@@ -24,9 +24,7 @@
 
 from Products.Five.browser.pagetemplatefile import ZopeTwoPageTemplateFile
 
-aq_base = Acquisition.aq_base
-
-class ViewletManagerBase(origManagerBase, Acquisition.Explicit):
+class ViewletManagerBase(origManagerBase):
 """A base class for Viewlet managers to work in Zope2"""
 
 def __getitem__(self, name):

Modified: Zope/branches/philikon-aq/lib/python/Products/Five/viewlet/viewlet.py
===
--- Zope/branches/philikon-aq/lib/python/Products/Five/viewlet/viewlet.py   
2007-07-29 10:50:15 UTC (rev 78453)
+++ Zope/branches/philikon-aq/lib/python/Products/Five/viewlet/viewlet.py   
2007-07-29 10:58:03 UTC (rev 78454)
@@ -16,16 +16,14 @@
 $Id$
 """
 import os
-from Acquisition import Explicit
 from zope.viewlet import viewlet as orig_viewlet
 
 from Products.Five.browser.pagetemplatefile import ZopeTwoPageTemplateFile
 
-# We add Acquisition to all the base classes to enable security machinery
-class ViewletBase(orig_viewlet.ViewletBase, Explicit):
+class ViewletBase(orig_viewlet.ViewletBase):
 pass
 
-class SimpleAttributeViewlet(orig_viewlet.SimpleAttributeViewlet, Explicit):
+class SimpleAttributeViewlet(orig_viewlet.SimpleAttributeViewlet):
 pass
 
 class simple(orig_viewlet.simple):
@@ -52,7 +50,7 @@
 return class_
 
 
-class ResourceViewletBase(orig_viewlet.ResourceViewletBase, Explicit):
+class ResourceVie

[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/Products/Five/ Removed some more references to Acquisition

2007-07-29 Thread Hanno Schlichting
Log message for revision 78455:
  Removed some more references to Acquisition
  

Changed:
  U   
Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py
  U   
Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/provider.txt
  U   Zope/branches/philikon-aq/lib/python/Products/Five/component/__init__.py
  U   Zope/branches/philikon-aq/lib/python/Products/Five/doc/manual.txt
  U   Zope/branches/philikon-aq/lib/python/Products/Five/form/objectwidget.py

-=-
Modified: 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py
===
--- 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py  
2007-07-29 10:58:03 UTC (rev 78454)
+++ 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py  
2007-07-29 11:11:27 UTC (rev 78455)
@@ -17,9 +17,7 @@
 """
 import zope.app.pagetemplate
 
-from Acquisition import aq_base
 from Acquisition import aq_get
-from Acquisition import aq_parent
 from AccessControl import getSecurityManager
 from Products.PageTemplates.Expressions import SecureModuleImporter
 from Products.PageTemplates.Expressions import createTrustedZopeEngine

Modified: 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/provider.txt
===
--- 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/provider.txt   
2007-07-29 10:58:03 UTC (rev 78454)
+++ 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/provider.txt   
2007-07-29 11:11:27 UTC (rev 78455)
@@ -188,18 +188,15 @@
 
   
 
-Now we test a provider using a PageTemplateFile to render itself.  It must
-inherit from an Acquisition base class so that the template can use Zope 2
-security mechanisms:
+Now we test a provider using a PageTemplateFile to render itself:
 
   >>> import os, tempfile
   >>> temp_dir = tempfile.mkdtemp()
   >>> dynTemplate = os.path.join(temp_dir, 'dynamic_template.pt')
   >>> open(dynTemplate, 'w').write(
   ...   'A simple template: ')
-  >>> from Acquisition import Explicit
   >>> from Products.Five.browser.pagetemplatefile import 
ZopeTwoPageTemplateFile
-  >>> class TemplateProvider(Explicit):
+  >>> class TemplateProvider(object):
   ... zope.component.adapts(zope.interface.Interface,
   ...   browser.IDefaultBrowserLayer,
   ...   zope.interface.Interface)

Modified: 
Zope/branches/philikon-aq/lib/python/Products/Five/component/__init__.py
===
--- Zope/branches/philikon-aq/lib/python/Products/Five/component/__init__.py
2007-07-29 10:58:03 UTC (rev 78454)
+++ Zope/branches/philikon-aq/lib/python/Products/Five/component/__init__.py
2007-07-29 11:11:27 UTC (rev 78455)
@@ -36,7 +36,7 @@
 """Find a site by walking up the object hierarchy, supporting both
 the ``ILocation`` API and Zope 2 Acquisition."""
 while obj is not None and not iface.providedBy(obj):
-obj = getattr(obj, '__parent__', aq_parent(aq_inner(obj)))
+obj = aq_parent(aq_inner(obj))
 return obj
 
 @zope.component.adapter(zope.interface.Interface)

Modified: Zope/branches/philikon-aq/lib/python/Products/Five/doc/manual.txt
===
--- Zope/branches/philikon-aq/lib/python/Products/Five/doc/manual.txt   
2007-07-29 10:58:03 UTC (rev 78454)
+++ Zope/branches/philikon-aq/lib/python/Products/Five/doc/manual.txt   
2007-07-29 11:11:27 UTC (rev 78455)
@@ -271,13 +271,6 @@
 * They need to be initialized with the Zope 2 security system, as
   otherwise you cannot use the view.
 
-* This also means they need to be part of the Zope 2 acquisition
-  system, as this is a requirement for Zope 2 security to
-  function. The ``BrowserView`` base class, available from
-  ``Products.Five``, already inherits from ``Acquisition.Explicit`` to
-  make this be the case. Acquisition is explicit so no attributes can
-  be acquired by accident.
-
 An example of a simple view::
  
   from Products.Five import BrowserView

Modified: 
Zope/branches/philikon-aq/lib/python/Products/Five/form/objectwidget.py
===
--- Zope/branches/philikon-aq/lib/python/Products/Five/form/objectwidget.py 
2007-07-29 10:58:03 UTC (rev 78454)
+++ Zope/branches/philikon-aq/lib/python/Products/Five/form/objectwidget.py 
2007-07-29 11:11:27 UTC (rev 78455)
@@ -14,11 +14,9 @@
 """Five-compatible version of ObjectWidget
 
 This is needed because ObjectWidget uses ViewPageTemplateFile whose
-macro definition is unfortunately incompatible with
-ZopeTwoPageTemplateFile.  So this subclass uses
-ZopeTwoPageTemplateFile for the template that renders the widget's
-sub-editform.  Acquisition has to be mixed in to provide the
-ZopeTwoPageTemplateFile with the prop

[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/Products/Five/browser/providerexpression.py We don't need a custom Z2ProviderExpression anymore :)

2007-07-29 Thread Hanno Schlichting
Log message for revision 78456:
  We don't need a custom Z2ProviderExpression anymore :)
  

Changed:
  U   
Zope/branches/philikon-aq/lib/python/Products/Five/browser/providerexpression.py

-=-
Modified: 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/providerexpression.py
===
--- 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/providerexpression.py
2007-07-29 11:11:27 UTC (rev 78455)
+++ 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/providerexpression.py
2007-07-29 11:17:46 UTC (rev 78456)
@@ -15,37 +15,12 @@
 
 $Id$
 """
-import zope.component
 from zope.contentprovider import interfaces as cp_interfaces
-from zope.contentprovider.tales import addTALNamespaceData
+from zope.contentprovider.tales import TALESProviderExpression
 from zope.interface import implements
-from zope.tales.expressions import StringExpr
 
-class Z2ProviderExpression(StringExpr):
-"""Create a custom provider expression which overrides __call__ to
-   acquisition wrap the provider so that security lookups can be done."""
+class Z2ProviderExpression(TALESProviderExpression):
+"""This legacy provider was needed before to add acquisition wrappers to
+the providers in order for security to work."""
 
 implements(cp_interfaces.ITALESProviderExpression)
-
-def __call__(self, econtext):
-name = super(Z2ProviderExpression, self).__call__(econtext)
-context = econtext.vars['context']
-request = econtext.vars['request']
-view = econtext.vars['view']
-
-# Try to look up the provider.
-provider = zope.component.queryMultiAdapter(
-(context, request, view), cp_interfaces.IContentProvider, name)
-
-# Provide a useful error message, if the provider was not found.
-if provider is None:
-raise cp_interfaces.ContentProviderLookupError(name)
-
-# Insert the data gotten from the context
-addTALNamespaceData(provider, econtext)
-
-# Stage 1: Do the state update.
-provider.update()
-
-# Stage 2: Render the HTML content.
-return provider.render()

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


[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/Products/Five/browser/ Moved special __parent__ behaviour up to the browserview class, so all classes inheriting from it, gain this special b

2007-07-29 Thread Hanno Schlichting
Log message for revision 78463:
  Moved special __parent__ behaviour up to the browserview class, so all 
classes inheriting from it, gain this special behavior.
  

Changed:
  U   Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py
  U   Zope/branches/philikon-aq/lib/python/Products/Five/browser/adding.py

-=-
Modified: Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py
===
--- Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py  
2007-07-29 15:22:17 UTC (rev 78462)
+++ Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py  
2007-07-29 15:26:37 UTC (rev 78463)
@@ -17,8 +17,10 @@
 """
 
 import zope.publisher.browser
-import Acquisition
 
+from Acquisition import aq_chain
+from Acquisition import aq_inner
+
 class BrowserView(zope.publisher.browser.BrowserView):
 
 # BBB for code that expects BrowserView to still inherit from
@@ -27,6 +29,18 @@
 def __of__(self, context):
 return self
 
+# XXX Classes which are still based on Acquisition and access
+# self.context in a method need to call aq_inner on it, or get a funky
+# aq_chain. We do this here for BBB friendly purposes.
+
+def __getParent(self):
+return getattr(self, '_parent', aq_inner(self.context))
+
+def __setParent(self, parent):
+self._parent = parent
+
+__parent__ = property(__getParent, __setParent)
+
 # We provide the aq_* properties here for BBB
 
 @property
@@ -41,4 +55,4 @@
 
 @property
 def aq_chain(self):
-return Acquisition.aq_chain(self)
+return aq_chain(self)

Modified: Zope/branches/philikon-aq/lib/python/Products/Five/browser/adding.py
===
--- Zope/branches/philikon-aq/lib/python/Products/Five/browser/adding.py
2007-07-29 15:22:17 UTC (rev 78462)
+++ Zope/branches/philikon-aq/lib/python/Products/Five/browser/adding.py
2007-07-29 15:26:37 UTC (rev 78463)
@@ -35,7 +35,6 @@
 from zope.app.container.constraints import checkFactory, checkObject
 from zope.app.publisher.browser.menu import getMenu
 
-from Acquisition import aq_inner
 from zExceptions import BadRequest
 from OFS.SimpleItem import SimpleItem
 
@@ -206,16 +205,6 @@
 
 menu_id = "add_content"
 
-def __getParent(self):
-# This class is based on Acquisition and accesses self.context
-# We need to call aq_inner on it, or we get a funky aq_chain
-return getattr(self, '_parent', aq_inner(self.context))
-
-def __setParent(self, parent):
-self._parent = parent
-
-__parent__ = property(__getParent, __setParent)
-
 class ObjectManagerNameChooser:
 """A name chooser for a Zope object manager.
 """

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


[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/Products/Five/ Fixed test failures in forms.txt.

2007-07-29 Thread Hanno Schlichting
Log message for revision 78461:
  Fixed test failures in forms.txt.
  

Changed:
  U   Zope/branches/philikon-aq/lib/python/Products/Five/browser/adding.py
  U   Zope/branches/philikon-aq/lib/python/Products/Five/form/tests/forms.txt

-=-
Modified: Zope/branches/philikon-aq/lib/python/Products/Five/browser/adding.py
===
--- Zope/branches/philikon-aq/lib/python/Products/Five/browser/adding.py
2007-07-29 14:57:38 UTC (rev 78460)
+++ Zope/branches/philikon-aq/lib/python/Products/Five/browser/adding.py
2007-07-29 15:11:41 UTC (rev 78461)
@@ -35,6 +35,7 @@
 from zope.app.container.constraints import checkFactory, checkObject
 from zope.app.publisher.browser.menu import getMenu
 
+from Acquisition import aq_inner
 from zExceptions import BadRequest
 from OFS.SimpleItem import SimpleItem
 
@@ -205,6 +206,16 @@
 
 menu_id = "add_content"
 
+def __getParent(self):
+# This class is based on Acquisition and accesses self.context
+# We need to call aq_inner on it, or we get a funky aq_chain
+return getattr(self, '_parent', aq_inner(self.context))
+
+def __setParent(self, parent):
+self._parent = parent
+
+__parent__ = property(__getParent, __setParent)
+
 class ObjectManagerNameChooser:
 """A name chooser for a Zope object manager.
 """

Modified: 
Zope/branches/philikon-aq/lib/python/Products/Five/form/tests/forms.txt
===
--- Zope/branches/philikon-aq/lib/python/Products/Five/form/tests/forms.txt 
2007-07-29 14:57:38 UTC (rev 78460)
+++ Zope/branches/philikon-aq/lib/python/Products/Five/form/tests/forms.txt 
2007-07-29 15:11:41 UTC (rev 78461)
@@ -24,7 +24,6 @@
 
   >>> from Products.Five.testbrowser import Browser
   >>> browser = Browser()
-  >>> browser.handleErrors = False
   >>> browser.addHeader('Accept-Language', 'en-US')
 
 Add forms

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


[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py Simplify aq_parent

2007-07-29 Thread Hanno Schlichting
Log message for revision 78464:
  Simplify aq_parent

Changed:
  U   Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py

-=-
Modified: Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py
===
--- Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py  
2007-07-29 15:26:37 UTC (rev 78463)
+++ Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py  
2007-07-29 15:28:56 UTC (rev 78464)
@@ -39,7 +39,7 @@
 def __setParent(self, parent):
 self._parent = parent
 
-__parent__ = property(__getParent, __setParent)
+aq_parent = __parent__ = property(__getParent, __setParent)
 
 # We provide the aq_* properties here for BBB
 
@@ -50,9 +50,5 @@
 aq_self = aq_inner = aq_base
 
 @property
-def aq_parent(self):
-return self.__parent__
-
-@property
 def aq_chain(self):
 return aq_chain(self)

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


[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py Added hint on where the segfault happens. My test output is irritating, it seems we end up with a cyclic aq

2007-08-01 Thread Hanno Schlichting
Log message for revision 78523:
  Added hint on where the segfault happens. My test output is irritating, it 
seems we end up with a cyclic aq_chain again :(

Changed:
  U   Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py

-=-
Modified: Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py
===
--- Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py  
2007-08-01 04:57:53 UTC (rev 78522)
+++ Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py  
2007-08-01 07:42:20 UTC (rev 78523)
@@ -28,6 +28,9 @@
 # __of__ works.  With Acquisition, you get a wrapper around
 # the original object and only that wrapper's parent is the
 # new context.  Here we change the original object.
+
+# The first segfault happens in form.tests.forms.txt in the first line
+# of the "Widget Overrides" chapter (line 154).
 #self.__parent__ = context  # ugh. segfault!
 
 return self

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


[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py Added a bit of debugging code, so someone more knowledgeable can have a look ; )

2007-08-02 Thread Hanno Schlichting
Log message for revision 78543:
  Added a bit of debugging code, so someone more knowledgeable can have a look 
;)

Changed:
  U   Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py

-=-
Modified: Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py
===
--- Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py  
2007-08-02 01:22:24 UTC (rev 78542)
+++ Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py  
2007-08-02 07:19:31 UTC (rev 78543)
@@ -23,16 +23,29 @@
 # BBB for code that expects BrowserView to still inherit from
 # Acquisition.Explicit.
 
+# counter = 0
+
 def __of__(self, context):
 # Technically this isn't in line with the way Acquisition's
 # __of__ works.  With Acquisition, you get a wrapper around
 # the original object and only that wrapper's parent is the
 # new context.  Here we change the original object.
 
-# The first segfault happens in form.tests.forms.txt in the first line
-# of the "Widget Overrides" chapter (line 154).
-#self.__parent__ = context  # ugh. segfault!
+# XXX The first segfault happens in form.tests.forms.txt in the first
+# line of the "Widget Overrides" chapter (line 154).
 
+# What causes it is:
+
+# ../zope2/lib/python/Zope2/App/startup.py(199)__call__()
+# -> log = aq_acquire(published, '__error_log__', containment=1)
+
+# Which causes an infinite loop :(
+
+# self.__parent__ = context  # ugh. segfault!
+# self.counter = self.counter + 1
+# if self.counter > 10:
+# import pdb; pdb.set_trace()
+
 return self
 
 # Classes which are still based on Acquisition and access
@@ -56,3 +69,4 @@
 
 def aq_inContextOf(self, *args, **kw):
 return Acquisition.aq_inContextOf(self, *args, **kw)
+

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


[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py Removed debugging code.

2007-08-08 Thread Hanno Schlichting
Log message for revision 78715:
  Removed debugging code.

Changed:
  U   Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py

-=-
Modified: Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py
===
--- Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py  
2007-08-08 17:52:14 UTC (rev 78714)
+++ Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py  
2007-08-08 20:43:25 UTC (rev 78715)
@@ -23,29 +23,11 @@
 # BBB for code that expects BrowserView to still inherit from
 # Acquisition.Explicit.
 
-# counter = 0
-
 def __of__(self, context):
 # Technically this isn't in line with the way Acquisition's
-# __of__ works.  With Acquisition, you get a wrapper around
+# __of__ works. With Acquisition, you get a wrapper around
 # the original object and only that wrapper's parent is the
-# new context.  Here we change the original object.
-
-# XXX The first segfault happens in form.tests.forms.txt in the first
-# line of the "Widget Overrides" chapter (line 154).
-
-# What causes it is:
-
-# ../zope2/lib/python/Zope2/App/startup.py(199)__call__()
-# -> log = aq_acquire(published, '__error_log__', containment=1)
-
-# Which causes an infinite loop :(
-
-# self.__parent__ = context  # ugh. segfault!
-# self.counter = self.counter + 1
-# if self.counter > 10:
-# import pdb; pdb.set_trace()
-
+# new context.
 return self
 
 # Classes which are still based on Acquisition and access

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


[Zope-Checkins] SVN: Zope/trunk/ All Products folders as well as the zope and zope.app folders are declared as setuptools namespace packages now. This allows products to be shipped and included as sta

2007-08-25 Thread Hanno Schlichting
Log message for revision 79263:
  All Products folders as well as the zope and zope.app folders are declared as 
setuptools namespace packages now. This allows products to be shipped and 
included as standard eggs without loosing any of their special Zope2 treatment. 
See http://mail.zope.org/pipermail/zope-dev/2007-April/029257.html for 
discussion.
  

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  U   Zope/trunk/lib/python/Products/__init__.py
  U   Zope/trunk/lib/python/zope/__init__.py
  U   Zope/trunk/lib/python/zope/app/__init__.py
  U   Zope/trunk/skel/Products/README.txt
  A   Zope/trunk/skel/Products/__init__.py

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===
--- Zope/trunk/doc/CHANGES.txt  2007-08-25 14:24:03 UTC (rev 79262)
+++ Zope/trunk/doc/CHANGES.txt  2007-08-25 14:38:28 UTC (rev 79263)
@@ -9,6 +9,11 @@
 
 Restructuring
 
+  - All Products folders as well as the zope and zope.app folders are
+declared as setuptools namespace packages now. See
+http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
+for more information about namespace packages.
+
   - ZPT: removed display of ZPT warnings since warnings were
 removed from the zope.pagetemplate implementation 
 

Modified: Zope/trunk/lib/python/Products/__init__.py
===
--- Zope/trunk/lib/python/Products/__init__.py  2007-08-25 14:24:03 UTC (rev 
79262)
+++ Zope/trunk/lib/python/Products/__init__.py  2007-08-25 14:38:28 UTC (rev 
79263)
@@ -11,3 +11,10 @@
 #
 ##
 __ac_permissions__=()
+
+# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
+try:
+__import__('pkg_resources').declare_namespace(__name__)
+except ImportError:
+from pkgutil import extend_path
+__path__ = extend_path(__path__, __name__)

Modified: Zope/trunk/lib/python/zope/__init__.py
===
--- Zope/trunk/lib/python/zope/__init__.py  2007-08-25 14:24:03 UTC (rev 
79262)
+++ Zope/trunk/lib/python/zope/__init__.py  2007-08-25 14:38:28 UTC (rev 
79263)
@@ -13,10 +13,16 @@
 ##
 """Zope Container Package
 
-This package uses pkgutil so that the package can be split over
+This package uses setuptools / pkgutil so that the package can be split over
 multiple directories.
 
+See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
+
 $Id$
 """
-from pkgutil import extend_path
-__path__ = extend_path(__path__, __name__)
+
+try:
+__import__('pkg_resources').declare_namespace(__name__)
+except ImportError:
+from pkgutil import extend_path
+__path__ = extend_path(__path__, __name__)

Modified: Zope/trunk/lib/python/zope/app/__init__.py
===
--- Zope/trunk/lib/python/zope/app/__init__.py  2007-08-25 14:24:03 UTC (rev 
79262)
+++ Zope/trunk/lib/python/zope/app/__init__.py  2007-08-25 14:38:28 UTC (rev 
79263)
@@ -13,6 +13,16 @@
 ##
 """Zope application package.
 
+This package uses setuptools / pkgutil so that the package can be split over
+multiple directories.
+
+See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
+
 $Id$
 """
 
+try:
+__import__('pkg_resources').declare_namespace(__name__)
+except ImportError:
+from pkgutil import extend_path
+__path__ = extend_path(__path__, __name__)

Modified: Zope/trunk/skel/Products/README.txt
===
--- Zope/trunk/skel/Products/README.txt 2007-08-25 14:24:03 UTC (rev 79262)
+++ Zope/trunk/skel/Products/README.txt 2007-08-25 14:38:28 UTC (rev 79263)
@@ -1,3 +1,3 @@
 Additional products for your Zope instance should be installed in this
 directory.  A freshly created instance should only contain this
-README.txt file in this directory.
+README.txt file and an __init__.py in this directory.

Added: Zope/trunk/skel/Products/__init__.py
===
--- Zope/trunk/skel/Products/__init__.py(rev 0)
+++ Zope/trunk/skel/Products/__init__.py2007-08-25 14:38:28 UTC (rev 
79263)
@@ -0,0 +1,6 @@
+# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
+try:
+__import__('pkg_resources').declare_namespace(__name__)
+except ImportError:
+from pkgutil import extend_path
+__path__ = extend_path(__path__, __name__)


Property changes on: Zope/trunk/skel/Products/__init__.py
___
Name: svn:eol-style
   + native

___
Zope-Checkins maillist  -  Zope-Che

[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py Use an explicit __init__ to work around problems with magically inserted super classes when using BrowserVi

2007-08-28 Thread Hanno Schlichting
Log message for revision 79323:
  Use an explicit __init__ to work around problems with magically inserted 
super classes when using BrowserView as a base for viewlets.

Changed:
  U   Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py

-=-
Modified: Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py
===
--- Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py  
2007-08-28 17:46:52 UTC (rev 79322)
+++ Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py  
2007-08-28 19:25:24 UTC (rev 79323)
@@ -23,6 +23,11 @@
 # BBB for code that expects BrowserView to still inherit from
 # Acquisition.Explicit.
 
+# Use an explicit __init__ to work around problems with magically inserted
+# super classes when using BrowserView as a base for viewlets.
+def __init__(self, context, request):
+zope.publisher.browser.BrowserView.__init__(self, context, request)
+
 def __of__(self, context):
 # Technically this isn't in line with the way Acquisition's
 # __of__ works. With Acquisition, you get a wrapper around

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


[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/Products/Five/b Commit first version of AQBBB

2007-08-28 Thread Hanno Schlichting
Log message for revision 79325:
  Commit first version of AQBBB
  

Changed:
  U   Zope/branches/philikon-aq/lib/python/Products/Five/bbb.py
  U   Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py

-=-
Modified: Zope/branches/philikon-aq/lib/python/Products/Five/bbb.py
===
--- Zope/branches/philikon-aq/lib/python/Products/Five/bbb.py   2007-08-28 
19:56:54 UTC (rev 79324)
+++ Zope/branches/philikon-aq/lib/python/Products/Five/bbb.py   2007-08-28 
20:13:03 UTC (rev 79325)
@@ -19,10 +19,32 @@
 from zope.component.interfaces import ComponentLookupError
 from zope.app.publisher.browser import getDefaultViewName
 
-import zExceptions
-import Products.Five.security
-from Products.Five import fivemethod
+import Acquisition
 
+
+class AquisitionBBB(object):
+"""Emulate a class implementing Acquisition.interfaces.IAcquirer and
+IAcquisitionWrapper.
+"""
+
+def __of__(self, context):
+# Technically this isn't in line with the way Acquisition's
+# __of__ works. With Acquisition, you get a wrapper around
+# the original object and only that wrapper's parent is the
+# new context.
+return self
+
+aq_self = aq_inner = aq_base = property(lambda self: self)
+aq_chain = property(Acquisition.aq_chain)
+aq_parent = property(Acquisition.aq_parent)
+
+def aq_acquire(self, *args, **kw):
+return Acquisition.aq_acquire(self, *args, **kw)
+
+def aq_inContextOf(self, *args, **kw):
+return Acquisition.aq_inContextOf(self, *args, **kw)
+
+
 class IBrowserDefault(Interface):
 """Provide a hook for deciding about the default view for an object"""
 

Modified: Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py
===
--- Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py  
2007-08-28 19:56:54 UTC (rev 79324)
+++ Zope/branches/philikon-aq/lib/python/Products/Five/browser/__init__.py  
2007-08-28 20:13:03 UTC (rev 79325)
@@ -18,23 +18,16 @@
 import Acquisition
 import zope.publisher.browser
 
-class BrowserView(zope.publisher.browser.BrowserView):
+from Products.Five.bbb import AquisitionBBB
 
-# BBB for code that expects BrowserView to still inherit from
-# Acquisition.Explicit.
 
+class BrowserView(zope.publisher.browser.BrowserView, AquisitionBBB):
+
 # Use an explicit __init__ to work around problems with magically inserted
 # super classes when using BrowserView as a base for viewlets.
 def __init__(self, context, request):
 zope.publisher.browser.BrowserView.__init__(self, context, request)
 
-def __of__(self, context):
-# Technically this isn't in line with the way Acquisition's
-# __of__ works. With Acquisition, you get a wrapper around
-# the original object and only that wrapper's parent is the
-# new context.
-return self
-
 # Classes which are still based on Acquisition and access
 # self.context in a method need to call aq_inner on it, or get a
 # funky aq_chain. We do this here for BBB friendly purposes.
@@ -46,14 +39,3 @@
 self._parent = parent
 
 aq_parent = __parent__ = property(__getParent, __setParent)
-
-# We provide the aq_* properties here for BBB
-aq_self = aq_inner = aq_base = property(lambda self: self)
-aq_chain = property(Acquisition.aq_chain)
-
-def aq_acquire(self, *args, **kw):
-return Acquisition.aq_acquire(self, *args, **kw)
-
-def aq_inContextOf(self, *args, **kw):
-return Acquisition.aq_inContextOf(self, *args, **kw)
-

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


[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/Products/Five/viewlet/viewlet.py Added AQBB to the viewlets.

2007-08-28 Thread Hanno Schlichting
Log message for revision 79326:
  Added AQBB to the viewlets.
  

Changed:
  U   Zope/branches/philikon-aq/lib/python/Products/Five/viewlet/viewlet.py

-=-
Modified: Zope/branches/philikon-aq/lib/python/Products/Five/viewlet/viewlet.py
===
--- Zope/branches/philikon-aq/lib/python/Products/Five/viewlet/viewlet.py   
2007-08-28 20:13:03 UTC (rev 79325)
+++ Zope/branches/philikon-aq/lib/python/Products/Five/viewlet/viewlet.py   
2007-08-28 20:25:37 UTC (rev 79326)
@@ -17,12 +17,14 @@
 """
 import os
 import zope.viewlet.viewlet
+from Products.Five.bbb import AquisitionBBB
 from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
 
-class ViewletBase(zope.viewlet.viewlet.ViewletBase):
+class ViewletBase(zope.viewlet.viewlet.ViewletBase, AquisitionBBB):
 pass
 
-class SimpleAttributeViewlet(zope.viewlet.viewlet.SimpleAttributeViewlet):
+class SimpleAttributeViewlet(zope.viewlet.viewlet.SimpleAttributeViewlet,
+ AquisitionBBB):
 pass
 
 class simple(zope.viewlet.viewlet.simple):

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


[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py Provide BBB for ViewPageTemplateFile

2007-08-28 Thread Hanno Schlichting
Log message for revision 79328:
  Provide BBB for ViewPageTemplateFile

Changed:
  U   
Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py

-=-
Modified: 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py
===
--- 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py  
2007-08-28 21:20:45 UTC (rev 79327)
+++ 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py  
2007-08-28 21:21:09 UTC (rev 79328)
@@ -15,6 +15,7 @@
 
 $Id$
 """
+from os.path import basename
 import zope.app.pagetemplate
 
 from Acquisition import aq_get
@@ -22,12 +23,22 @@
 from Products.PageTemplates.Expressions import SecureModuleImporter
 from Products.PageTemplates.Expressions import createTrustedZopeEngine
 
+from Products.Five.bbb import AquisitionBBB
+
 _engine = createTrustedZopeEngine()
 def getEngine():
 return _engine
 
-class ViewPageTemplateFile(zope.app.pagetemplate.ViewPageTemplateFile):
+class ViewPageTemplateFile(zope.app.pagetemplate.ViewPageTemplateFile,
+   AquisitionBBB):
 
+def getId(self):
+return basename(self.filename)
+
+@property
+def id(self):
+return self.getId()
+
 def pt_getEngine(self):
 return getEngine()
 

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


[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py Simplify my braindead code

2007-08-28 Thread Hanno Schlichting
Log message for revision 79329:
  Simplify my braindead code

Changed:
  U   
Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py

-=-
Modified: 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py
===
--- 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py  
2007-08-28 21:21:09 UTC (rev 79328)
+++ 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py  
2007-08-28 21:29:24 UTC (rev 79329)
@@ -35,9 +35,7 @@
 def getId(self):
 return basename(self.filename)
 
-@property
-def id(self):
-return self.getId()
+property(getId)
 
 def pt_getEngine(self):
 return getEngine()

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


[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py I'm too tired to code.

2007-08-28 Thread Hanno Schlichting
Log message for revision 79330:
  I'm too tired to code.

Changed:
  U   
Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py

-=-
Modified: 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py
===
--- 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py  
2007-08-28 21:29:24 UTC (rev 79329)
+++ 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py  
2007-08-28 21:37:05 UTC (rev 79330)
@@ -35,7 +35,7 @@
 def getId(self):
 return basename(self.filename)
 
-property(getId)
+id = property(getId)
 
 def pt_getEngine(self):
 return getEngine()

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


[Zope-Checkins] SVN: Zope/trunk/ The ZPublisher HTTP request has now both the debug and locale attributes available, like its Zope 3 counterpart, as discussed in http://mail.zope.org/pipermail/zope-de

2007-09-16 Thread Hanno Schlichting
Log message for revision 79698:
  The ZPublisher HTTP request has now both the debug and locale attributes 
available, like its Zope 3 counterpart, as discussed in 
http://mail.zope.org/pipermail/zope-dev/2007-September/029719.html.
  

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  U   Zope/trunk/lib/python/Products/Five/form/__init__.py
  U   Zope/trunk/lib/python/Products/Five/formlib/formbase.py
  U   Zope/trunk/lib/python/ZPublisher/HTTPRequest.py
  U   Zope/trunk/lib/python/ZPublisher/tests/testHTTPRequest.py

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===
--- Zope/trunk/doc/CHANGES.txt  2007-09-16 16:54:06 UTC (rev 79697)
+++ Zope/trunk/doc/CHANGES.txt  2007-09-16 17:15:42 UTC (rev 79698)
@@ -69,6 +69,15 @@
 
 Features added
 
+  - The ZPublisher HTTP request has now both the debug and locale
+attributes available, like its Zope 3 counterpart. The debug attribute
+was so far limited to code from the zope.* namespace in order to make
+the Zope 3 ZPT engine work. The locale attribute provides access to an
+zope.i18n.interfaces.locales.ILocale object with access to locale
+related information like date / time formatting or translated language
+and country names. Form variables of both debug and locale will shadow
+these two attributes and their use is therefor discouraged.
+
   - MailHost: now uses zope.sendmail for delivering the mail. With this 
change
 MailHost integrates with the Zope transaction system (avoids sending 
dupe
 emails in case of conflict errors). In addition MailHost now provides 

Modified: Zope/trunk/lib/python/Products/Five/form/__init__.py
===
--- Zope/trunk/lib/python/Products/Five/form/__init__.py2007-09-16 
16:54:06 UTC (rev 79697)
+++ Zope/trunk/lib/python/Products/Five/form/__init__.py2007-09-16 
17:15:42 UTC (rev 79698)
@@ -120,14 +120,11 @@
  names=self.fieldNames)
 if changed:
 self.changed()
-# XXX: Needs locale support:
-#formatter = self.request.locale.dates.getFormatter(
-#'dateTime', 'medium')
-#status = _("Updated on ${date_time}",
-#   mapping={'date_time':
-#formatter.format(datetime.utcnow())})
+formatter = self.request.locale.dates.getFormatter(
+   'dateTime', 'medium')
 status = _("Updated on ${date_time}",
-   mapping={'date_time': str(datetime.utcnow())})
+  mapping={'date_time':
+   formatter.format(datetime.utcnow())})
 
 self.update_status = status
 return status

Modified: Zope/trunk/lib/python/Products/Five/formlib/formbase.py
===
--- Zope/trunk/lib/python/Products/Five/formlib/formbase.py 2007-09-16 
16:54:06 UTC (rev 79697)
+++ Zope/trunk/lib/python/Products/Five/formlib/formbase.py 2007-09-16 
17:15:42 UTC (rev 79698)
@@ -60,27 +60,8 @@
 
 
 class EditFormBase(FiveFormlibMixin, form.EditFormBase):
+pass
 
-# Overrides formlib.form.EditFormBase.handle_edit_action, to remove
-# dependecy on request.locale
-
-@form.action(_("Apply"), condition=form.haveInputWidgets)
-def handle_edit_action(self, action, data):
-if form.applyChanges(
-self.context, self.form_fields, data, self.adapters):
-
-zope.event.notify(
-zope.lifecycleevent.ObjectModifiedEvent(self.context)
-)
-# TODO: Needs locale support. See also Five.form.EditView.
-self.status = _(
-"Updated on ${date_time}", 
-mapping={'date_time': str(datetime.utcnow())}
-)
-else:
-self.status = _('No changes')
-
-
 class DisplayFormBase(FiveFormlibMixin, form.DisplayFormBase):
 pass
 

Modified: Zope/trunk/lib/python/ZPublisher/HTTPRequest.py
===
--- Zope/trunk/lib/python/ZPublisher/HTTPRequest.py 2007-09-16 16:54:06 UTC 
(rev 79697)
+++ Zope/trunk/lib/python/ZPublisher/HTTPRequest.py 2007-09-16 17:15:42 UTC 
(rev 79698)
@@ -13,7 +13,7 @@
 
 __version__='$Revision: 1.96 $'[11:-2]
 
-import re, sys, os, time, random, codecs, inspect, tempfile
+import re, sys, os, time, random, codecs, tempfile
 from types import StringType, UnicodeType
 from BaseRequest import BaseRequest, quote
 from HTTPResponse import HTTPResponse
@@ -25,6 +25,8 @@
 from maybe_lock import allocate_lock
 xmlrpc=None # Placeholder for module that we'll import if we have to.
 
+from zope.i18n.interfaces import IUserPrefe

[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/App/FactoryDispatcher.py Use the API luke!

2007-10-14 Thread Hanno Schlichting
Log message for revision 80869:
  Use the API luke!
  

Changed:
  U   Zope/branches/philikon-aq/lib/python/App/FactoryDispatcher.py

-=-
Modified: Zope/branches/philikon-aq/lib/python/App/FactoryDispatcher.py
===
--- Zope/branches/philikon-aq/lib/python/App/FactoryDispatcher.py   
2007-10-13 22:35:41 UTC (rev 80868)
+++ Zope/branches/philikon-aq/lib/python/App/FactoryDispatcher.py   
2007-10-14 10:19:28 UTC (rev 80869)
@@ -66,7 +66,7 @@
 _owner=UnownableOwner
 
 def __init__(self, product, dest, REQUEST=None):
-if hasattr(product,'aq_base'): product=product.aq_base
+product = Acquisition.aq_base(product)
 self._product=product
 self._d=dest
 if REQUEST is not None:
@@ -100,7 +100,7 @@
 m=d[name]
 w=getattr(m, '_permissionMapper', None)
 if w is not None:
-m=aqwrap(m, getattr(w,'aq_base',w), self)
+m=aqwrap(m, Acquisition.aq_base(w), self)
 
 return m
 

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


[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/ Merge c79698 from trunk - sane request.debug and .locale handling...

2007-10-15 Thread Hanno Schlichting
Log message for revision 80874:
  Merge c79698 from trunk - sane request.debug and .locale handling...
  

Changed:
  U   Zope/branches/philikon-aq/lib/python/Products/Five/form/__init__.py
  U   Zope/branches/philikon-aq/lib/python/Products/Five/formlib/formbase.py
  U   Zope/branches/philikon-aq/lib/python/ZPublisher/HTTPRequest.py
  U   Zope/branches/philikon-aq/lib/python/ZPublisher/tests/testHTTPRequest.py

-=-
Modified: Zope/branches/philikon-aq/lib/python/Products/Five/form/__init__.py
===
--- Zope/branches/philikon-aq/lib/python/Products/Five/form/__init__.py 
2007-10-15 04:42:12 UTC (rev 80873)
+++ Zope/branches/philikon-aq/lib/python/Products/Five/form/__init__.py 
2007-10-15 09:38:44 UTC (rev 80874)
@@ -120,14 +120,11 @@
  names=self.fieldNames)
 if changed:
 self.changed()
-# XXX: Needs locale support:
-#formatter = self.request.locale.dates.getFormatter(
-#'dateTime', 'medium')
-#status = _("Updated on ${date_time}",
-#   mapping={'date_time':
-#formatter.format(datetime.utcnow())})
+formatter = self.request.locale.dates.getFormatter(
+   'dateTime', 'medium')
 status = _("Updated on ${date_time}",
-   mapping={'date_time': str(datetime.utcnow())})
+  mapping={'date_time':
+   formatter.format(datetime.utcnow())})
 
 self.update_status = status
 return status

Modified: Zope/branches/philikon-aq/lib/python/Products/Five/formlib/formbase.py
===
--- Zope/branches/philikon-aq/lib/python/Products/Five/formlib/formbase.py  
2007-10-15 04:42:12 UTC (rev 80873)
+++ Zope/branches/philikon-aq/lib/python/Products/Five/formlib/formbase.py  
2007-10-15 09:38:44 UTC (rev 80874)
@@ -59,27 +59,8 @@
 
 
 class EditFormBase(FiveFormlibMixin, form.EditFormBase):
+pass
 
-# Overrides formlib.form.EditFormBase.handle_edit_action, to remove
-# dependecy on request.locale
-
-@form.action(_("Apply"), condition=form.haveInputWidgets)
-def handle_edit_action(self, action, data):
-if form.applyChanges(
-self.context, self.form_fields, data, self.adapters):
-
-zope.event.notify(
-zope.lifecycleevent.ObjectModifiedEvent(self.context)
-)
-# TODO: Needs locale support. See also Five.form.EditView.
-self.status = _(
-"Updated on ${date_time}", 
-mapping={'date_time': str(datetime.utcnow())}
-)
-else:
-self.status = _('No changes')
-
-
 class DisplayFormBase(FiveFormlibMixin, form.DisplayFormBase):
 pass
 

Modified: Zope/branches/philikon-aq/lib/python/ZPublisher/HTTPRequest.py
===
--- Zope/branches/philikon-aq/lib/python/ZPublisher/HTTPRequest.py  
2007-10-15 04:42:12 UTC (rev 80873)
+++ Zope/branches/philikon-aq/lib/python/ZPublisher/HTTPRequest.py  
2007-10-15 09:38:44 UTC (rev 80874)
@@ -13,7 +13,7 @@
 
 __version__='$Revision: 1.96 $'[11:-2]
 
-import re, sys, os, time, random, codecs, inspect, tempfile
+import re, sys, os, time, random, codecs, tempfile
 from types import StringType, UnicodeType
 from BaseRequest import BaseRequest, quote
 from HTTPResponse import HTTPResponse
@@ -25,6 +25,8 @@
 from maybe_lock import allocate_lock
 xmlrpc=None # Placeholder for module that we'll import if we have to.
 
+from zope.i18n.interfaces import IUserPreferredLanguages
+from zope.i18n.locales import locales, LoadLocaleError
 from zope.publisher.base import DebugFlags
 
 # This may get overwritten during configuration
@@ -240,6 +242,26 @@
 """
 return self._client_addr
 
+def setupLocale(self):
+envadapter = IUserPreferredLanguages(self, None)
+if envadapter is None:
+self._locale = None
+return
+
+langs = envadapter.getPreferredLanguages()
+for httplang in langs:
+parts = (httplang.split('-') + [None, None])[:3]
+try:
+self._locale = locales.getLocale(*parts)
+return
+except LoadLocaleError:
+# Just try the next combination
+pass
+else:
+# No combination gave us an existing locale, so use the default,
+# which is guaranteed to exist
+self._locale = locales.getLocale(None, None, None)
+
 def __init__(self, stdin, environ, response, clean=0):
 self._orig_env=environ
 # Avoid the overhead of scrubbing the environment in the
@@ -2

[Zope-Checkins] SVN: Zope/trunk/ Added LAZY_FILE_LOADING constant to PageTemplateFile. When set to True Page Template files aren't lo

2007-10-16 Thread Hanno Schlichting
Log message for revision 80896:
  Added LAZY_FILE_LOADING constant to PageTemplateFile. When set to True Page 
Template files aren't lo
  aded and parsed on Zope startup anymore, but on first access instead. When 
complex add-ons like Plon
  e are installed this can safe up to 30% of the Zope startup time. This gets a 
ZConfig switch ones I 
  figured out how to write one ;)
  

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  U   Zope/trunk/lib/python/Products/PageTemplates/PageTemplateFile.py
  U   Zope/trunk/lib/python/Products/PageTemplates/tests/test_ptfile.py

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===
--- Zope/trunk/doc/CHANGES.txt  2007-10-16 20:12:30 UTC (rev 80895)
+++ Zope/trunk/doc/CHANGES.txt  2007-10-16 21:16:07 UTC (rev 80896)
@@ -71,6 +71,10 @@
 
 Features added
 
+  - Added LAZY_FILE_LOADING constant to PageTemplateFile. When set to True
+Page Template files aren't lo aded and parsed on Zope startup anymore,
+but on first access instead.
+
   - Testing.ZopeTestCase: Introduced a "ZopeLite" test layer, making it
 possible to mix ZTC and non-ZTC tests much more freely.
 

Modified: Zope/trunk/lib/python/Products/PageTemplates/PageTemplateFile.py
===
--- Zope/trunk/lib/python/Products/PageTemplates/PageTemplateFile.py
2007-10-16 20:12:30 UTC (rev 80895)
+++ Zope/trunk/lib/python/Products/PageTemplates/PageTemplateFile.py
2007-10-16 21:16:07 UTC (rev 80896)
@@ -31,6 +31,8 @@
 
 LOG = getLogger('PageTemplateFile')
 
+LAZY_FILE_LOADING = False
+
 def guess_type(filename, text):
 
 # check for XML ourself since guess_content_type can't
@@ -86,8 +88,9 @@
 
 self.filename = filename
 
-content = open(filename).read()
-self.pt_edit( content, guess_type(filename, content))
+if not LAZY_FILE_LOADING:
+content = open(filename).read()
+self.pt_edit( content, guess_type(filename, content))
 
 def pt_getContext(self):
 root = self.getPhysicalRoot()

Modified: Zope/trunk/lib/python/Products/PageTemplates/tests/test_ptfile.py
===
--- Zope/trunk/lib/python/Products/PageTemplates/tests/test_ptfile.py   
2007-10-16 20:12:30 UTC (rev 80895)
+++ Zope/trunk/lib/python/Products/PageTemplates/tests/test_ptfile.py   
2007-10-16 21:16:07 UTC (rev 80896)
@@ -8,6 +8,7 @@
 
 from Testing.makerequest import makerequest
 
+from Products.PageTemplates import PageTemplateFile as PTF
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 
 
@@ -192,10 +193,42 @@
 def test_mac(self):
 self.assertEqual(self.runPTWithLineEndings('\r'), self.OUTPUT)
 
+
+class LazyLoadingTestCase(unittest.TestCase):
+
+TEMPFILENAME = tempfile.mktemp(".zpt")
+OLD_LAZY = None
+
+def setUp(self):
+self.OLD_LAZY = PTF.LAZY_FILE_LOADING
+
+def tearDown(self):
+if os.path.exists(self.TEMPFILENAME):
+os.unlink(self.TEMPFILENAME)
+PTF.LAZY_FILE_LOADING = self.OLD_LAZY
+
+def test_not_lazy(self):
+f = open(self.TEMPFILENAME, 'w')
+print >> f, 'Lazyness'
+f.close()
+pt = PageTemplateFile(self.TEMPFILENAME)
+self.failUnless(pt._text.startswith('Lazyness'))
+self.failUnless(pt._v_program)
+
+def test_lazy(self):
+f = open(self.TEMPFILENAME, 'w')
+print >> f, 'Lazyness'
+f.close()
+PTF.LAZY_FILE_LOADING = True
+pt = PageTemplateFile(self.TEMPFILENAME)
+self.failUnless(not pt._text and not pt._v_program)
+
+
 def test_suite():
 return unittest.TestSuite((
 unittest.makeSuite(TypeSniffingTestCase),
 unittest.makeSuite(LineEndingsTestCase),
+unittest.makeSuite(LazyLoadingTestCase),
 ))
 
 if __name__ == "__main__":

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


[Zope-Checkins] SVN: Zope/trunk/ Changed PageTemplateFile not to load the file contents on Zope startup anymore but on first access instead. This brings them inline with the zope.pagetemplate version

2007-10-20 Thread Hanno Schlichting
Log message for revision 80940:
  Changed PageTemplateFile not to load the file contents on Zope startup 
anymore but on first access instead. This brings them inline with the 
zope.pagetemplate version and speeds up Zope startup.
  

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  U   Zope/trunk/lib/python/Products/PageTemplates/PageTemplateFile.py
  U   Zope/trunk/lib/python/Products/PageTemplates/tests/test_ptfile.py

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===
--- Zope/trunk/doc/CHANGES.txt  2007-10-19 16:05:16 UTC (rev 80939)
+++ Zope/trunk/doc/CHANGES.txt  2007-10-20 09:57:58 UTC (rev 80940)
@@ -71,10 +71,6 @@
 
 Features added
 
-  - Added LAZY_FILE_LOADING constant to PageTemplateFile. When set to True
-Page Template files aren't lo aded and parsed on Zope startup anymore,
-but on first access instead.
-
   - Testing.ZopeTestCase: Introduced a "ZopeLite" test layer, making it
 possible to mix ZTC and non-ZTC tests much more freely.
 
@@ -179,6 +175,10 @@
 
 Bugs Fixed
 
+  - Changed PageTemplateFile not to load the file contents on Zope startup
+anymore but on first access instead. This brings them inline with the
+zope.pagetemplate version and speeds up Zope startup.
+
   - Launchpad #147201: treat container-class in zope.conf as a string,
 making it possible to use types from extra products directories.
 

Modified: Zope/trunk/lib/python/Products/PageTemplates/PageTemplateFile.py
===
--- Zope/trunk/lib/python/Products/PageTemplates/PageTemplateFile.py
2007-10-19 16:05:16 UTC (rev 80939)
+++ Zope/trunk/lib/python/Products/PageTemplates/PageTemplateFile.py
2007-10-20 09:57:58 UTC (rev 80940)
@@ -31,8 +31,6 @@
 
 LOG = getLogger('PageTemplateFile')
 
-LAZY_FILE_LOADING = False
-
 def guess_type(filename, text):
 
 # check for XML ourself since guess_content_type can't
@@ -88,10 +86,6 @@
 
 self.filename = filename
 
-if not LAZY_FILE_LOADING:
-content = open(filename).read()
-self.pt_edit( content, guess_type(filename, content))
-
 def pt_getContext(self):
 root = self.getPhysicalRoot()
 context = self._getContext()

Modified: Zope/trunk/lib/python/Products/PageTemplates/tests/test_ptfile.py
===
--- Zope/trunk/lib/python/Products/PageTemplates/tests/test_ptfile.py   
2007-10-19 16:05:16 UTC (rev 80939)
+++ Zope/trunk/lib/python/Products/PageTemplates/tests/test_ptfile.py   
2007-10-20 09:57:58 UTC (rev 80940)
@@ -8,7 +8,6 @@
 
 from Testing.makerequest import makerequest
 
-from Products.PageTemplates import PageTemplateFile as PTF
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 
 
@@ -197,29 +196,15 @@
 class LazyLoadingTestCase(unittest.TestCase):
 
 TEMPFILENAME = tempfile.mktemp(".zpt")
-OLD_LAZY = None
 
-def setUp(self):
-self.OLD_LAZY = PTF.LAZY_FILE_LOADING
-
 def tearDown(self):
 if os.path.exists(self.TEMPFILENAME):
 os.unlink(self.TEMPFILENAME)
-PTF.LAZY_FILE_LOADING = self.OLD_LAZY
 
-def test_not_lazy(self):
-f = open(self.TEMPFILENAME, 'w')
-print >> f, 'Lazyness'
-f.close()
-pt = PageTemplateFile(self.TEMPFILENAME)
-self.failUnless(pt._text.startswith('Lazyness'))
-self.failUnless(pt._v_program)
-
 def test_lazy(self):
 f = open(self.TEMPFILENAME, 'w')
 print >> f, 'Lazyness'
 f.close()
-PTF.LAZY_FILE_LOADING = True
 pt = PageTemplateFile(self.TEMPFILENAME)
 self.failUnless(not pt._text and not pt._v_program)
 

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


[Zope-Checkins] SVN: Zope/trunk/ Launchpad #143902: Fixed App.ImageFile to use a stream iterator to output the file. Avoid loading the file content when guessing the mimetype and only load the first 1

2007-10-20 Thread Hanno Schlichting
Log message for revision 80941:
  Launchpad #143902: Fixed App.ImageFile to use a stream iterator to output the 
file. Avoid loading the file content when guessing the mimetype and only load 
the first 1024 bytes of the file when it cannot be guessed from the filename.
  

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  U   Zope/trunk/lib/python/App/ImageFile.py

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===
--- Zope/trunk/doc/CHANGES.txt  2007-10-20 09:57:58 UTC (rev 80940)
+++ Zope/trunk/doc/CHANGES.txt  2007-10-20 10:31:27 UTC (rev 80941)
@@ -175,6 +175,11 @@
 
 Bugs Fixed
 
+  - Launchpad #143902: Fixed App.ImageFile to use a stream iterator to
+output the file. Avoid loading the file content when guessing the
+mimetype and only load the first 1024 bytes of the file when it cannot
+be guessed from the filename.
+
   - Changed PageTemplateFile not to load the file contents on Zope startup
 anymore but on first access instead. This brings them inline with the
 zope.pagetemplate version and speeds up Zope startup.

Modified: Zope/trunk/lib/python/App/ImageFile.py
===
--- Zope/trunk/lib/python/App/ImageFile.py  2007-10-20 09:57:58 UTC (rev 
80940)
+++ Zope/trunk/lib/python/App/ImageFile.py  2007-10-20 10:31:27 UTC (rev 
80941)
@@ -15,6 +15,7 @@
 __version__='$Revision: 1.20 $'[11:-2]
 
 import os
+import stat
 import time
 
 import Acquisition
@@ -28,6 +29,8 @@
 
 from zope.contenttype import guess_content_type
 
+from ZPublisher.Iterators import filestream_iterator
+
 class ImageFile(Acquisition.Explicit):
 """Image objects stored in external files."""
 
@@ -48,16 +51,28 @@
 max_age = 3600 # One hour
 self.cch = 'public,max-age=%d' % max_age
 
-data = open(path, 'rb').read()
-content_type, enc=guess_content_type(path, data)
+# First try to get the content_type by name
+content_type, enc=guess_content_type(path, default='failed')
+
+if content_type == 'failed':
+# This failed, lets look into the file content
+img = open(path, 'rb')
+data = img.read(1024) # 1k should be enough
+img.close()
+
+content_type, enc=guess_content_type(path, data)
+
 if content_type:
 self.content_type=content_type
 else:
-self.content_type='image/%s' % path[path.rfind('.')+1:]
-self.__name__=path[path.rfind('/')+1:]
-self.lmt=float(os.stat(path)[8]) or time.time()
-self.lmh=rfc1123_date(self.lmt)
+ext = os.path.splitext(path)[-1].replace('.', '')
+self.content_type='image/%s' %  ext
 
+self.__name__ = os.path.split(path)[-1]
+stat_info = os.stat(path)
+self.size = stat_info[stat.ST_SIZE]
+self.lmt = float(stat_info[stat.ST_MTIME]) or time.time()
+self.lmh = rfc1123_date(self.lmt)
 
 def index_html(self, REQUEST, RESPONSE):
 """Default document"""
@@ -67,7 +82,8 @@
 RESPONSE.setHeader('Content-Type', self.content_type)
 RESPONSE.setHeader('Last-Modified', self.lmh)
 RESPONSE.setHeader('Cache-Control', self.cch)
-header=REQUEST.get_header('If-Modified-Since', None)
+RESPONSE.setHeader('Content-Length', str(self.size).replace('L', ''))
+header = REQUEST.get_header('If-Modified-Since', None)
 if header is not None:
 header=header.split(';')[0]
 # Some proxies seem to send invalid date strings for this
@@ -87,7 +103,7 @@
 RESPONSE.setStatus(304)
 return ''
 
-return open(self.path,'rb').read()
+return filestream_iterator(self.path, mode='rb')
 
 security.declarePublic('HEAD')
 def HEAD(self, REQUEST, RESPONSE):

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


[Zope-Checkins] SVN: Zope/trunk/ Moved two implements declarations from Five into the proper classes.

2007-10-20 Thread Hanno Schlichting
Log message for revision 80945:
  Moved two implements declarations from Five into the proper classes.
  

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  U   Zope/trunk/lib/python/OFS/ObjectManager.py
  U   Zope/trunk/lib/python/Products/Five/configure.zcml
  U   Zope/trunk/lib/python/ZPublisher/HTTPRequest.py

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===
--- Zope/trunk/doc/CHANGES.txt  2007-10-20 11:37:27 UTC (rev 80944)
+++ Zope/trunk/doc/CHANGES.txt  2007-10-20 13:43:09 UTC (rev 80945)
@@ -9,6 +9,8 @@
 
 Restructuring
 
+  - Moved two implements declarations from Five into the proper classes.
+
   - Document.sequence: replaced by zope.sequencesort
 
   - All Products folders as well as the zope and zope.app folders are

Modified: Zope/trunk/lib/python/OFS/ObjectManager.py
===
--- Zope/trunk/lib/python/OFS/ObjectManager.py  2007-10-20 11:37:27 UTC (rev 
80944)
+++ Zope/trunk/lib/python/OFS/ObjectManager.py  2007-10-20 13:43:09 UTC (rev 
80945)
@@ -55,6 +55,8 @@
 from zope.app.container.contained import ObjectAddedEvent
 from zope.app.container.contained import ObjectRemovedEvent
 from zope.app.container.contained import notifyContainerModified
+from zope.app.container.interfaces import IContainer
+from zope.interface import implements
 from OFS.event import ObjectWillBeAddedEvent
 from OFS.event import ObjectWillBeRemovedEvent
 import OFS.subscribers
@@ -140,7 +142,7 @@
 This class provides core behavior for collections of heterogeneous objects.
 """
 
-implements(IObjectManager)
+implements(IObjectManager, IContainer)
 
 security = ClassSecurityInfo()
 security.declareObjectProtected(access_contents_information)

Modified: Zope/trunk/lib/python/Products/Five/configure.zcml
===
--- Zope/trunk/lib/python/Products/Five/configure.zcml  2007-10-20 11:37:27 UTC 
(rev 80944)
+++ Zope/trunk/lib/python/Products/Five/configure.zcml  2007-10-20 13:43:09 UTC 
(rev 80945)
@@ -16,13 +16,4 @@
   
   
 
-  
-  
-
-  
-  
-
 

Modified: Zope/trunk/lib/python/ZPublisher/HTTPRequest.py
===
--- Zope/trunk/lib/python/ZPublisher/HTTPRequest.py 2007-10-20 11:37:27 UTC 
(rev 80944)
+++ Zope/trunk/lib/python/ZPublisher/HTTPRequest.py 2007-10-20 13:43:09 UTC 
(rev 80945)
@@ -27,7 +27,9 @@
 
 from zope.i18n.interfaces import IUserPreferredLanguages
 from zope.i18n.locales import locales, LoadLocaleError
+from zope.interface import implements
 from zope.publisher.base import DebugFlags
+from zope.publisher.interfaces.browser import IBrowserRequest
 
 # This may get overwritten during configuration
 default_encoding = 'iso-8859-15'
@@ -119,12 +121,15 @@
 values will be looked up in the order: environment variables,
 other variables, form data, and then cookies.
 """
+implements(IBrowserRequest)
+
 _hacked_path=None
 args=()
 _file=None
 _urls = ()
 
 retry_max_count=3
+
 def supports_retry(self):
 if self.retry_count < self.retry_max_count:
 time.sleep(random.uniform(0, 2**(self.retry_count)))

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


[Zope-Checkins] SVN: Zope/trunk/ Turned deprecation warnings for manage_afterAdd, manage_beforeDelete and manage_afterClone methods into discouraged warnings.

2007-10-22 Thread Hanno Schlichting
Log message for revision 80954:
  Turned deprecation warnings for manage_afterAdd, manage_beforeDelete and 
manage_afterClone methods into discouraged warnings.
  

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  U   Zope/trunk/lib/python/OFS/CopySupport.py
  U   Zope/trunk/lib/python/OFS/subscribers.py
  U   Zope/trunk/lib/python/Products/Five/deprecated.zcml
  U   Zope/trunk/lib/python/Products/Five/doc/event.txt
  U   Zope/trunk/lib/python/Products/Five/eventconfigure.py

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===
--- Zope/trunk/doc/CHANGES.txt  2007-10-22 21:53:37 UTC (rev 80953)
+++ Zope/trunk/doc/CHANGES.txt  2007-10-22 22:06:21 UTC (rev 80954)
@@ -9,6 +9,11 @@
 
 Restructuring
 
+  - Turned deprecation warnings for manage_afterAdd, manage_beforeDelete
+and manage_afterClone methods into discouraged warnings. These methods
+will not be removed in Zope 2.11, but stay for the foreseeable future.
+Using events is still highly encouraged.
+
   - Moved two implements declarations from Five into the proper classes.
 
   - Document.sequence: replaced by zope.sequencesort

Modified: Zope/trunk/lib/python/OFS/CopySupport.py
===
--- Zope/trunk/lib/python/OFS/CopySupport.py2007-10-22 21:53:37 UTC (rev 
80953)
+++ Zope/trunk/lib/python/OFS/CopySupport.py2007-10-22 22:06:21 UTC (rev 
80954)
@@ -272,24 +272,21 @@
 try:
 orig_container._delObject(orig_id, suppress_events=True)
 except TypeError:
-# BBB: removed in Zope 2.11
 orig_container._delObject(orig_id)
 warnings.warn(
-"%s._delObject without suppress_events is deprecated "
-"and will be removed in Zope 2.11." %
-orig_container.__class__.__name__, DeprecationWarning)
+"%s._delObject without suppress_events is discouraged."
+% orig_container.__class__.__name__,
+DeprecationWarning)
 ob = aq_base(ob)
 ob._setId(id)
 
 try:
 self._setObject(id, ob, set_owner=0, suppress_events=True)
 except TypeError:
-# BBB: removed in Zope 2.11
 self._setObject(id, ob, set_owner=0)
 warnings.warn(
-"%s._setObject without suppress_events is deprecated "
-"and will be removed in Zope 2.11." %
-self.__class__.__name__, DeprecationWarning)
+"%s._setObject without suppress_events is discouraged."
+% self.__class__.__name__, DeprecationWarning)
 ob = self._getOb(id)
 
 notify(ObjectMovedEvent(ob, orig_container, orig_id, self, id))
@@ -362,11 +359,9 @@
 try:
 self._delObject(id, suppress_events=True)
 except TypeError:
-# BBB: removed in Zope 2.11
 self._delObject(id)
 warnings.warn(
-"%s._delObject without suppress_events is deprecated "
-"and will be removed in Zope 2.11." %
+"%s._delObject without suppress_events is discouraged." %
 self.__class__.__name__, DeprecationWarning)
 ob = aq_base(ob)
 ob._setId(new_id)
@@ -376,11 +371,9 @@
 try:
 self._setObject(new_id, ob, set_owner=0, suppress_events=True)
 except TypeError:
-# BBB: removed in Zope 2.11
 self._setObject(new_id, ob, set_owner=0)
 warnings.warn(
-"%s._setObject without suppress_events is deprecated "
-"and will be removed in Zope 2.11." %
+"%s._setObject without suppress_events is discouraged." %
 self.__class__.__name__, DeprecationWarning)
 ob = self._getOb(new_id)
 

Modified: Zope/trunk/lib/python/OFS/subscribers.py
===
--- Zope/trunk/lib/python/OFS/subscribers.py2007-10-22 21:53:37 UTC (rev 
80953)
+++ Zope/trunk/lib/python/OFS/subscribers.py2007-10-22 22:06:21 UTC (rev 
80954)
@@ -68,10 +68,8 @@
 return
 class_ = ob.__class__
 warnings.warn(
-"%s.%s.%s is deprecated and will be removed in Zope 2.11, "
-"you should use event subscribers instead, and meanwhile "
-"mark the class with "
-% (class_.__module__, class_.__name__, method_name),
+"%s.%s.%s is discouraged. You should use event subscribers instead." %
+(class_.__module__, class_.__name__, method_name),
 DeprecationWarning)
 
 ##

Modified: Zope/trunk/lib/python/Products/Five/depreca

[Zope-Checkins] SVN: Zope/trunk/lib/python/ Added a warning about false implements claims to ObjectManager and HTTPRequest

2007-10-28 Thread Hanno Schlichting
Log message for revision 81164:
  Added a warning about false implements claims to ObjectManager and HTTPRequest
  

Changed:
  U   Zope/trunk/lib/python/OFS/ObjectManager.py
  U   Zope/trunk/lib/python/ZPublisher/HTTPRequest.py

-=-
Modified: Zope/trunk/lib/python/OFS/ObjectManager.py
===
--- Zope/trunk/lib/python/OFS/ObjectManager.py  2007-10-28 08:57:32 UTC (rev 
81163)
+++ Zope/trunk/lib/python/OFS/ObjectManager.py  2007-10-28 09:30:26 UTC (rev 
81164)
@@ -142,6 +142,9 @@
 This class provides core behavior for collections of heterogeneous objects.
 """
 
+# The claim to implement IContainer has been made during the Zope3
+# integration project called Five but hasn't been completed in full.
+
 implements(IObjectManager, IContainer)
 
 security = ClassSecurityInfo()

Modified: Zope/trunk/lib/python/ZPublisher/HTTPRequest.py
===
--- Zope/trunk/lib/python/ZPublisher/HTTPRequest.py 2007-10-28 08:57:32 UTC 
(rev 81163)
+++ Zope/trunk/lib/python/ZPublisher/HTTPRequest.py 2007-10-28 09:30:26 UTC 
(rev 81164)
@@ -121,6 +121,10 @@
 values will be looked up in the order: environment variables,
 other variables, form data, and then cookies.
 """
+
+# The claim to implement IBrowserRequest has been made during the Zope3
+# integration project called Five but hasn't been completed in full.
+
 implements(IBrowserRequest)
 
 _hacked_path=None

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


[Zope-Checkins] SVN: Zope/branches/2.10/ Backported discouraged warning for manage_* events from trunk

2007-10-28 Thread Hanno Schlichting
Log message for revision 81167:
  Backported discouraged warning for manage_* events from trunk
  

Changed:
  U   Zope/branches/2.10/doc/CHANGES.txt
  U   Zope/branches/2.10/lib/python/OFS/CopySupport.py
  U   Zope/branches/2.10/lib/python/OFS/subscribers.py

-=-
Modified: Zope/branches/2.10/doc/CHANGES.txt
===
--- Zope/branches/2.10/doc/CHANGES.txt  2007-10-28 09:38:41 UTC (rev 81166)
+++ Zope/branches/2.10/doc/CHANGES.txt  2007-10-28 09:40:32 UTC (rev 81167)
@@ -6,6 +6,13 @@
 
   Zope 2.10.5 (unreleased)
 
+Other changes
+
+  - Turned deprecation warnings for manage_afterAdd, manage_beforeDelete
+and manage_afterClone methods into discouraged warnings. These methods
+will not be removed in Zope 2.11, but stay for the foreseeable future.
+Using events is still highly encouraged.
+
 Bugs fixed
 
   - Launchpad #147201: treat container-class in zope.conf as a string,

Modified: Zope/branches/2.10/lib/python/OFS/CopySupport.py
===
--- Zope/branches/2.10/lib/python/OFS/CopySupport.py2007-10-28 09:38:41 UTC 
(rev 81166)
+++ Zope/branches/2.10/lib/python/OFS/CopySupport.py2007-10-28 09:40:32 UTC 
(rev 81167)
@@ -272,24 +272,21 @@
 try:
 orig_container._delObject(orig_id, suppress_events=True)
 except TypeError:
-# BBB: removed in Zope 2.11
 orig_container._delObject(orig_id)
 warnings.warn(
-"%s._delObject without suppress_events is deprecated "
-"and will be removed in Zope 2.11." %
-orig_container.__class__.__name__, DeprecationWarning)
+"%s._delObject without suppress_events is discouraged."
+% orig_container.__class__.__name__,
+DeprecationWarning)
 ob = aq_base(ob)
 ob._setId(id)
 
 try:
 self._setObject(id, ob, set_owner=0, suppress_events=True)
 except TypeError:
-# BBB: removed in Zope 2.11
 self._setObject(id, ob, set_owner=0)
 warnings.warn(
-"%s._setObject without suppress_events is deprecated "
-"and will be removed in Zope 2.11." %
-self.__class__.__name__, DeprecationWarning)
+"%s._setObject without suppress_events is discouraged."
+% self.__class__.__name__, DeprecationWarning)
 ob = self._getOb(id)
 
 notify(ObjectMovedEvent(ob, orig_container, orig_id, self, id))
@@ -362,11 +359,9 @@
 try:
 self._delObject(id, suppress_events=True)
 except TypeError:
-# BBB: removed in Zope 2.11
 self._delObject(id)
 warnings.warn(
-"%s._delObject without suppress_events is deprecated "
-"and will be removed in Zope 2.11." %
+"%s._delObject without suppress_events is discouraged." %
 self.__class__.__name__, DeprecationWarning)
 ob = aq_base(ob)
 ob._setId(new_id)
@@ -376,11 +371,9 @@
 try:
 self._setObject(new_id, ob, set_owner=0, suppress_events=True)
 except TypeError:
-# BBB: removed in Zope 2.11
 self._setObject(new_id, ob, set_owner=0)
 warnings.warn(
-"%s._setObject without suppress_events is deprecated "
-"and will be removed in Zope 2.11." %
+"%s._setObject without suppress_events is discouraged." %
 self.__class__.__name__, DeprecationWarning)
 ob = self._getOb(new_id)
 

Modified: Zope/branches/2.10/lib/python/OFS/subscribers.py
===
--- Zope/branches/2.10/lib/python/OFS/subscribers.py2007-10-28 09:38:41 UTC 
(rev 81166)
+++ Zope/branches/2.10/lib/python/OFS/subscribers.py2007-10-28 09:40:32 UTC 
(rev 81167)
@@ -68,10 +68,8 @@
 return
 class_ = ob.__class__
 warnings.warn(
-"%s.%s.%s is deprecated and will be removed in Zope 2.11, "
-"you should use event subscribers instead, and meanwhile "
-"mark the class with "
-% (class_.__module__, class_.__name__, method_name),
+"%s.%s.%s is discouraged. You should use event subscribers instead." %
+(class_.__module__, class_.__name__, method_name),
 DeprecationWarning)
 
 ##

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


[Zope-Checkins] SVN: Zope/trunk/lib/python/zope/ Use a newer version of zope.interface and zope.component

2007-11-01 Thread Hanno Schlichting
Log message for revision 81360:
  Use a newer version of zope.interface and zope.component
  

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

-=-

Property changes on: Zope/trunk/lib/python/zope
___
Name: svn:externals
   - annotation  -r 77445 
svn://svn.zope.org/repos/main/zope.annotation/trunk/src/zope/annotation
cachedescriptors-r 77445 
svn://svn.zope.org/repos/main/zope.cachedescriptors/trunk/src/zope/cachedescriptors
component   -r 77445 
svn://svn.zope.org/repos/main/zope.component/trunk/src/zope/component
configuration   -r 77445 
svn://svn.zope.org/repos/main/zope.configuration/trunk/src/zope/configuration
contentprovider -r 77445 
svn://svn.zope.org/repos/main/zope.contentprovider/trunk/src/zope/contentprovider
contenttype -r 77445 
svn://svn.zope.org/repos/main/zope.contenttype/trunk/src/zope/contenttype
copypastemove   -r 77445 
svn://svn.zope.org/repos/main/zope.copypastemove/trunk/src/zope/copypastemove
datetime-r 77445 
svn://svn.zope.org/repos/main/zope.datetime/trunk/src/zope/datetime
decorator   -r 77445 
svn://svn.zope.org/repos/main/zope.decorator/trunk/src/zope/decorator
deferredimport  -r 77445 
svn://svn.zope.org/repos/main/zope.deferredimport/trunk/src/zope/deferredimport
deprecation -r 77445 
svn://svn.zope.org/repos/main/zope.deprecation/trunk/src/zope/deprecation
documenttemplate-r 77445 
svn://svn.zope.org/repos/main/zope.documenttemplate/trunk/src/zope/documenttemplate
dottedname  -r 77445 
svn://svn.zope.org/repos/main/zope.dottedname/trunk/src/zope/dottedname
dublincore  -r 77445 
svn://svn.zope.org/repos/main/zope.dublincore/trunk/src/zope/dublincore
event   -r 77445 
svn://svn.zope.org/repos/main/zope.event/trunk/src/zope/event
exceptions  -r 77445 
svn://svn.zope.org/repos/main/zope.exceptions/trunk/src/zope/exceptions
filerepresentation  -r 77445 
svn://svn.zope.org/repos/main/zope.filerepresentation/trunk/src/zope/filerepresentation
formlib -r 77445 
svn://svn.zope.org/repos/main/zope.formlib/trunk/src/zope/formlib
hookable-r 77445 
svn://svn.zope.org/repos/main/zope.hookable/trunk/src/zope/hookable
i18nmessageid   -r 77445 
svn://svn.zope.org/repos/main/zope.i18nmessageid/trunk/src/zope/i18nmessageid
i18n-r 77445 
svn://svn.zope.org/repos/main/zope.i18n/trunk/src/zope/i18n
index   -r 77445 
svn://svn.zope.org/repos/main/zope.index/trunk/src/zope/index
interface   -r 77445 
svn://svn.zope.org/repos/main/zope.interface/trunk/src/zope/interface
lifecycleevent  -r 77445 
svn://svn.zope.org/repos/main/zope.lifecycleevent/trunk/src/zope/lifecycleevent
location-r 77445 
svn://svn.zope.org/repos/main/zope.location/trunk/src/zope/location
modulealias -r 77445 
svn://svn.zope.org/repos/main/zope.modulealias/trunk/src/zope/modulealias
pagetemplate-r 77445 
svn://svn.zope.org/repos/main/zope.pagetemplate/trunk/src/zope/pagetemplate
proxy   -r 77445 
svn://svn.zope.org/repos/main/zope.proxy/trunk/src/zope/proxy
publisher   -r 77445 
svn://svn.zope.org/repos/main/zope.publisher/trunk/src/zope/publisher
rdb -r 77445 
svn://svn.zope.org/repos/main/zope.rdb/trunk/src/zope/rdb
schema  -r 77445 
svn://svn.zope.org/repos/main/zope.schema/trunk/src/zope/schema
security-r 77445 
svn://svn.zope.org/repos/main/zope.security/trunk/src/zope/security
sequencesort-r 77445 
svn://svn.zope.org/repos/main/zope.sequencesort/trunk/src/zope/sequencesort
sendmail-r 77445 
svn://svn.zope.org/repos/main/zope.sendmail/trunk/src/zope/sendmail
server  -r 77445 
svn://svn.zope.org/repos/main/zope.server/trunk/src/zope/server
size-r 77445 
svn://svn.zope.org/repos/main/zope.size/trunk/src/zope/size
structuredtext  -r 77445 
svn://svn.zope.org/repos/main/zope.structuredtext/trunk/src/zope/structuredtext
tales   -r 77445 
svn://svn.zope.org/repos/main/zope.tales/trunk/src/zope/tales
tal -r 77445 
svn://svn.zope.org/repos/main/zope.tal/trunk/src/zope/tal
testbrowser -r 77445 
svn://svn.zope.org/repos/main/zope.testbrowser/trunk/src/zope/testbrowser
testing -r 77445 
svn://svn.zope.org/repos/main/zope.testing/trunk/src/zope/testing
thread  -r 77445 
svn://svn.zope.org/repos/main/zope.thread/trunk/src/zope/thread
traversing  -r 77445 
svn://svn.zope.org/repos/main/zope.traversing/trunk/src/zope/traversing
viewlet -r 77445 
svn://svn.zope.org/repos/main/zope.viewlet/trunk/src/zope/viewlet
wfmc-r 77445 
svn://svn.zope.org/repos/main/zope.wfmc/trunk/src/zope/wfmc

   + annotation  -r 77445 
svn://svn.zope.org/repos/main/zope.annotation/trunk/src/zope/annotation
cachedescriptors-r 77445 
svn://svn.zope.org/repos/main/zope.cachedescriptors/

[Zope-Checkins] SVN: Zope/trunk/lib/python/zope/ Use an even newer zope.interface

2007-11-01 Thread Hanno Schlichting
Log message for revision 81364:
  Use an even newer zope.interface
  

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

-=-

Property changes on: Zope/trunk/lib/python/zope
___
Name: svn:externals
   - annotation  -r 77445 
svn://svn.zope.org/repos/main/zope.annotation/trunk/src/zope/annotation
cachedescriptors-r 77445 
svn://svn.zope.org/repos/main/zope.cachedescriptors/trunk/src/zope/cachedescriptors
component   -r 81359 
svn://svn.zope.org/repos/main/zope.component/trunk/src/zope/component
configuration   -r 77445 
svn://svn.zope.org/repos/main/zope.configuration/trunk/src/zope/configuration
contentprovider -r 77445 
svn://svn.zope.org/repos/main/zope.contentprovider/trunk/src/zope/contentprovider
contenttype -r 77445 
svn://svn.zope.org/repos/main/zope.contenttype/trunk/src/zope/contenttype
copypastemove   -r 77445 
svn://svn.zope.org/repos/main/zope.copypastemove/trunk/src/zope/copypastemove
datetime-r 77445 
svn://svn.zope.org/repos/main/zope.datetime/trunk/src/zope/datetime
decorator   -r 77445 
svn://svn.zope.org/repos/main/zope.decorator/trunk/src/zope/decorator
deferredimport  -r 77445 
svn://svn.zope.org/repos/main/zope.deferredimport/trunk/src/zope/deferredimport
deprecation -r 77445 
svn://svn.zope.org/repos/main/zope.deprecation/trunk/src/zope/deprecation
documenttemplate-r 77445 
svn://svn.zope.org/repos/main/zope.documenttemplate/trunk/src/zope/documenttemplate
dottedname  -r 77445 
svn://svn.zope.org/repos/main/zope.dottedname/trunk/src/zope/dottedname
dublincore  -r 77445 
svn://svn.zope.org/repos/main/zope.dublincore/trunk/src/zope/dublincore
event   -r 77445 
svn://svn.zope.org/repos/main/zope.event/trunk/src/zope/event
exceptions  -r 77445 
svn://svn.zope.org/repos/main/zope.exceptions/trunk/src/zope/exceptions
filerepresentation  -r 77445 
svn://svn.zope.org/repos/main/zope.filerepresentation/trunk/src/zope/filerepresentation
formlib -r 77445 
svn://svn.zope.org/repos/main/zope.formlib/trunk/src/zope/formlib
hookable-r 77445 
svn://svn.zope.org/repos/main/zope.hookable/trunk/src/zope/hookable
i18nmessageid   -r 77445 
svn://svn.zope.org/repos/main/zope.i18nmessageid/trunk/src/zope/i18nmessageid
i18n-r 77445 
svn://svn.zope.org/repos/main/zope.i18n/trunk/src/zope/i18n
index   -r 77445 
svn://svn.zope.org/repos/main/zope.index/trunk/src/zope/index
interface   -r 81359 
svn://svn.zope.org/repos/main/zope.interface/trunk/src/zope/interface
lifecycleevent  -r 77445 
svn://svn.zope.org/repos/main/zope.lifecycleevent/trunk/src/zope/lifecycleevent
location-r 77445 
svn://svn.zope.org/repos/main/zope.location/trunk/src/zope/location
modulealias -r 77445 
svn://svn.zope.org/repos/main/zope.modulealias/trunk/src/zope/modulealias
pagetemplate-r 77445 
svn://svn.zope.org/repos/main/zope.pagetemplate/trunk/src/zope/pagetemplate
proxy   -r 77445 
svn://svn.zope.org/repos/main/zope.proxy/trunk/src/zope/proxy
publisher   -r 77445 
svn://svn.zope.org/repos/main/zope.publisher/trunk/src/zope/publisher
rdb -r 77445 
svn://svn.zope.org/repos/main/zope.rdb/trunk/src/zope/rdb
schema  -r 77445 
svn://svn.zope.org/repos/main/zope.schema/trunk/src/zope/schema
security-r 77445 
svn://svn.zope.org/repos/main/zope.security/trunk/src/zope/security
sequencesort-r 77445 
svn://svn.zope.org/repos/main/zope.sequencesort/trunk/src/zope/sequencesort
sendmail-r 77445 
svn://svn.zope.org/repos/main/zope.sendmail/trunk/src/zope/sendmail
server  -r 77445 
svn://svn.zope.org/repos/main/zope.server/trunk/src/zope/server
size-r 77445 
svn://svn.zope.org/repos/main/zope.size/trunk/src/zope/size
structuredtext  -r 77445 
svn://svn.zope.org/repos/main/zope.structuredtext/trunk/src/zope/structuredtext
tales   -r 77445 
svn://svn.zope.org/repos/main/zope.tales/trunk/src/zope/tales
tal -r 77445 
svn://svn.zope.org/repos/main/zope.tal/trunk/src/zope/tal
testbrowser -r 77445 
svn://svn.zope.org/repos/main/zope.testbrowser/trunk/src/zope/testbrowser
testing -r 77445 
svn://svn.zope.org/repos/main/zope.testing/trunk/src/zope/testing
thread  -r 77445 
svn://svn.zope.org/repos/main/zope.thread/trunk/src/zope/thread
traversing  -r 77445 
svn://svn.zope.org/repos/main/zope.traversing/trunk/src/zope/traversing
viewlet -r 77445 
svn://svn.zope.org/repos/main/zope.viewlet/trunk/src/zope/viewlet
wfmc-r 77445 
svn://svn.zope.org/repos/main/zope.wfmc/trunk/src/zope/wfmc


   + annotation  -r 77445 
svn://svn.zope.org/repos/main/zope.annotation/trunk/src/zope/annotation
cachedescriptors-r 77445 
svn://svn.zope.org/repos/main/zope.cachedescriptors/trunk/src/zope/cachedes

[Zope-Checkins] SVN: Zope/trunk/ Made Helpsys.HelpSys internal ZCatalog creation lazy, so it isn't created unless first accessed.

2007-11-02 Thread Hanno Schlichting
Log message for revision 81408:
  Made Helpsys.HelpSys internal ZCatalog creation lazy, so it isn't created 
unless first accessed.
  

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  U   Zope/trunk/lib/python/HelpSys/HelpSys.py

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===
--- Zope/trunk/doc/CHANGES.txt  2007-11-02 09:47:35 UTC (rev 81407)
+++ Zope/trunk/doc/CHANGES.txt  2007-11-02 11:27:15 UTC (rev 81408)
@@ -9,6 +9,9 @@
 
 Restructuring
 
+  - Made Helpsys.HelpSys internal ZCatalog creation lazy, so it isn't
+created unless first accessed.
+
   - Turned deprecation warnings for manage_afterAdd, manage_beforeDelete
 and manage_afterClone methods into discouraged warnings. These methods
 will not be removed in Zope 2.11, but stay for the foreseeable future.

Modified: Zope/trunk/lib/python/HelpSys/HelpSys.py
===
--- Zope/trunk/lib/python/HelpSys/HelpSys.py2007-11-02 09:47:35 UTC (rev 
81407)
+++ Zope/trunk/lib/python/HelpSys/HelpSys.py2007-11-02 11:27:15 UTC (rev 
81408)
@@ -219,21 +219,27 @@
 def __init__(self, id='Help', title=''):
 self.id=id
 self.title=title
-c=self.catalog=ZCatalog('catalog')
-# clear catalog
-for index in c.indexes():
-c.delIndex(index)
-for col in c.schema():
-c.delColumn(col)
-c.addIndex('SearchableText', 'TextIndex')
-c.addIndex('categories', 'KeywordIndex')
-c.addIndex('permissions', 'KeywordIndex')
-c.addColumn('categories')
-c.addColumn('permissions')
-c.addColumn('title_or_id')
-c.addColumn('url')
-c.addColumn('id')
+self._catalog = None
 
+@property
+def catalog(self):
+if self._catalog is None:
+c=self._catalog=ZCatalog('catalog')
+# clear catalog
+for index in c.indexes():
+c.delIndex(index)
+for col in c.schema():
+c.delColumn(col)
+c.addIndex('SearchableText', 'TextIndex')
+c.addIndex('categories', 'KeywordIndex')
+c.addIndex('permissions', 'KeywordIndex')
+c.addColumn('categories')
+c.addColumn('permissions')
+c.addColumn('title_or_id')
+c.addColumn('url')
+c.addColumn('id')
+return self._catalog
+
 security.declareProtected(add_documents_images_and_files, 'addTopicForm')
 addTopicForm=DTMLFile('dtml/addTopic', globals())
 

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


[Zope-Checkins] SVN: Zope/trunk/ Revert c81408 HelpSys changes, it didn't make much of a difference. Making the whole help system optional would be a better approach.

2007-11-10 Thread Hanno Schlichting
Log message for revision 81697:
  Revert c81408 HelpSys changes, it didn't make much of a difference. Making 
the whole help system optional would be a better approach.
  

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  U   Zope/trunk/lib/python/HelpSys/HelpSys.py

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===
--- Zope/trunk/doc/CHANGES.txt  2007-11-10 11:28:15 UTC (rev 81696)
+++ Zope/trunk/doc/CHANGES.txt  2007-11-10 11:38:21 UTC (rev 81697)
@@ -9,9 +9,6 @@
 
 Restructuring
 
-  - Made Helpsys.HelpSys internal ZCatalog creation lazy, so it isn't
-created unless first accessed.
-
   - Turned deprecation warnings for manage_afterAdd, manage_beforeDelete
 and manage_afterClone methods into discouraged warnings. These methods
 will not be removed in Zope 2.11, but stay for the foreseeable future.

Modified: Zope/trunk/lib/python/HelpSys/HelpSys.py
===
--- Zope/trunk/lib/python/HelpSys/HelpSys.py2007-11-10 11:28:15 UTC (rev 
81696)
+++ Zope/trunk/lib/python/HelpSys/HelpSys.py2007-11-10 11:38:21 UTC (rev 
81697)
@@ -219,27 +219,21 @@
 def __init__(self, id='Help', title=''):
 self.id=id
 self.title=title
-self._catalog = None
+c=self.catalog=ZCatalog('catalog')
+# clear catalog
+for index in c.indexes():
+c.delIndex(index)
+for col in c.schema():
+c.delColumn(col)
+c.addIndex('SearchableText', 'TextIndex')
+c.addIndex('categories', 'KeywordIndex')
+c.addIndex('permissions', 'KeywordIndex')
+c.addColumn('categories')
+c.addColumn('permissions')
+c.addColumn('title_or_id')
+c.addColumn('url')
+c.addColumn('id')
 
-@property
-def catalog(self):
-if self._catalog is None:
-c=self._catalog=ZCatalog('catalog')
-# clear catalog
-for index in c.indexes():
-c.delIndex(index)
-for col in c.schema():
-c.delColumn(col)
-c.addIndex('SearchableText', 'TextIndex')
-c.addIndex('categories', 'KeywordIndex')
-c.addIndex('permissions', 'KeywordIndex')
-c.addColumn('categories')
-c.addColumn('permissions')
-c.addColumn('title_or_id')
-c.addColumn('url')
-c.addColumn('id')
-return self._catalog
-
 security.declareProtected(add_documents_images_and_files, 'addTopicForm')
 addTopicForm=DTMLFile('dtml/addTopic', globals())
 

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


[Zope-Checkins] SVN: Zope/trunk/ Launchpad #164783: Indexes were migrated on initial creation of a ZODB.

2007-11-24 Thread Hanno Schlichting
Log message for revision 81975:
  Launchpad #164783: Indexes were migrated on initial creation of a ZODB.
  

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  U   Zope/trunk/lib/python/Products/ZCatalog/ZCatalog.py

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===
--- Zope/trunk/doc/CHANGES.txt  2007-11-23 18:44:13 UTC (rev 81974)
+++ Zope/trunk/doc/CHANGES.txt  2007-11-24 13:25:49 UTC (rev 81975)
@@ -182,6 +182,9 @@
 
 Bugs Fixed
 
+  - Launchpad #164783: Indexes were migrated on initial creation of a
+ZODB.
+
   - Launchpad #151020: HTTP_CHAR_SET headers containing 'x-user-defined'
 caused a LookupError exception. Unknown encodings are from now on
 silently discarded.

Modified: Zope/trunk/lib/python/Products/ZCatalog/ZCatalog.py
===
--- Zope/trunk/lib/python/Products/ZCatalog/ZCatalog.py 2007-11-23 18:44:13 UTC 
(rev 81974)
+++ Zope/trunk/lib/python/Products/ZCatalog/ZCatalog.py 2007-11-24 13:25:49 UTC 
(rev 81975)
@@ -177,6 +177,7 @@
 self._v_total = 0
 
 self._catalog = Catalog()
+self._migrated_280 = True
 
 def __len__(self):
 # Perform a migration of _catalog.__len__ to _catalog._length

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


[Zope-Checkins] SVN: Zope/branches/2.10/ Backported c81975 from trunk

2007-11-24 Thread Hanno Schlichting
Log message for revision 81976:
  Backported c81975 from trunk
  

Changed:
  U   Zope/branches/2.10/doc/CHANGES.txt
  U   Zope/branches/2.10/lib/python/Products/ZCatalog/ZCatalog.py

-=-
Modified: Zope/branches/2.10/doc/CHANGES.txt
===
--- Zope/branches/2.10/doc/CHANGES.txt  2007-11-24 13:25:49 UTC (rev 81975)
+++ Zope/branches/2.10/doc/CHANGES.txt  2007-11-24 13:33:19 UTC (rev 81976)
@@ -4,6 +4,13 @@
   Change information for previous versions of Zope can be found in the
   file HISTORY.txt.
 
+  Zope 2.10.6 (Unreleased)
+
+Bugs fixed
+
+  - Launchpad #164783: Indexes were migrated on initial creation of a
+ZODB.
+
   Zope 2.10.5 (2007/10/30)
 
 Other changes

Modified: Zope/branches/2.10/lib/python/Products/ZCatalog/ZCatalog.py
===
--- Zope/branches/2.10/lib/python/Products/ZCatalog/ZCatalog.py 2007-11-24 
13:25:49 UTC (rev 81975)
+++ Zope/branches/2.10/lib/python/Products/ZCatalog/ZCatalog.py 2007-11-24 
13:33:19 UTC (rev 81976)
@@ -177,6 +177,7 @@
 self._v_total = 0
 
 self._catalog = Catalog()
+self._migrated_280 = True
 
 def __len__(self):
 # Perform a migration of _catalog.__len__ to _catalog._length

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


[Zope-Checkins] SVN: Zope/trunk/ Support for using zopectl on Windows has been added. All commands are supported and there are two Windows specific ones: install and remove, which install or remove th

2008-03-09 Thread Hanno Schlichting
Log message for revision 75066:
  Support for using zopectl on Windows has been added. All commands are 
supported and there are two Windows specific ones: install and remove, which 
install or remove the Windows service. The start, stop and restart commands 
handle the Windows service.
  

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  U   Zope/trunk/lib/python/Zope2/Startup/zopectl.py
  A   Zope/trunk/skel/bin/zopectl.bat.in

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===
--- Zope/trunk/doc/CHANGES.txt  2007-05-03 18:27:55 UTC (rev 75065)
+++ Zope/trunk/doc/CHANGES.txt  2007-05-03 18:35:20 UTC (rev 75066)
@@ -51,6 +51,12 @@
 
 Features added
 
+  - Support for using zopectl on Windows has been added. All commands are
+supported and there are two Windows specific ones: install and remove,
+which install or remove the Windows service. The start, stop and
+restart commands handle the Windows service. In order to use them, you
+need to call 'bin\zopectl install' once.
+
   - ZCatalog result objects (catalog brains) now have an interface,
 ZCatalog.interfaces.ICatalogBrain.
 

Modified: Zope/trunk/lib/python/Zope2/Startup/zopectl.py
===
--- Zope/trunk/lib/python/Zope2/Startup/zopectl.py  2007-05-03 18:27:55 UTC 
(rev 75065)
+++ Zope/trunk/lib/python/Zope2/Startup/zopectl.py  2007-05-03 18:35:20 UTC 
(rev 75066)
@@ -48,6 +48,9 @@
 from ZConfig.components.logger.handlers import FileHandlerFactory
 from ZConfig.datatypes import existing_dirpath
 
+WIN = False
+if sys.platform[:3].lower() == "win":
+WIN = True
 
 def string_list(arg):
 return arg.split()
@@ -127,6 +130,12 @@
 self.python = sys.executable
 self.zdrun = os.path.join(os.path.dirname(zdaemon.__file__),
   "zdrun.py")
+if WIN:
+# Add the path to the zopeservice.py script, which is needed for
+# some of the Windows specific commands
+servicescript = os.path.join(self.directory, 'bin', 
'zopeservice.py')
+self.servicescript = '"%s" %s' % (self.python, servicescript)
+
 self.exitcodes = [0, 2]
 if self.logfile is None and config.eventlog is not None:
 for handler in config.eventlog.handler_factories:
@@ -158,11 +167,59 @@
 args = [opt, svalue]
 return args
 
+if WIN:
+def get_status(self):
+# get_status from zdaemon relies on *nix specific socket handling.
+# We just don't support getting the status and sending actions to
+# the control server on Windows. This could be extended to ask for
+# the status of the Windows service though
+self.zd_up = 0
+self.zd_pid = 0
+self.zd_status = None
+return
+
+def do_stop(self, arg):
+# Stop the Windows service
+program = "%s stop" % self.options.servicescript
+print program
+os.system(program)
+
+def do_restart(self, arg):
+# Restart the Windows service
+program = "%s restart" % self.options.servicescript
+print program
+os.system(program)
+
+# Add extra commands to install and remove the Windows service
+
+def do_install(self, arg):
+program = "%s install" % self.options.servicescript
+print program
+os.system(program)
+
+def help_install(self):
+print "install -- Installs Zope as a Windows service."
+
+def do_remove(self, arg):
+program = "%s remove" % self.options.servicescript
+print program
+os.system(program)
+
+def help_remove(self):
+print "remove -- Removes the Zope Windows service."
+
 def do_start(self, arg):
 # signal to Zope that it is being managed
-#(to indicate it's web-restartable)
+# (to indicate it's web-restartable)
 os.putenv('ZMANAGED', '1')
-ZDCmd.do_start(self, arg)
+if WIN:
+# On Windows start the service, this fails with a reasonable
+# error message as long as the service is not installed
+program = "%s start" % self.options.servicescript
+print program
+os.system(program)
+else:
+ZDCmd.do_start(self, arg)
 
 def get_startup_cmd(self, python, more):
 cmdline = ( '%s -c "from Zope2 import configure;'
@@ -179,12 +236,17 @@
 os.system(cmdline)
 
 def do_foreground(self, arg):
-self.options.program[1:1] = ["-X", "debug-mode=on"]
-try:
+if WIN:
+# Adding arguments to the program is not supported on Windows
+# and the runzope script doesn't put you in debug-mode either
 ZDCmd.do_foreground(self, ar

Re: [Zope-Checkins] Re: SVN: Zope/trunk/ Added LAZY_FILE_LOADING constant to PageTemplateFile. When set to True Page Template files aren't lo

2008-03-09 Thread Hanno Schlichting


Martijn Faassen wrote:
> Hey,
> 
> The modification was made to the Zope 2 part of ZPT. It'd be nice if
> this change could be made in the Zope 3 libraries? I guess this was
> investigated but found impractical?

Sorry, I committed this early on in the process, as I wanted to write a
new blog post (http://hannosch.blogspot.com) and get this exciting news
out to the world :)

zope.conf option and changing the zope pagetemplates file in the same
way are on my todo list.

Sidnei also pointed me to https://bugs.launchpad.net/zope2/+bug/143902
which is a similar problem regarding OFS images.

Hanno

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


[Zope-Checkins] SVN: zdaemon/trunk/ Fixed backwards incompatible change in handling of environment option. Using the environment option in Zope 2.11 was broken, as environment is a dict and not an obj

2008-03-29 Thread Hanno Schlichting
Log message for revision 85012:
  Fixed backwards incompatible change in handling of environment option. Using 
the environment option in Zope 2.11 was broken, as environment is a dict and 
not an object with a mapping attribute.
  

Changed:
  U   zdaemon/trunk/CHANGES.txt
  U   zdaemon/trunk/setup.py
  U   zdaemon/trunk/src/zdaemon/zdctl.py

-=-
Modified: zdaemon/trunk/CHANGES.txt
===
--- zdaemon/trunk/CHANGES.txt   2008-03-29 11:33:23 UTC (rev 85011)
+++ zdaemon/trunk/CHANGES.txt   2008-03-29 18:43:54 UTC (rev 85012)
@@ -1,6 +1,14 @@
 zdaemon Changelog
 *
 
+zdaemon 2.0.2 (unreleased)
+==
+
+Bugs Fixed
+--
+
+Fixed backwards incompatible change in handling of environment option.
+
 zdaemon 2.0.1 (2007/10/31)
 ==
 

Modified: zdaemon/trunk/setup.py
===
--- zdaemon/trunk/setup.py  2008-03-29 11:33:23 UTC (rev 85011)
+++ zdaemon/trunk/setup.py  2008-03-29 18:43:54 UTC (rev 85012)
@@ -37,7 +37,7 @@
 name = "zdaemon"
 setup(
 name=name,
-version="2.1.0",
+version="2.0.2",
 url="http://www.python.org/pypi/zdaemon";,
 license="ZPL 2.1",
 description=

Modified: zdaemon/trunk/src/zdaemon/zdctl.py
===
--- zdaemon/trunk/src/zdaemon/zdctl.py  2008-03-29 11:33:23 UTC (rev 85011)
+++ zdaemon/trunk/src/zdaemon/zdctl.py  2008-03-29 18:43:54 UTC (rev 85012)
@@ -134,12 +134,15 @@
 print "our program   =", program
 print "daemon's args =", args
 
-if (options.configroot is not None
-and
-getattr(options.configroot, 'environment', None) is not None
-):
-for k, v in options.configroot.environment.mapping.items():
-os.environ[k] = v
+if options.configroot is not None:
+env = getattr(options.configroot, 'environment', None)
+if env is not None:
+if getattr(env, 'mapping', None) is not None:
+for k, v in env.mapping.items():
+os.environ[k] = v
+elif type(env) is type({}):
+for k, v in env.items():
+os.environ[k] = v
 
 self.set_uid()
 

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


[Zope-Checkins] SVN: Zope/branches/2.11/lib/python/ Use newer zdaemon version. This fixes the handling of the environment option in zope.conf.

2008-03-29 Thread Hanno Schlichting
Log message for revision 85013:
  Use newer zdaemon version. This fixes the handling of the environment option 
in zope.conf.
  

Changed:
  _U  Zope/branches/2.11/lib/python/

-=-

Property changes on: Zope/branches/2.11/lib/python
___
Name: svn:externals
   - BTrees   
svn://svn.zope.org/repos/main/ZODB/tags/3.8.0c1/src/BTrees
ClientForm svn://svn.zope.org/repos/main/Zope3/trunk/src/ClientForm
RestrictedPython 
svn://svn.zope.org/repos/main/RestrictedPython/tags/3.4.2/src/RestrictedPython
ThreadedAsync
svn://svn.zope.org/repos/main/ZODB/tags/3.8.0c1/src/ThreadedAsync
ZConfigsvn://svn.zope.org/repos/main/ZConfig/tags/2.5.1/ZConfig
ZEO  svn://svn.zope.org/repos/main/ZODB/tags/3.8.0c1/src/ZEO
ZODB svn://svn.zope.org/repos/main/ZODB/tags/3.8.0c1/src/ZODB
ZopeUndo 
svn://svn.zope.org/repos/main/ZODB/tags/3.8.0c1/src/ZopeUndo
docutils svn://svn.zope.org/repos/main/docutils/tags/0.4.0
mechanize  svn://svn.zope.org/repos/main/Zope3/trunk/src/mechanize
persistent   
svn://svn.zope.org/repos/main/ZODB/tags/3.8.0c1/src/persistent
pytz   svn://svn.zope.org/repos/main/Zope3/trunk/src/pytz
transaction  
svn://svn.zope.org/repos/main/ZODB/tags/3.8.0c1/src/transaction
zdaemon  
svn://svn.zope.org/repos/main/zdaemon/tags/2.0.1/src/zdaemon
zodbcode 
svn://svn.zope.org/repos/main/zodbcode/tags/3.4.0/src/zodbcode

   + BTrees   
svn://svn.zope.org/repos/main/ZODB/tags/3.8.0c1/src/BTrees
ClientForm svn://svn.zope.org/repos/main/Zope3/trunk/src/ClientForm
RestrictedPython 
svn://svn.zope.org/repos/main/RestrictedPython/tags/3.4.2/src/RestrictedPython
ThreadedAsync
svn://svn.zope.org/repos/main/ZODB/tags/3.8.0c1/src/ThreadedAsync
ZConfigsvn://svn.zope.org/repos/main/ZConfig/tags/2.5.1/ZConfig
ZEO  svn://svn.zope.org/repos/main/ZODB/tags/3.8.0c1/src/ZEO
ZODB svn://svn.zope.org/repos/main/ZODB/tags/3.8.0c1/src/ZODB
ZopeUndo 
svn://svn.zope.org/repos/main/ZODB/tags/3.8.0c1/src/ZopeUndo
docutils svn://svn.zope.org/repos/main/docutils/tags/0.4.0
mechanize  svn://svn.zope.org/repos/main/Zope3/trunk/src/mechanize
persistent   
svn://svn.zope.org/repos/main/ZODB/tags/3.8.0c1/src/persistent
pytz   svn://svn.zope.org/repos/main/Zope3/trunk/src/pytz
transaction  
svn://svn.zope.org/repos/main/ZODB/tags/3.8.0c1/src/transaction
zdaemon  -r85012 
svn://svn.zope.org/repos/main/zdaemon/trunk/src/zdaemon
zodbcode 
svn://svn.zope.org/repos/main/zodbcode/tags/3.4.0/src/zodbcode



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


[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy_ftest.txt Added a test for the first of three problems found in real life applications with the ViewPage

2008-04-15 Thread Hanno Schlichting
Log message for revision 85385:
  Added a test for the first of three problems found in real life applications 
with the ViewPageTemplateFile

Changed:
  U   
Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy_ftest.txt

-=-
Modified: 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy_ftest.txt
===
--- 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy_ftest.txt
 2008-04-15 15:15:28 UTC (rev 85384)
+++ 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy_ftest.txt
 2008-04-15 20:23:28 UTC (rev 85385)
@@ -163,6 +163,27 @@
   The falcon has taken flight
 
 
+Testing keyword arguments
+=
+
+ViewPageTemplateFile's take arbitrary keyword arguments:
+
+  >>> view = getMultiAdapter((self.folder, request), name='template')
+  >>> template = view.template
+  >>> print template(foo=1, bar=2)
+  The falcon has taken flight
+
+  XXX This fails currently with an error:
+  TypeError: __call__() got multiple values for keyword argument 'instance'
+
+  KSS is one example which passes in a keyword argument called 'instance' and
+  the Five ViewPageTemplateFile supported it. In the zope.app.pagetemplate
+  version, the first required argument is called instance.
+
+  >>> print template(instance='allowed')
+  The falcon has taken flight
+
+
 Clean up
 
 

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


[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy_ftest.txt Second of three tests. Calling ViewPageTemplateFile's without any arguments worked so far. The

2008-04-15 Thread Hanno Schlichting
Log message for revision 85386:
  Second of three tests. Calling ViewPageTemplateFile's without any arguments 
worked so far. The version in zope.app.pagetemplate always requires one to pass 
in the view as an argument. Examples in the wild are found in 
plone.app.portlets.

Changed:
  U   
Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy_ftest.txt

-=-
Modified: 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy_ftest.txt
===
--- 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy_ftest.txt
 2008-04-15 20:23:28 UTC (rev 85385)
+++ 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy_ftest.txt
 2008-04-15 20:38:59 UTC (rev 85386)
@@ -173,17 +173,34 @@
   >>> print template(foo=1, bar=2)
   The falcon has taken flight
 
-  XXX This fails currently with an error:
-  TypeError: __call__() got multiple values for keyword argument 'instance'
+XXX This fails currently with an error:
+TypeError: __call__() got multiple values for keyword argument 'instance'
 
-  KSS is one example which passes in a keyword argument called 'instance' and
-  the Five ViewPageTemplateFile supported it. In the zope.app.pagetemplate
-  version, the first required argument is called instance.
+KSS is one example which passes in a keyword argument called 'instance' and
+the Five ViewPageTemplateFile supported it. In the zope.app.pagetemplate
+version, the first required argument is called instance.
 
   >>> print template(instance='allowed')
   The falcon has taken flight
 
 
+No arguments required
+=
+
+ViewPageTemplateFile's requires no arguments.
+
+XXX This currently fails with:
+TypeError: __call__() takes at least 2 arguments (1 given)
+
+We do call the template class in our own view code, without passing in 'self'
+as an argument. This worked so far, as the Five version didn't require any
+arguments:
+
+  >>> view = getMultiAdapter((self.folder, request), name='template_two')
+  >>> print view()
+  The falcon has taken flight
+
+
 Clean up
 
 

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


[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py Added a simple fix for the conflicting 'instance' keyword argument test failure.

2008-04-15 Thread Hanno Schlichting
Log message for revision 85387:
  Added a simple fix for the conflicting 'instance' keyword argument test 
failure.

Changed:
  U   
Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py

-=-
Modified: 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py
===
--- 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py  
2008-04-15 20:38:59 UTC (rev 85386)
+++ 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py  
2008-04-15 21:17:07 UTC (rev 85387)
@@ -36,6 +36,22 @@
 
 id = property(getId)
 
+def __call__(self, __instance, *args, **keywords):
+instance = __instance
+namespace = self.pt_getContext(
+request=instance.request,
+instance=instance, args=args, options=keywords)
+debug_flags = instance.request.debug
+s = self.pt_render(
+namespace,
+showtal=getattr(debug_flags, 'showTAL', 0),
+sourceAnnotations=getattr(debug_flags, 'sourceAnnotations', 0),
+)
+response = instance.request.response
+if not response.getHeader("Content-Type"):
+response.setHeader("Content-Type", self.content_type)
+return s
+
 def pt_getEngine(self):
 return getEngine()
 

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


[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy. Forgot to commit more test setup code

2008-04-15 Thread Hanno Schlichting
Log message for revision 85388:
  Forgot to commit more test setup code
  

Changed:
  U   
Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy.py
  U   
Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy.zcml

-=-
Modified: 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy.py
===
--- 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy.py
2008-04-15 21:17:07 UTC (rev 85387)
+++ 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy.py
2008-04-15 21:21:08 UTC (rev 85388)
@@ -49,6 +49,19 @@
 def __call__(self):
 return self.template()
 
+class LegacyTemplateTwo(BrowserView):
+
+template = ViewPageTemplateFile('falcon.pt')
+
+def __init__(self, context, request):
+self.__parent__ = context
+self.context = context
+self.request = request
+self.template = ViewPageTemplateFile('falcon.pt')
+
+def __call__(self):
+return self.template()
+
 class Explicit(Acquisition.Explicit):
 
 def render(self):

Modified: 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy.zcml
===
--- 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy.zcml  
2008-04-15 21:17:07 UTC (rev 85387)
+++ 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy.zcml  
2008-04-15 21:21:08 UTC (rev 85388)
@@ -24,6 +24,13 @@
 
   
+
+  http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy_ftest.txt Adjusted the test, now that we fixed the most trivial error

2008-04-15 Thread Hanno Schlichting
Log message for revision 85389:
  Adjusted the test, now that we fixed the most trivial error
  

Changed:
  U   
Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy_ftest.txt

-=-
Modified: 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy_ftest.txt
===
--- 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy_ftest.txt
 2008-04-15 21:21:08 UTC (rev 85388)
+++ 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy_ftest.txt
 2008-04-15 21:21:41 UTC (rev 85389)
@@ -173,12 +173,11 @@
   >>> print template(foo=1, bar=2)
   The falcon has taken flight
 
-XXX This fails currently with an error:
-TypeError: __call__() got multiple values for keyword argument 'instance'
+Passing in an argument called instance was supported by the old Five version
+of ViewPageTemplateFile, so we still need to support it.
 
-KSS is one example which passes in a keyword argument called 'instance' and
-the Five ViewPageTemplateFile supported it. In the zope.app.pagetemplate
-version, the first required argument is called instance.
+In the zope.app.pagetemplate version, the first required argument is called
+instance, though.
 
   >>> print template(instance='allowed')
   The falcon has taken flight

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


[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy.py Clarify test. We have an instance var called template here.

2008-04-15 Thread Hanno Schlichting
Log message for revision 85390:
  Clarify test. We have an instance var called template here.

Changed:
  U   
Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy.py

-=-
Modified: 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy.py
===
--- 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy.py
2008-04-15 21:21:41 UTC (rev 85389)
+++ 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy.py
2008-04-15 21:26:35 UTC (rev 85390)
@@ -51,8 +51,6 @@
 
 class LegacyTemplateTwo(BrowserView):
 
-template = ViewPageTemplateFile('falcon.pt')
-
 def __init__(self, context, request):
 self.__parent__ = context
 self.context = context

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


[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy_ftest.txt Corrected test with expected output

2008-04-17 Thread Hanno Schlichting
Log message for revision 85454:
  Corrected test with expected output
  

Changed:
  U   
Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy_ftest.txt

-=-
Modified: 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy_ftest.txt
===
--- 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy_ftest.txt
 2008-04-17 08:41:12 UTC (rev 85453)
+++ 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/tests/aqlegacy_ftest.txt
 2008-04-17 09:55:48 UTC (rev 85454)
@@ -186,18 +186,15 @@
 No arguments required
 =
 
-ViewPageTemplateFile's requires no arguments.
+ViewPageTemplateFile's require no arguments, but you can only use them as
+class variables:
 
-XXX This currently fails with:
-TypeError: __call__() takes at least 2 arguments (1 given)
-
-We do call the template class in our own view code, without passing in 'self'
-as an argument. This worked so far, as the Five version didn't require any
-arguments:
-
   >>> view = getMultiAdapter((self.folder, request), name='template_two')
   >>> print view()
-  The falcon has taken flight
+  Traceback (most recent call last):
+  ...
+  TypeError: __call__() takes at least 2 arguments (1 given)
+  
 
 
 Clean up

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


[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py Whops, I removed the first comment line.

2008-04-17 Thread Hanno Schlichting
Log message for revision 85456:
  Whops, I removed the first comment line.

Changed:
  U   
Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py

-=-
Modified: 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py
===
--- 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py  
2008-04-17 10:31:06 UTC (rev 85455)
+++ 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py  
2008-04-17 10:36:23 UTC (rev 85456)
@@ -1,3 +1,4 @@
+##
 #
 # Copyright (c) 2004, 2005 Zope Corporation and Contributors.
 # All Rights Reserved.

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


[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py Added a docstring, noting the class variable restriction.

2008-04-17 Thread Hanno Schlichting
Log message for revision 85455:
  Added a docstring, noting the class variable restriction.

Changed:
  U   
Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py

-=-
Modified: 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py
===
--- 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py  
2008-04-17 09:55:48 UTC (rev 85454)
+++ 
Zope/branches/philikon-aq/lib/python/Products/Five/browser/pagetemplatefile.py  
2008-04-17 10:31:06 UTC (rev 85455)
@@ -1,4 +1,3 @@
-##
 #
 # Copyright (c) 2004, 2005 Zope Corporation and Contributors.
 # All Rights Reserved.
@@ -30,6 +29,8 @@
 return _engine
 
 class ViewPageTemplateFile(viewpagetemplatefile.ViewPageTemplateFile):
+"""Page Template used as class variable of views defined as Python classes.
+"""
 
 def getId(self):
 return basename(self.filename)

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


[Zope-Checkins] SVN: Zope/trunk/lib/python/zope/app/EXTERNALS.txt Removed externals file, which wasn't updated anymore in a long time

2008-04-17 Thread Hanno Schlichting
Log message for revision 85459:
  Removed externals file, which wasn't updated anymore in a long time
  

Changed:
  D   Zope/trunk/lib/python/zope/app/EXTERNALS.txt

-=-
Deleted: Zope/trunk/lib/python/zope/app/EXTERNALS.txt
===
--- Zope/trunk/lib/python/zope/app/EXTERNALS.txt2008-04-17 14:26:08 UTC 
(rev 85458)
+++ Zope/trunk/lib/python/zope/app/EXTERNALS.txt2008-04-17 18:15:56 UTC 
(rev 85459)
@@ -1,68 +0,0 @@
-annotation  
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/annotation
-apidoc  
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/apidoc
-applicationcontrol  
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/applicationcontrol
-appsetup
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/appsetup
-authentication  
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/authentication
-basicskin   
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/basicskin
-broken  
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/broken
-cache   
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/cache
-component   
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/component
-container   
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/container
-content 
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/content
-content_types   
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/content_types
-copypastemove   
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/copypastemove
-datetimeutils   
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/datetimeutils
-debug   
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/debug
-decorator   
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/decorator
-dependable  
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/dependable
-dtmlpage
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/dtmlpage
-dublincore  
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/dublincore
-error   
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/error
-event   
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/event
-exception   
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/exception
-file
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/file
-filerepresentation  
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/filerepresentation
-folder  
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/folder
-form
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/form
-ftests  
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/ftests
-generations 
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/generations
-http
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/http
-i18n
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/i18n
-interface   
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/interface
-intid   
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/intid
-introspector
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/introspector
-keyreference
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/keyreference
-layers  
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/layers
-locales 
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/locales
-location
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/location
-mail
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/mail
-onlinehelp  
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/onlinehelp
-pagetemplate
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/pagetemplate
-preference  
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/preference
-preview 
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/preview
-principalannotation 
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/principalannotation
-publication 
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/publication
-publisher   
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/publisher
-rdb 
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/rdb
-renderer
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/renderer
-rotterdam   
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/rotterdam
-sch

[Zope-Checkins] SVN: Zope/branches/philikon-aq/lib/python/zope/app/EXTERNALS.txt Removed outdated externals from the branch

2008-04-17 Thread Hanno Schlichting
Log message for revision 85460:
  Removed outdated externals from the branch
  

Changed:
  D   Zope/branches/philikon-aq/lib/python/zope/app/EXTERNALS.txt

-=-
Deleted: Zope/branches/philikon-aq/lib/python/zope/app/EXTERNALS.txt
===
--- Zope/branches/philikon-aq/lib/python/zope/app/EXTERNALS.txt 2008-04-17 
18:15:56 UTC (rev 85459)
+++ Zope/branches/philikon-aq/lib/python/zope/app/EXTERNALS.txt 2008-04-17 
18:16:43 UTC (rev 85460)
@@ -1,68 +0,0 @@
-annotation  
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/annotation
-apidoc  
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/apidoc
-applicationcontrol  
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/applicationcontrol
-appsetup
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/appsetup
-authentication  
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/authentication
-basicskin   
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/basicskin
-broken  
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/broken
-cache   
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/cache
-component   
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/component
-container   
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/container
-content 
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/content
-content_types   
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/content_types
-copypastemove   
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/copypastemove
-datetimeutils   
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/datetimeutils
-debug   
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/debug
-decorator   
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/decorator
-dependable  
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/dependable
-dtmlpage
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/dtmlpage
-dublincore  
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/dublincore
-error   
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/error
-event   
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/event
-exception   
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/exception
-file
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/file
-filerepresentation  
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/filerepresentation
-folder  
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/folder
-form
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/form
-ftests  
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/ftests
-generations 
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/generations
-http
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/http
-i18n
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/i18n
-interface   
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/interface
-intid   
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/intid
-introspector
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/introspector
-keyreference
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/keyreference
-layers  
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/layers
-locales 
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/locales
-location
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/location
-mail
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/mail
-onlinehelp  
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/onlinehelp
-pagetemplate
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/pagetemplate
-preference  
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/preference
-preview 
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/preview
-principalannotation 
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/principalannotation
-publication 
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/publication
-publisher   
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/publisher
-rdb 
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/rdb
-renderer
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zope/app/renderer
-rotterdam   
svn://svn.zope.org/repos/main/Zope3/branches/3.3/src/zo

[Zope-Checkins] SVN: Zope/branches/philikon-aq/ Update branch to use the exact same Zope 3 version as the trunk

2008-04-17 Thread Hanno Schlichting
Log message for revision 85463:
  Update branch to use the exact same Zope 3 version as the trunk
  

Changed:
  _U  Zope/branches/philikon-aq/lib/python/zope/
  _U  Zope/branches/philikon-aq/lib/python/zope/app/
  U   Zope/branches/philikon-aq/setup.py

-=-

Property changes on: Zope/branches/philikon-aq/lib/python/zope
___
Name: svn:externals
   - annotation  -r 77445 
svn://svn.zope.org/repos/main/zope.annotation/trunk/src/zope/annotation
cachedescriptors-r 77445 
svn://svn.zope.org/repos/main/zope.cachedescriptors/trunk/src/zope/cachedescriptors
component   -r 77445 
svn://svn.zope.org/repos/main/zope.component/trunk/src/zope/component
configuration   -r 77445 
svn://svn.zope.org/repos/main/zope.configuration/trunk/src/zope/configuration
contentprovider -r 77445 
svn://svn.zope.org/repos/main/zope.contentprovider/trunk/src/zope/contentprovider
contenttype -r 77445 
svn://svn.zope.org/repos/main/zope.contenttype/trunk/src/zope/contenttype
copypastemove   -r 77445 
svn://svn.zope.org/repos/main/zope.copypastemove/trunk/src/zope/copypastemove
datetime-r 77445 
svn://svn.zope.org/repos/main/zope.datetime/trunk/src/zope/datetime
decorator   -r 77445 
svn://svn.zope.org/repos/main/zope.decorator/trunk/src/zope/decorator
deferredimport  -r 77445 
svn://svn.zope.org/repos/main/zope.deferredimport/trunk/src/zope/deferredimport
deprecation -r 77445 
svn://svn.zope.org/repos/main/zope.deprecation/trunk/src/zope/deprecation
documenttemplate-r 77445 
svn://svn.zope.org/repos/main/zope.documenttemplate/trunk/src/zope/documenttemplate
dottedname  -r 77445 
svn://svn.zope.org/repos/main/zope.dottedname/trunk/src/zope/dottedname
dublincore  -r 77445 
svn://svn.zope.org/repos/main/zope.dublincore/trunk/src/zope/dublincore
event   -r 77445 
svn://svn.zope.org/repos/main/zope.event/trunk/src/zope/event
exceptions  -r 77445 
svn://svn.zope.org/repos/main/zope.exceptions/trunk/src/zope/exceptions
filerepresentation  -r 77445 
svn://svn.zope.org/repos/main/zope.filerepresentation/trunk/src/zope/filerepresentation
formlib -r 77445 
svn://svn.zope.org/repos/main/zope.formlib/trunk/src/zope/formlib
#fssync  -r 77445 
svn://svn.zope.org/repos/main/zope.fssync/trunk/src/zope/fssync
hookable-r 77445 
svn://svn.zope.org/repos/main/zope.hookable/trunk/src/zope/hookable
i18nmessageid   -r 77445 
svn://svn.zope.org/repos/main/zope.i18nmessageid/trunk/src/zope/i18nmessageid
i18n-r 77445 
svn://svn.zope.org/repos/main/zope.i18n/trunk/src/zope/i18n
index   -r 77445 
svn://svn.zope.org/repos/main/zope.index/trunk/src/zope/index
interface   -r 77445 
svn://svn.zope.org/repos/main/zope.interface/trunk/src/zope/interface
lifecycleevent  -r 77445 
svn://svn.zope.org/repos/main/zope.lifecycleevent/trunk/src/zope/lifecycleevent
location-r 77445 
svn://svn.zope.org/repos/main/zope.location/trunk/src/zope/location
modulealias -r 77445 
svn://svn.zope.org/repos/main/zope.modulealias/trunk/src/zope/modulealias
pagetemplate-r 77445 
svn://svn.zope.org/repos/main/zope.pagetemplate/trunk/src/zope/pagetemplate
proxy   -r 77445 
svn://svn.zope.org/repos/main/zope.proxy/trunk/src/zope/proxy
publisher   -r 77445 
svn://svn.zope.org/repos/main/zope.publisher/trunk/src/zope/publisher
rdb -r 77445 
svn://svn.zope.org/repos/main/zope.rdb/trunk/src/zope/rdb
schema  -r 77445 
svn://svn.zope.org/repos/main/zope.schema/trunk/src/zope/schema
security-r 77445 
svn://svn.zope.org/repos/main/zope.security/trunk/src/zope/security
sendmail-r 77445 
svn://svn.zope.org/repos/main/zope.sendmail/trunk/src/zope/sendmail
sequencesort-r 77445 
svn://svn.zope.org/repos/main/zope.sequencesort/trunk/src/zope/sequencesort
server  -r 77445 
svn://svn.zope.org/repos/main/zope.server/trunk/src/zope/server
size-r 77445 
svn://svn.zope.org/repos/main/zope.size/trunk/src/zope/size
structuredtext  -r 77445 
svn://svn.zope.org/repos/main/zope.structuredtext/trunk/src/zope/structuredtext
tales   -r 77445 
svn://svn.zope.org/repos/main/zope.tales/trunk/src/zope/tales
tal -r 77445 
svn://svn.zope.org/repos/main/zope.tal/trunk/src/zope/tal
testbrowser -r 77445 
svn://svn.zope.org/repos/main/zope.testbrowser/trunk/src/zope/testbrowser
testing -r 77445 
svn://svn.zope.org/repos/main/zope.testing/trunk/src/zope/testing
testrecorder-r 77445 
svn://svn.zope.org/repos/main/zope.testrecorder/trunk/src/zope/testrecorder
thread  -r 77445 
svn://svn.zope.org/repos/main/zope.thread/trunk/src/zope/thread
traversing  -r 77445 
svn://svn.zope.org/repos/main/zope.traversing/trunk/src/zope/traversing
viewlet -r 77445 
svn://svn.zope

[Zope-Checkins] SVN: Zope/trunk/ Removed deprecated ZCML directives from Five including the whole Five.site subpackage

2008-04-26 Thread Hanno Schlichting
Log message for revision 85768:
  Removed deprecated ZCML directives from Five including the whole Five.site 
subpackage
  

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  U   Zope/trunk/lib/python/Products/Five/TODO.txt
  U   Zope/trunk/lib/python/Products/Five/browser/tests/test_defaultview.py
  U   Zope/trunk/lib/python/Products/Five/configure.zcml
  U   Zope/trunk/lib/python/Products/Five/doc/directives.txt
  U   Zope/trunk/lib/python/Products/Five/doc/features.txt
  D   Zope/trunk/lib/python/Products/Five/doc/localsite.txt
  U   
Zope/trunk/lib/python/Products/Five/doc/presentations/five_views_tutorial.mgp
  U   Zope/trunk/lib/python/Products/Five/fiveconfigure.py
  U   Zope/trunk/lib/python/Products/Five/fivedirectives.py
  U   Zope/trunk/lib/python/Products/Five/meta.zcml
  U   Zope/trunk/lib/python/Products/Five/metaconfigure.py
  D   Zope/trunk/lib/python/Products/Five/site/
  U   Zope/trunk/lib/python/Products/Five/tests/test_directives.py
  U   Zope/trunk/lib/python/Products/Five/tests/test_viewable.py
  D   Zope/trunk/lib/python/Products/Five/tests/viewable.txt

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===
--- Zope/trunk/doc/CHANGES.txt  2008-04-26 17:46:46 UTC (rev 85767)
+++ Zope/trunk/doc/CHANGES.txt  2008-04-26 19:04:49 UTC (rev 85768)
@@ -9,6 +9,9 @@
 
 Restructuring
 
+  - Removed deprecated ZCML directives from Five including the whole
+Five.site subpackage.
+
   - Turned deprecation warnings for manage_afterAdd, manage_beforeDelete
 and manage_afterClone methods into discouraged warnings. These methods
 will not be removed in Zope 2.11, but stay for the foreseeable future.

Modified: Zope/trunk/lib/python/Products/Five/TODO.txt
===
--- Zope/trunk/lib/python/Products/Five/TODO.txt2008-04-26 17:46:46 UTC 
(rev 85767)
+++ Zope/trunk/lib/python/Products/Five/TODO.txt2008-04-26 19:04:49 UTC 
(rev 85768)
@@ -7,8 +7,6 @@
 
 * backport r22057 from Five-1.3 branch: fix Localizer unit test problem
 
-* i18n domain of site/managesite.pt?
-
 * i18n and translation of utilities/browser/*pt
 
 * can we stop using zLOG and use the logging package? please?
@@ -30,16 +28,12 @@
 v1.3
 
 
-* revisit the test_localsite/test_{get|query}NextSiteManager tests
-
 * correctly treat ZCatalog.Catalog(Path)Awareness.CatalogAware w.r.t
   events (efge)
 
 v1.4
 
 
-- fix up locale support in Five.form/Five.formlib
-
 - namedtemplate in Five.formlib?
 
 - l10n (philikon)

Modified: Zope/trunk/lib/python/Products/Five/browser/tests/test_defaultview.py
===
--- Zope/trunk/lib/python/Products/Five/browser/tests/test_defaultview.py   
2008-04-26 17:46:46 UTC (rev 85767)
+++ Zope/trunk/lib/python/Products/Five/browser/tests/test_defaultview.py   
2008-04-26 19:04:49 UTC (rev 85768)
@@ -46,35 +46,9 @@
   >>> uf = self.folder.acl_users
   >>> uf._doAddUser('manager', 'r00t', ['Manager'], [])
 
-BBB This is a test of backwards comaptibility with Five 1.3/Zope
-2.9.  The deprecated directive five:defaultViewable would before
-make index.html the default view. Test that this is still the
-case.  five:defaultViewable goes away in Zope 2.12, and this test
-goes then too:
+We can specify another default view with browser:defaultView:
 
-  >>> import warnings
-  >>> showwarning = warnings.showwarning
-  >>> warnings.showwarning = lambda *a, **k: None
-
   >>> zcml.load_string('''
-  ... http://namespaces.zope.org/five";>
-  ...   
-  ... ''')
-  >>> print http(r'''
-  ... GET /test_folder_1_/testoid HTTP/1.1
-  ... Authorization: Basic manager:r00t
-  ... ''')
-  HTTP/1.1 200 OK
-  ...
-  The eagle has landed
-
-  >>> warnings.showwarning = showwarning
-
-But if we want to, we can specify another default view with
-browser:defaultView:
-
-  >>> zcml.load_string('''
   ... http://namespaces.zope.org/browser";>
   ...   
   
   
-  
   
   
   

Modified: Zope/trunk/lib/python/Products/Five/doc/directives.txt
===
--- Zope/trunk/lib/python/Products/Five/doc/directives.txt  2008-04-26 
17:46:46 UTC (rev 85767)
+++ Zope/trunk/lib/python/Products/Five/doc/directives.txt  2008-04-26 
19:04:49 UTC (rev 85768)
@@ -16,11 +16,10 @@
 
 Hook an adapter factory to an interface.
 
-content

+class
+-
 
-Declare interface and permissions on content object. Declares Zope 2
-permissions.
+Declare interface and permissions on classes. Declares Zope 2 permissions.
 
 permission
 --
@@ -48,17 +47,6 @@
 
 Register an interface in ZCML.
 
-factory

-
-Register an object factory.
-
-modulealias

-
-Provide a module under an alias name, e.g. for persistent backward
-compatability

[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/Five/browser/pagetemplatefile.py Added comment about why we copy the whole method

2008-04-26 Thread Hanno Schlichting
Log message for revision 85769:
  Added comment about why we copy the whole method

Changed:
  U   Zope/trunk/lib/python/Products/Five/browser/pagetemplatefile.py

-=-
Modified: Zope/trunk/lib/python/Products/Five/browser/pagetemplatefile.py
===
--- Zope/trunk/lib/python/Products/Five/browser/pagetemplatefile.py 
2008-04-26 19:04:49 UTC (rev 85768)
+++ Zope/trunk/lib/python/Products/Five/browser/pagetemplatefile.py 
2008-04-26 19:21:11 UTC (rev 85769)
@@ -39,6 +39,9 @@
 id = property(getId)
 
 def __call__(self, __instance, *args, **keywords):
+# Work around BBB foul. Before Zope 2.12 there was no first argument
+# but the Zope 3 version has one called instance. Some people used
+# instance as an additional keyword argument.
 instance = __instance
 namespace = self.pt_getContext(
 request=instance.request,

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


[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/Five/ Removed even more long deprecated stuff

2008-04-26 Thread Hanno Schlichting
Log message for revision 85771:
  Removed even more long deprecated stuff
  

Changed:
  U   Zope/trunk/lib/python/Products/Five/bbb.py
  U   Zope/trunk/lib/python/Products/Five/browser/configure.zcml
  U   Zope/trunk/lib/python/Products/Five/browser/tests/pages.txt
  U   Zope/trunk/lib/python/Products/Five/interfaces.py
  D   Zope/trunk/lib/python/Products/Five/tests/test_viewable.py
  D   Zope/trunk/lib/python/Products/Five/traversable.py
  U   Zope/trunk/lib/python/Products/Five/traversing.zcml
  D   Zope/trunk/lib/python/Products/Five/viewable.py

-=-
Modified: Zope/trunk/lib/python/Products/Five/bbb.py
===
--- Zope/trunk/lib/python/Products/Five/bbb.py  2008-04-26 19:22:13 UTC (rev 
85770)
+++ Zope/trunk/lib/python/Products/Five/bbb.py  2008-04-26 19:22:42 UTC (rev 
85771)
@@ -15,9 +15,6 @@
 
 $Id$
 """
-from zope.interface import Interface, implements
-from zope.component.interfaces import ComponentLookupError
-from zope.app.publisher.browser import getDefaultViewName
 
 import Acquisition
 
@@ -43,50 +40,3 @@
 
 def aq_inContextOf(self, *args, **kw):
 return Acquisition.aq_inContextOf(self, *args, **kw)
-
-
-class IBrowserDefault(Interface):
-"""Provide a hook for deciding about the default view for an object"""
-
-def defaultView(self, request):
-"""Return the object to be published
-(usually self) and a sequence of names to traverse to
-find the method to be published.
-"""
-
-class BrowserDefault(object):
-implements(IBrowserDefault)
-
-def __init__(self, context):
-self.context = context
-
-def defaultView(self, request):
-context = self.context
-try:
-name = getDefaultViewName(context, request)
-return context, [name,]
-except ComponentLookupError:
-return context, None
-
-class Traversable:
-"""A mixin to make an object traversable"""
-__five_traversable__ = True
-
-def __bobo_traverse__(self, REQUEST, name):
-"""Hook for Zope 2 traversal
-
-This method is called by Zope 2's ZPublisher upon traversal.
-It allows us to trick it into faking the Zope 3 traversal system
-by using an ITraverser adapter.
-"""
-try:
-return getattr(self, name)
-except AttributeError:
-pass
-
-try:
-return self[name]
-except (KeyError, IndexError, TypeError, AttributeError):
-pass
-
-raise AttributeError(name)

Modified: Zope/trunk/lib/python/Products/Five/browser/configure.zcml
===
--- Zope/trunk/lib/python/Products/Five/browser/configure.zcml  2008-04-26 
19:22:13 UTC (rev 85770)
+++ Zope/trunk/lib/python/Products/Five/browser/configure.zcml  2008-04-26 
19:22:42 UTC (rev 85771)
@@ -1,12 +1,6 @@
 http://namespaces.zope.org/zope";
xmlns:browser="http://namespaces.zope.org/browser";>
 
-  
-  
-
   
@@ -15,13 +9,6 @@
   interface="zope.app.publisher.interfaces.browser.IMenuItemType"
   />
 
-  
-  
-
   >> view()
   u'bird macroColor: 
gray\n'
 
-Test whether old-style direct traversal still works with a
-five:traversable class:
-
-  >>> old_view = self.folder.unrestrictedTraverse('testoid/direct')
-  >>> old_view()
-  'Direct traversal worked'
-
 test_zpt_things:
 
   >>> view = self.folder.unrestrictedTraverse('testoid/condor.html')

Modified: Zope/trunk/lib/python/Products/Five/interfaces.py
===
--- Zope/trunk/lib/python/Products/Five/interfaces.py   2008-04-26 19:22:13 UTC 
(rev 85770)
+++ Zope/trunk/lib/python/Products/Five/interfaces.py   2008-04-26 19:22:42 UTC 
(rev 85771)
@@ -23,13 +23,3 @@
 Menu item types are interfaces that define classes of
 menu items.
 """
-
-# BBB 2006/05/01 -- to be removed after 12 months
-import zope.deferredimport
-zope.deferredimport.deprecated(
-"To get the default browser view of an object, use "
-"zope.app.publisher.browser.queryDefaultViewName. To "
-"define the default view of an object, use the "
-"browser:defaultView directive",
-IBrowserDefault = "Products.Five.bbb:IBrowserDefault",
-)

Deleted: Zope/trunk/lib/python/Products/Five/tests/test_viewable.py
===
--- Zope/trunk/lib/python/Products/Five/tests/test_viewable.py  2008-04-26 
19:22:13 UTC (rev 85770)
+++ Zope/trunk/lib/python/Products/Five/tests/test_viewable.py  2008-04-26 
19:22:42 UTC (rev 85771)
@@ -1,97 +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 SO

[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/Five/formlib/formbase.py Whitespace

2008-04-26 Thread Hanno Schlichting
Log message for revision 85773:
  Whitespace

Changed:
  U   Zope/trunk/lib/python/Products/Five/formlib/formbase.py

-=-
Modified: Zope/trunk/lib/python/Products/Five/formlib/formbase.py
===
--- Zope/trunk/lib/python/Products/Five/formlib/formbase.py 2008-04-26 
19:27:06 UTC (rev 85772)
+++ Zope/trunk/lib/python/Products/Five/formlib/formbase.py 2008-04-26 
19:29:40 UTC (rev 85773)
@@ -61,6 +61,7 @@
 class EditFormBase(FiveFormlibMixin, form.EditFormBase):
 pass
 
+
 class DisplayFormBase(FiveFormlibMixin, form.DisplayFormBase):
 pass
 

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


[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/Five/form/objectwidget.py Some more code removed which isn't needed anymore

2008-04-26 Thread Hanno Schlichting
Log message for revision 85774:
  Some more code removed which isn't needed anymore

Changed:
  U   Zope/trunk/lib/python/Products/Five/form/objectwidget.py

-=-
Modified: Zope/trunk/lib/python/Products/Five/form/objectwidget.py
===
--- Zope/trunk/lib/python/Products/Five/form/objectwidget.py2008-04-26 
19:29:40 UTC (rev 85773)
+++ Zope/trunk/lib/python/Products/Five/form/objectwidget.py2008-04-26 
19:44:07 UTC (rev 85774)
@@ -35,10 +35,6 @@
 
 class ObjectWidgetClass(zope.app.form.browser.objectwidget.ObjectWidget):
 
-def __init__(self, context, request, factory, **kw):
-super(ObjectWidgetClass, self).__init__(context, request, factory, 
**kw)
-self.view = ObjectWidgetView(self, request)
-
 def setRenderedValue(self, value):
 """Slightly more robust re-implementation this method."""
 # re-call setupwidgets with the content

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


[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/Five/browser/ Found another class which is exactly the same now as the one in Zope3.

2008-04-26 Thread Hanno Schlichting
Log message for revision 85775:
  Found another class which is exactly the same now as the one in Zope3.
  

Changed:
  U   Zope/trunk/lib/python/Products/Five/browser/configure.zcml
  U   Zope/trunk/lib/python/Products/Five/browser/menu.py

-=-
Modified: Zope/trunk/lib/python/Products/Five/browser/configure.zcml
===
--- Zope/trunk/lib/python/Products/Five/browser/configure.zcml  2008-04-26 
19:44:07 UTC (rev 85774)
+++ Zope/trunk/lib/python/Products/Five/browser/configure.zcml  2008-04-26 
20:10:16 UTC (rev 85775)
@@ -80,7 +80,7 @@
   for="*"
   name="view_get_menu"
   permission="zope.Public"
-  class=".menu.MenuAccessView"
+  class="zope.app.publisher.browser.menu.MenuAccessView"
   allowed_interface="zope.app.publisher.interfaces.browser.IMenuAccessView"
   />
 

Modified: Zope/trunk/lib/python/Products/Five/browser/menu.py
===
--- Zope/trunk/lib/python/Products/Five/browser/menu.py 2008-04-26 19:44:07 UTC 
(rev 85774)
+++ Zope/trunk/lib/python/Products/Five/browser/menu.py 2008-04-26 20:10:16 UTC 
(rev 85775)
@@ -15,13 +15,10 @@
 
 $Id$
 """
-from zope.interface import implements
-from zope.app.publisher.interfaces.browser import IMenuAccessView
-from zope.app.publisher.browser.menu import getMenu
-from Products.Five import BrowserView
+import zope.deferredimport
 
-class MenuAccessView(BrowserView):
-implements(IMenuAccessView)
-
-def __getitem__(self, menu_id):
-return getMenu(menu_id, self.context, self.request)
+zope.deferredimport.deprecated(
+"The Five specific view has been made obsolete. Please use the " 
+"view from zope.app.publisher directly.",
+MenuAccessView = 'zope.app.publisher.browser.menu.MenuAccessView',
+)

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


[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/PageTemplates/Expressions.py Removed another deprecated method

2008-04-26 Thread Hanno Schlichting
Log message for revision 85776:
  Removed another deprecated method

Changed:
  U   Zope/trunk/lib/python/Products/PageTemplates/Expressions.py

-=-
Modified: Zope/trunk/lib/python/Products/PageTemplates/Expressions.py
===
--- Zope/trunk/lib/python/Products/PageTemplates/Expressions.py 2008-04-26 
20:10:16 UTC (rev 85775)
+++ Zope/trunk/lib/python/Products/PageTemplates/Expressions.py 2008-04-26 
20:39:56 UTC (rev 85776)
@@ -279,16 +279,6 @@
 def item(self):
 return super(ZopeIterator, self).item()
 
-# This method was on the old ZTUtils.Iterator.Iterator class but
-# isn't part of the spec.  We'll support it for a short
-# deprecation period.
-# BBB 2005/05/01 -- to be removed after 12 months
-@property
-@deprecate("The 'nextIndex' method has been deprecated and will disappear "
-   "in Zope 2.12.  Use 'iterator.index+1' instead.")
-def nextIndex(self):
-return self.index + 1
-
 # 'first' and 'last' are Zope 2 enhancements to the TALES iterator
 # spec.  See help/tal-repeat.stx for more info
 def first(self, name=None):

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


[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/PageTemplates/Expressions.py Removed even more deprecated stuff

2008-04-26 Thread Hanno Schlichting
Log message for revision 85777:
  Removed even more deprecated stuff

Changed:
  U   Zope/trunk/lib/python/Products/PageTemplates/Expressions.py

-=-
Modified: Zope/trunk/lib/python/Products/PageTemplates/Expressions.py
===
--- Zope/trunk/lib/python/Products/PageTemplates/Expressions.py 2008-04-26 
20:39:56 UTC (rev 85776)
+++ Zope/trunk/lib/python/Products/PageTemplates/Expressions.py 2008-04-26 
20:42:59 UTC (rev 85777)
@@ -20,12 +20,11 @@
 
 import logging
 
-from zope.component import getUtility
-from zope.component.interfaces import ComponentLookupError
+from zope.component import queryUtility
 from zope.interface import implements
 from zope.tales.tales import Context, Iterator
 from zope.tales.expressions import PathExpr, StringExpr, NotExpr
-from zope.tales.expressions import DeferExpr, SubPathExpr, Undefs
+from zope.tales.expressions import DeferExpr, Undefs
 from zope.tales.pythonexpr import PythonExpr
 from zope.traversing.interfaces import ITraversable
 from zope.traversing.adapters import traversePathElement
@@ -47,15 +46,6 @@
 
 LOG = logging.getLogger('Expressions')
 
-# BBB 2005/05/01 -- remove after 12 months
-import zope.deprecation
-from zope.deprecation import deprecate
-zope.deprecation.deprecated(
-("StringExpr", "NotExpr", "PathExpr", "SubPathExpr", "Undefs"),
-"Zope 2 uses the Zope 3 ZPT engine now.  Expression types can be "
-"imported from zope.tales.expressions."
-)
-
 # In Zope 2 traversal semantics, NotFound or Unauthorized (the Zope 2
 # versions) indicate that traversal has failed.  By default, Zope 3's
 # TALES engine doesn't recognize them as such which is why we extend
@@ -223,9 +213,8 @@
 # This should not be a problem since it won't change the old
 # default behavior
 
-try:
-resolver = getUtility(IUnicodeEncodingConflictResolver)
-except ComponentLookupError:
+resolver = queryUtility(IUnicodeEncodingConflictResolver)
+if resolver is None:
 return unicode(text)
 
 try:

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


[Zope-Checkins] SVN: Zope/trunk/ Removed deprecated modules from Products.PageTemplates.

2008-04-26 Thread Hanno Schlichting
Log message for revision 85778:
  Removed deprecated modules from Products.PageTemplates.
  

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  U   Zope/trunk/lib/python/Products/PageTemplates/PageTemplate.py
  D   Zope/trunk/lib/python/Products/PageTemplates/PathIterator.py
  D   Zope/trunk/lib/python/Products/PageTemplates/PythonExpr.py
  D   Zope/trunk/lib/python/Products/PageTemplates/TALES.py
  D   Zope/trunk/lib/python/Products/PageTemplates/tests/testTALES.py

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===
--- Zope/trunk/doc/CHANGES.txt  2008-04-26 20:42:59 UTC (rev 85777)
+++ Zope/trunk/doc/CHANGES.txt  2008-04-26 20:55:47 UTC (rev 85778)
@@ -9,6 +9,8 @@
 
 Restructuring
 
+  - Removed deprecated modules from Products.PageTemplates.
+
   - Removed deprecated ZCML directives from Five including the whole
 Five.site subpackage.
 

Modified: Zope/trunk/lib/python/Products/PageTemplates/PageTemplate.py
===
--- Zope/trunk/lib/python/Products/PageTemplates/PageTemplate.py
2008-04-26 20:42:59 UTC (rev 85777)
+++ Zope/trunk/lib/python/Products/PageTemplates/PageTemplate.py
2008-04-26 20:55:47 UTC (rev 85778)
@@ -22,24 +22,6 @@
 from zope.tales.expressions import SimpleModuleImporter
 from Products.PageTemplates.Expressions import getEngine
 
-##
-# BBB 2005/05/01 -- to be removed after 12 months
-_ModuleImporter = SimpleModuleImporter
-ModuleImporter = SimpleModuleImporter()
-import zope.deprecation
-zope.deprecation.deprecated(
-('ModuleImporter', '_ModuleImporter'),
-"Zope 2 uses the Zope 3 ZPT engine now.  ModuleImporter has moved "
-"to zope.pagetemplate.pagetemplate.SimpleModuleImporter (this is a "
-"class, not an instance)."
-)
-zope.deprecation.deprecated(
-('PTRuntimeError', 'PageTemplateTracebackSupplement'),
-"Zope 2 uses the Zope 3 ZPT engine now.  The object you're importing "
-"has moved to zope.pagetemplate.pagetemplate.  This reference will "
-"be gone in Zope 2.12.",
-)
-##
 
 class PageTemplate(ExtensionClass.Base,
zope.pagetemplate.pagetemplate.PageTemplate):

Deleted: Zope/trunk/lib/python/Products/PageTemplates/PathIterator.py
===
--- Zope/trunk/lib/python/Products/PageTemplates/PathIterator.py
2008-04-26 20:42:59 UTC (rev 85777)
+++ Zope/trunk/lib/python/Products/PageTemplates/PathIterator.py
2008-04-26 20:55:47 UTC (rev 85778)
@@ -1,25 +0,0 @@
-##
-#
-# Copyright (c) 2002 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
-#
-##
-"""Path Iterator
-
-BBB 2005/05/01 -- to be removed after 12 months
-
-$Id$
-"""
-import zope.deferredimport
-zope.deferredimport.deprecated(
-"It has been renamed to PathIterator and moved to the "
-"Products.PageTemplates.Expressions module.  This reference will be "
-"gone in Zope 2.12.",
-PathIterator = "Products.PageTemplates.Expressions:PathIterator"
-)

Deleted: Zope/trunk/lib/python/Products/PageTemplates/PythonExpr.py
===
--- Zope/trunk/lib/python/Products/PageTemplates/PythonExpr.py  2008-04-26 
20:42:59 UTC (rev 85777)
+++ Zope/trunk/lib/python/Products/PageTemplates/PythonExpr.py  2008-04-26 
20:55:47 UTC (rev 85778)
@@ -1,19 +0,0 @@
-##
-#
-# Copyright (c) 2002 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
-#
-##
-"""Generic Python Expression Handler
-
-$Id$
-"""
-# BBB 2005/05/01 -- remove after 12 months
-import zope.deprecation
-zope.deprecation.moved("zope.tales.pythonexpr", "2.12")

Deleted: Zope/trunk/lib/python/Prod

[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/ Removed old framework testrunner and removed references to software home.

2008-08-27 Thread Hanno Schlichting
Log message for revision 90441:
  Removed old framework testrunner and removed references to software home.
  

Changed:
  U   Zope/trunk/lib/python/Products/Five/browser/tests/cps_test_localizer.py
  D   Zope/trunk/lib/python/Products/Five/browser/tests/framework.py
  U   Zope/trunk/lib/python/Products/Five/browser/tests/pts_test_languages.py
  U   Zope/trunk/lib/python/Products/Five/browser/tests/test_absoluteurl.py
  U   Zope/trunk/lib/python/Products/Five/browser/tests/test_adding.py
  U   Zope/trunk/lib/python/Products/Five/browser/tests/test_decode.py
  U   Zope/trunk/lib/python/Products/Five/browser/tests/test_defaultview.py
  U   Zope/trunk/lib/python/Products/Five/browser/tests/test_i18n.py
  U   Zope/trunk/lib/python/Products/Five/browser/tests/test_menu.py
  U   Zope/trunk/lib/python/Products/Five/browser/tests/test_pages.py
  U   Zope/trunk/lib/python/Products/Five/browser/tests/test_provider.py
  U   Zope/trunk/lib/python/Products/Five/browser/tests/test_recurse.py
  U   Zope/trunk/lib/python/Products/Five/browser/tests/test_resource.py
  U   Zope/trunk/lib/python/Products/Five/browser/tests/test_skin.py
  U   Zope/trunk/lib/python/Products/Five/browser/tests/test_traversable.py
  U   Zope/trunk/lib/python/Products/Five/browser/tests/test_zope3security.py
  D   Zope/trunk/lib/python/Products/Five/form/tests/framework.py
  U   Zope/trunk/lib/python/Products/Five/form/tests/test_forms.py
  D   Zope/trunk/lib/python/Products/Five/formlib/tests/framework.py
  U   Zope/trunk/lib/python/Products/Five/formlib/tests/test_formlib.py
  D   Zope/trunk/lib/python/Products/Five/skin/tests/framework.py
  U   Zope/trunk/lib/python/Products/Five/skin/tests/test_standardmacros.py
  U   Zope/trunk/lib/python/Products/Five/tests/boilerplate.py
  D   Zope/trunk/lib/python/Products/Five/tests/framework.py
  U   Zope/trunk/lib/python/Products/Five/tests/test_directives.py
  U   Zope/trunk/lib/python/Products/Five/tests/test_event.py
  U   Zope/trunk/lib/python/Products/Five/tests/test_i18n.py
  U   Zope/trunk/lib/python/Products/Five/tests/test_registerclass.py
  U   Zope/trunk/lib/python/Products/Five/tests/test_registerpackage.py
  U   Zope/trunk/lib/python/Products/Five/tests/test_security.py
  U   Zope/trunk/lib/python/Products/Five/tests/test_size.py
  D   Zope/trunk/lib/python/Products/Five/utilities/browser/tests/framework.py
  U   Zope/trunk/lib/python/Products/Five/utilities/browser/tests/test_marker.py
  U   Zope/trunk/lib/python/Products/Five/zcml.py
  U   Zope/trunk/lib/python/Products/OFSP/help/Control-Panel_Contents.stx

-=-
Modified: 
Zope/trunk/lib/python/Products/Five/browser/tests/cps_test_localizer.py
===
--- Zope/trunk/lib/python/Products/Five/browser/tests/cps_test_localizer.py 
2008-08-27 12:36:47 UTC (rev 90440)
+++ Zope/trunk/lib/python/Products/Five/browser/tests/cps_test_localizer.py 
2008-08-27 12:45:41 UTC (rev 90441)
@@ -17,9 +17,6 @@
 
 $Id$
 """
-import os, sys
-if __name__ == '__main__':
-execfile(os.path.join(sys.path[0], 'framework.py'))
 
 def test_suite():
 from Testing.ZopeTestCase import installProduct, FunctionalDocFileSuite
@@ -56,6 +53,3 @@
 
 return FunctionalDocFileSuite('cps_test_localizer.txt',
   package='Products.Five.browser.tests')
-
-if __name__ == '__main__':
-framework()

Deleted: Zope/trunk/lib/python/Products/Five/browser/tests/framework.py
===
--- Zope/trunk/lib/python/Products/Five/browser/tests/framework.py  
2008-08-27 12:36:47 UTC (rev 90440)
+++ Zope/trunk/lib/python/Products/Five/browser/tests/framework.py  
2008-08-27 12:45:41 UTC (rev 90441)
@@ -1,107 +0,0 @@
-##
-#
-# ZopeTestCase 
-#
-# COPY THIS FILE TO YOUR 'tests' DIRECTORY.
-#
-# This version of framework.py will use the SOFTWARE_HOME
-# environment variable to locate Zope and the Testing package.
-#
-# If the tests are run in an INSTANCE_HOME installation of Zope,
-# Products.__path__ and sys.path with be adjusted to include the
-# instance's Products and lib/python directories respectively.
-#
-# If you explicitly set INSTANCE_HOME prior to running the tests,
-# auto-detection is disabled and the specified path will be used 
-# instead.
-#
-# If the 'tests' directory contains a custom_zodb.py file, INSTANCE_HOME
-# will be adjusted to use it.
-#
-# If you set the ZEO_INSTANCE_HOME environment variable a ZEO setup 
-# is assumed, and you can attach to a running ZEO server (via the 
-# instance's custom_zodb.py).
-#
-##
-#
-# The following code should be at the top of every test module:
-#
-# import os, sys
-# if __name__ == '__main__':
-# execfile(os.path.join(sys.path[0], 'framework.py'))
-#
-# ...and the following at the bottom:
-#
-# if __name__ == '__

[Zope-Checkins] SVN: Zope/trunk/lib/python/App/dtml/ Removed references to software home

2008-08-27 Thread Hanno Schlichting
Log message for revision 90442:
  Removed references to software home
  

Changed:
  U   Zope/trunk/lib/python/App/dtml/cpContents.dtml
  U   Zope/trunk/lib/python/App/dtml/debug.dtml
  U   Zope/trunk/lib/python/App/dtml/zope_quick_start.dtml

-=-
Modified: Zope/trunk/lib/python/App/dtml/cpContents.dtml
===
--- Zope/trunk/lib/python/App/dtml/cpContents.dtml  2008-08-27 12:45:41 UTC 
(rev 90441)
+++ Zope/trunk/lib/python/App/dtml/cpContents.dtml  2008-08-27 12:46:35 UTC 
(rev 90442)
@@ -47,30 +47,6 @@
 
   
   
-  SOFTWARE_HOME
-  
-  
-  
-  
-  &dtml-getSOFTWARE_HOME;
-  
-  
-
-
-  
-  
-  ZOPE_HOME
-  
-  
-  
-  
-  &dtml-getZOPE_HOME;
-  
-  
-
-
-  
-  
   INSTANCE_HOME
   
   

Modified: Zope/trunk/lib/python/App/dtml/debug.dtml
===
--- Zope/trunk/lib/python/App/dtml/debug.dtml   2008-08-27 12:45:41 UTC (rev 
90441)
+++ Zope/trunk/lib/python/App/dtml/debug.dtml   2008-08-27 12:46:35 UTC (rev 
90442)
@@ -41,7 +41,6 @@
 Zope version: &dtml-version_txt;
 Python version: &dtml-sys_version;
 System Platform: &dtml-sys_platform;
-SOFTWARE_HOME: &dtml-getSOFTWARE_HOME;
 INSTANCE_HOME: &dtml-getINSTANCE_HOME;
 CLIENT_HOME: &dtml-getCLIENT_HOME;
 Process ID: &dtml-process_id; (&dtml-thread_get_ident;)

Modified: Zope/trunk/lib/python/App/dtml/zope_quick_start.dtml
===
--- Zope/trunk/lib/python/App/dtml/zope_quick_start.dtml2008-08-27 
12:45:41 UTC (rev 90441)
+++ Zope/trunk/lib/python/App/dtml/zope_quick_start.dtml2008-08-27 
12:46:35 UTC (rev 90442)
@@ -41,8 +41,6 @@
 
 
 If you're running Zope on Windows, you'll need to use the "zpasswd.py" utility
-in your Zope installation's "bin" directory at
-\bin
 to create a file named inituser in your Zope instance home at
  that contains the
 initial administrative username and password.

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


[Zope-Checkins] SVN: Zope/trunk/lib/python/Testing/ZopeTestCase/ Removed references to software home.

2008-08-27 Thread Hanno Schlichting
Log message for revision 90443:
  Removed references to software home.
  

Changed:
  U   Zope/trunk/lib/python/Testing/ZopeTestCase/doc/ENVIRONMENT.txt
  U   Zope/trunk/lib/python/Testing/ZopeTestCase/doc/README.stx
  U   Zope/trunk/lib/python/Testing/ZopeTestCase/doc/TIMELINES.txt
  D   Zope/trunk/lib/python/Testing/ZopeTestCase/framework.py
  D   Zope/trunk/lib/python/Testing/ZopeTestCase/zopedoctest/framework.py

-=-
Modified: Zope/trunk/lib/python/Testing/ZopeTestCase/doc/ENVIRONMENT.txt
===
--- Zope/trunk/lib/python/Testing/ZopeTestCase/doc/ENVIRONMENT.txt  
2008-08-27 12:46:35 UTC (rev 90442)
+++ Zope/trunk/lib/python/Testing/ZopeTestCase/doc/ENVIRONMENT.txt  
2008-08-27 12:47:43 UTC (rev 90443)
@@ -2,14 +2,9 @@
 ZTC makes the following assumptions about its environment:
 
 a) The 'ZopeTestCase' package is installed in the Zope "trunk" inside the
-   'Testing' module, which means: SOFTWARE_HOME/Testing/ZopeTestCase.
+   'Testing' module.
 
-b) A 'Products' directory exists inside SOFTWARE_HOME and INSTANCE_HOME.
-
-c) The tests (the 'tests' subdirectories) are located either below a 
-   SOFTWARE_HOME or INSTANCE_HOME, typically in Products/MyCoolProduct/tests.
-
-d) The somewhat weak assumption is that ZTC can walk up the directory tree from
+b) The somewhat weak assumption is that ZTC can walk up the directory tree from
'tests', and find a 'Products' directory. This is how INSTANCE_HOME 
detection works. It regrettably fails on some filesystems when symbolic 
links are involved (a solution is detailed below, so hang on).
@@ -24,8 +19,7 @@
 
 
 ZTC attempts to resolve this by detecting an INSTANCE_HOME for 1) but leaving
-the actual environment variable untouched so 2) works by still pointing into 
-SOFTWARE_HOME/Testing.
+the actual environment variable untouched.
 
 As soon as I allow you to set INSTANCE_HOME yourself, I lose the ability to 
 distinguish whether you mean 1) or 2) or both. 

Modified: Zope/trunk/lib/python/Testing/ZopeTestCase/doc/README.stx
===
--- Zope/trunk/lib/python/Testing/ZopeTestCase/doc/README.stx   2008-08-27 
12:46:35 UTC (rev 90442)
+++ Zope/trunk/lib/python/Testing/ZopeTestCase/doc/README.stx   2008-08-27 
12:47:43 UTC (rev 90443)
@@ -43,27 +43,9 @@
 Note that there is a skeleton test suite named 'testSkeleton.py' that you 
 may copy into your 'tests' directory and take it from there.
 
-Note also that when the tests are run in an INSTANCE_HOME installation of 
-Zope, you must set the SOFTWARE_HOME environment variable for the 
'Testing' 
-and 'ZopeTestCase' packages to be found.
-
 See the sample tests in the 'ZopeTestCase' directory for details on 
writing 
 your own tests.
 
-framework.py
-
-1. Uses SOFTWARE_HOME (if set) to locate the Testing package.
-
-2. Detects and handles INSTANCE_HOME installations of Zope. Please
-   see ENVIRONMENT.txt for the assumptions ZTC makes about its
-   environment.
-
-3. Supports setting up a ZODB from a 'custom_zodb.py' file in
-   the 'tests' directory.
-
-4. Allows to connect to a running ZEO server by setting the
-   ZEO_INSTANCE_HOME environment variable.
-
 testrunner.py
 
 Alternatively, you may use Zope's testrunner utility to run your tests 
@@ -71,8 +53,7 @@
 installation). If you do so, you will have to define a 'test_suite' method 
 in your modules (see examples). 
 
-There is no need to set SOFTWARE_HOME when using the testrunner but you may
-have to provide the -i flag when testing in an INSTANCE_HOME setup.
+You may have to provide the -i flag when testing in an INSTANCE_HOME setup.
 
 Example: 'python /path/to/Zope/utilities/testrunner.py -q -i -a'
 

Modified: Zope/trunk/lib/python/Testing/ZopeTestCase/doc/TIMELINES.txt
===
--- Zope/trunk/lib/python/Testing/ZopeTestCase/doc/TIMELINES.txt
2008-08-27 12:46:35 UTC (rev 90442)
+++ Zope/trunk/lib/python/Testing/ZopeTestCase/doc/TIMELINES.txt
2008-08-27 12:47:43 UTC (rev 90443)
@@ -5,7 +5,6 @@
 1. includes file framework.py
 
 1.1 locates and imports the Testing package by means of
-- SOFTWARE_HOME environment variable
 - auto-detection
 
 1.2 locates and includes file ztc_common.py

Deleted: Zope/trunk/lib/python/Testing/ZopeTestCase/framework.py
===
--- Zope/trunk/lib/python/Testing/ZopeTestCase/framework.py 2008-08-27 
12:46:35 UTC (rev 90442)
+++ Zope/trunk/lib/python/Testing/ZopeTestCase/framework.py 2008-08-27 
12:47:43 UTC (rev 90443)
@@ -1,116 +0,0 @@
-##
-#
-# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
-#
-# This software is subje

[Zope-Checkins] SVN: Zope/trunk/lib/python/Testing/ZopeTestCase/ Remove tests that depend on the presence of the Examples.zexp

2008-08-27 Thread Hanno Schlichting
Log message for revision 90454:
  Remove tests that depend on the presence of the Examples.zexp
  

Changed:
  U   Zope/trunk/lib/python/Testing/ZopeTestCase/doc/HOWTO.stx
  U   Zope/trunk/lib/python/Testing/ZopeTestCase/testBaseTestCase.py
  U   Zope/trunk/lib/python/Testing/ZopeTestCase/testPortalTestCase.py
  D   Zope/trunk/lib/python/Testing/ZopeTestCase/testShoppingCart.py
  U   Zope/trunk/lib/python/Testing/ZopeTestCase/testZopeTestCase.py

-=-
Modified: Zope/trunk/lib/python/Testing/ZopeTestCase/doc/HOWTO.stx
===
--- Zope/trunk/lib/python/Testing/ZopeTestCase/doc/HOWTO.stx2008-08-27 
13:47:48 UTC (rev 90453)
+++ Zope/trunk/lib/python/Testing/ZopeTestCase/doc/HOWTO.stx2008-08-27 
14:05:44 UTC (rev 90454)
@@ -178,9 +178,6 @@
   It demonstrates how to manipulate the test user's roles and 
permissions and how
   security is validated.
 
-- **'testShoppingCart.py'** tests the ShoppingCart example. This test
-  uses Sessions and shows how to test a TTW Zope application.
-
 - **'testFunctional.py'** demonstrates the new functional testing 
features.
   Tests may call 'self.publish()' to simulate URL calls to the 
ZPublisher.
 

Modified: Zope/trunk/lib/python/Testing/ZopeTestCase/testBaseTestCase.py
===
--- Zope/trunk/lib/python/Testing/ZopeTestCase/testBaseTestCase.py  
2008-08-27 13:47:48 UTC (rev 90453)
+++ Zope/trunk/lib/python/Testing/ZopeTestCase/testBaseTestCase.py  
2008-08-27 14:05:44 UTC (rev 90454)
@@ -15,9 +15,8 @@
 NOTE: This is *not* an example TestCase. Do not
 use this file as a blueprint for your own tests!
 
-See testPythonScript.py and testShoppingCart.py for
-example test cases. See testSkeleton.py for a quick
-way of getting started.
+See testPythonScript.py for example test cases. See testSkeleton.py for a
+quick way of getting started.
 
 $Id$
 """

Modified: Zope/trunk/lib/python/Testing/ZopeTestCase/testPortalTestCase.py
===
--- Zope/trunk/lib/python/Testing/ZopeTestCase/testPortalTestCase.py
2008-08-27 13:47:48 UTC (rev 90453)
+++ Zope/trunk/lib/python/Testing/ZopeTestCase/testPortalTestCase.py
2008-08-27 14:05:44 UTC (rev 90454)
@@ -15,9 +15,8 @@
 NOTE: This is *not* an example TestCase. Do not
 use this file as a blueprint for your own tests!
 
-See testPythonScript.py and testShoppingCart.py for
-example test cases. See testSkeleton.py for a quick
-way of getting started.
+See testPythonScript.py for example test cases. See testSkeleton.py for a
+quick way of getting started.
 
 $Id$
 """

Deleted: Zope/trunk/lib/python/Testing/ZopeTestCase/testShoppingCart.py
===
--- Zope/trunk/lib/python/Testing/ZopeTestCase/testShoppingCart.py  
2008-08-27 13:47:48 UTC (rev 90453)
+++ Zope/trunk/lib/python/Testing/ZopeTestCase/testShoppingCart.py  
2008-08-27 14:05:44 UTC (rev 90454)
@@ -1,143 +0,0 @@
-##
-#
-# Copyright (c) 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.
-#
-##
-"""Example ZopeTestCase testing the ShoppingCart example application
-
-Note the use of sessions and how the SESSION object is added to
-the REQUEST in afterSetUp().
-
-You can use zLOG.LOG() if you set up the event log variables first.
-Handy for debugging and tracing your tests.
-
-$Id$
-"""
-
-import os, sys
-if __name__ == '__main__':
-execfile(os.path.join(sys.path[0], 'framework.py'))
-
-#os.environ['STUPID_LOG_FILE'] = os.path.join(os.getcwd(), 'zLOG.log')
-#os.environ['STUPID_LOG_SEVERITY'] = '0'
-
-from Testing import ZopeTestCase
-
-from Testing.ZopeTestCase import layer
-from Testing.ZopeTestCase import utils
-from Testing.ZopeTestCase import transaction
-
-from Globals import SOFTWARE_HOME
-examples_path = os.path.join(SOFTWARE_HOME, '..', '..', 'skel', 'import', 
'Examples.zexp')
-examples_path = os.path.abspath(examples_path)
-
-
-class ShoppingCartLayer(layer.ZopeLite):
-
-@classmethod
-def setUp(cls):
-# Set up sessioning objects
-utils.appcall(utils.setupCoreSessions)
-
-# Set up example applications
-utils.appcall(utils.importObjectFromFile, examples_path, quiet=1)
-
-@classmethod
-def tearDown(cls):
-def cleanup(app):
-app._delObject('Examp

[Zope-Checkins] SVN: Zope/trunk/ Removed Examples.zexp from the skeleton. The TTW shopping cart isn't any good example of Zope usage anymore.

2008-08-27 Thread Hanno Schlichting
Log message for revision 90455:
  Removed Examples.zexp from the skeleton. The TTW shopping cart isn't any good 
example of Zope usage anymore.
  

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  D   Zope/trunk/skel/import/Examples.zexp

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===
--- Zope/trunk/doc/CHANGES.txt  2008-08-27 14:05:44 UTC (rev 90454)
+++ Zope/trunk/doc/CHANGES.txt  2008-08-27 14:08:57 UTC (rev 90455)
@@ -9,6 +9,9 @@
 
 Restructuring
 
+  - Removed Examples.zexp from the skeleton. The TTW shopping cart isn't
+any good example of Zope usage anymore.
+
   - Removed deprecated ZTUtil.Iterator module
 
   - Removed deprecated StructuredText module

Deleted: Zope/trunk/skel/import/Examples.zexp
===
(Binary files differ)

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


[Zope-Checkins] SVN: Zope/trunk/ Made Five.testbrowser compatible with mechanize 0.1.7b.

2008-11-14 Thread Hanno Schlichting
Log message for revision 92936:
  Made Five.testbrowser compatible with mechanize 0.1.7b.
  

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  U   Zope/trunk/lib/python/Products/Five/testbrowser.py

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===
--- Zope/trunk/doc/CHANGES.txt  2008-11-14 17:20:54 UTC (rev 92935)
+++ Zope/trunk/doc/CHANGES.txt  2008-11-14 17:22:07 UTC (rev 92936)
@@ -219,6 +219,8 @@
 
 Bugs Fixed
 
+  - Made Five.testbrowser compatible with mechanize 0.1.7b.
+
   - Ensure that response header values cannot embed CRLF pairs, which
 violate the HTTP spec (RFC 2616).
 

Modified: Zope/trunk/lib/python/Products/Five/testbrowser.py
===
--- Zope/trunk/lib/python/Products/Five/testbrowser.py  2008-11-14 17:20:54 UTC 
(rev 92935)
+++ Zope/trunk/lib/python/Products/Five/testbrowser.py  2008-11-14 17:22:07 UTC 
(rev 92936)
@@ -92,13 +92,13 @@
 default_others = ['_http_error', '_http_request_upgrade',
   '_http_default_error']
 default_features = ['_redirect', '_cookies', '_referer', '_refresh',
-'_equiv', '_basicauth', '_digestauth', '_seek' ]
+'_equiv', '_basicauth', '_digestauth' ]
 
 def __init__(self, *args, **kws):
 inherited_handlers = ['_unknown', '_http_error',
 '_http_request_upgrade', '_http_default_error', '_basicauth',
 '_digestauth', '_redirect', '_cookies', '_referer',
-'_refresh', '_equiv', '_seek', '_gzip']
+'_refresh', '_equiv', '_gzip']
 
 self.handler_classes = {"http": PublisherHTTPHandler}
 for name in inherited_handlers:

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


[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/Five/browser/pagetemplatefile.py Avoid two unnecessary dict lookups.

2008-11-15 Thread Hanno Schlichting
Log message for revision 92965:
  Avoid two unnecessary dict lookups.

Changed:
  U   Zope/trunk/lib/python/Products/Five/browser/pagetemplatefile.py

-=-
Modified: Zope/trunk/lib/python/Products/Five/browser/pagetemplatefile.py
===
--- Zope/trunk/lib/python/Products/Five/browser/pagetemplatefile.py 
2008-11-15 13:50:40 UTC (rev 92964)
+++ Zope/trunk/lib/python/Products/Five/browser/pagetemplatefile.py 
2008-11-15 13:57:00 UTC (rev 92965)
@@ -71,10 +71,10 @@
 if meth is not None:
 root = meth()
 
-context.update(here=context['context'],
+context.update(here=obj,
# philiKON thinks container should be the view,
# but BBB is more important than aesthetics.
-   container=context['context'],
+   container=obj,
root=root,
modules=SecureModuleImporter,
traverse_subpath=[],  # BBB, never really worked

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


[Zope-Checkins] SVN: Zope/trunk/ Protect against non-existing zope.conf path and products directories. This makes it possible to run a Zope instance without a Products or lib/python directory.

2008-11-22 Thread Hanno Schlichting
Log message for revision 93264:
  Protect against non-existing zope.conf path and products directories. This 
makes it possible to run a Zope instance without a Products or lib/python 
directory.
  

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  U   Zope/trunk/lib/python/Zope2/Startup/handlers.py

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===
--- Zope/trunk/doc/CHANGES.txt  2008-11-22 20:17:26 UTC (rev 93263)
+++ Zope/trunk/doc/CHANGES.txt  2008-11-23 00:05:33 UTC (rev 93264)
@@ -9,6 +9,10 @@
 
 Restructuring
 
+  - Protect against non-existing zope.conf path and products directories.
+This makes it possible to run a Zope instance without a Products or
+lib/python directory.
+
   - updated to ZODB 3.8.1
 
   - Moved exception MountedStorageError from ZODB.POSExceptions

Modified: Zope/trunk/lib/python/Zope2/Startup/handlers.py
===
--- Zope/trunk/lib/python/Zope2/Startup/handlers.py 2008-11-22 20:17:26 UTC 
(rev 93263)
+++ Zope/trunk/lib/python/Zope2/Startup/handlers.py 2008-11-23 00:05:33 UTC 
(rev 93264)
@@ -184,10 +184,11 @@
 for k,v in config.environment.items():
 os.environ[k] = v
 
-# Add directories to the pythonpath; always insert instancehome/lib/python
+# Add directories to the pythonpath
 instancelib = os.path.join(config.instancehome, 'lib', 'python')
 if instancelib not in config.path:
-config.path.append(instancelib)
+if os.path.isdir(instancelib):
+config.path.append(instancelib)
 path = config.path[:]
 path.reverse()
 for dir in path:
@@ -195,11 +196,11 @@
 
 # Add any product directories not already in Products.__path__.
 # Directories are added in the order they are mentioned
-# Always insert instancehome.Products
 
 instanceprod = os.path.join(config.instancehome, 'Products')
 if instanceprod not in config.products:
-config.products.append(instanceprod)
+if os.path.isdir(instanceprod):
+config.products.append(instanceprod)
 
 import Products
 L = []

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


[Zope-Checkins] SVN: Zope/trunk/ Adjusted tests after policy change by malthe.

2008-11-30 Thread Hanno Schlichting
Log message for revision 93450:
  Adjusted tests after policy change by malthe.
  

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  U   Zope/trunk/lib/python/Products/Five/browser/tests/aqlegacy.py

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===
--- Zope/trunk/doc/CHANGES.txt  2008-11-30 21:40:34 UTC (rev 93449)
+++ Zope/trunk/doc/CHANGES.txt  2008-11-30 21:48:48 UTC (rev 93450)
@@ -225,8 +225,7 @@
 
   - After the proper introduction of parent-pointers, it's now
 wrong to acquisition-wrap content providers. We will now use
-the "classic" content provider expression from Zope
-3. [malthe]
+the "classic" content provider expression from Zope 3.
 
   - Testing.ZopeTestCase: Remove quota argument from DemoStorage calls in
 preparation for ZODB 3.9.

Modified: Zope/trunk/lib/python/Products/Five/browser/tests/aqlegacy.py
===
--- Zope/trunk/lib/python/Products/Five/browser/tests/aqlegacy.py   
2008-11-30 21:40:34 UTC (rev 93449)
+++ Zope/trunk/lib/python/Products/Five/browser/tests/aqlegacy.py   
2008-11-30 21:48:48 UTC (rev 93450)
@@ -86,14 +86,11 @@
 self.context = context
 self.request = request
 self.view = view
-# Normally, a content provider should set __parent__ to view
-# or context.  This one doesn't do this on purpose to ensure
-# it works without.
+# A content provider must set __parent__ to view or context.
+self.__parent__ = context
 
 def update(self):
-# Make sure that the content provider is acquisition wrapped.
-assert self.aq_parent == self.context
-assert self.aq_base == self
+pass
 
 def render(self):
 return 'Content provider inheriting from Explicit'

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


[Zope-Checkins] SVN: Zope/trunk/ Avoid deprecation warnings for the md5 and sha modules in Python 2.6 by adding conditional imports for the hashlib module.

2009-01-14 Thread Hanno Schlichting
Log message for revision 94737:
  Avoid deprecation warnings for the md5 and sha modules in Python 2.6 by 
adding conditional imports for the hashlib module.
  

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  U   Zope/trunk/lib/python/AccessControl/AuthEncoding.py
  U   Zope/trunk/lib/python/Products/PythonScripts/help/ModuleAccess.stx
  U   Zope/trunk/lib/python/Shared/DC/ZRDB/DA.py
  U   Zope/trunk/lib/python/ZClasses/ZClass.py
  U   Zope/trunk/lib/python/ZServer/medusa/monitor.py
  U   Zope/trunk/lib/python/ZServer/medusa/monitor_client.py
  U   Zope/trunk/lib/python/ZServer/medusa/monitor_client_win32.py

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===
--- Zope/trunk/doc/CHANGES.txt  2009-01-14 17:28:52 UTC (rev 94736)
+++ Zope/trunk/doc/CHANGES.txt  2009-01-14 17:36:51 UTC (rev 94737)
@@ -9,6 +9,9 @@
 
 Restructuring
 
+  - Avoid deprecation warnings for the md5 and sha modules in Python 2.6
+by adding conditional imports for the hashlib module.
+
   - Replaced  imports from the 'Globals' module throughout the 
 tree with imports from the actual modules;  the 'Globals' module
 was always intended to be an area for shared data, rather than

Modified: Zope/trunk/lib/python/AccessControl/AuthEncoding.py
===
--- Zope/trunk/lib/python/AccessControl/AuthEncoding.py 2009-01-14 17:28:52 UTC 
(rev 94736)
+++ Zope/trunk/lib/python/AccessControl/AuthEncoding.py 2009-01-14 17:36:51 UTC 
(rev 94737)
@@ -13,7 +13,12 @@
 
 __version__='$Revision: 1.9 $'[11:-2]
 
-import sha, binascii
+try:
+from hashlib import sha1 as sha
+except:
+from sha import new as sha
+
+import binascii
 from binascii import b2a_base64, a2b_base64
 from random import choice, randrange
 
@@ -68,7 +73,7 @@
 def encrypt(self, pw):
 pw = str(pw)
 salt = self.generate_salt()
-return b2a_base64(sha.new(pw + salt).digest() + salt)[:-1]
+return b2a_base64(sha(pw + salt).digest() + salt)[:-1]
 
 def validate(self, reference, attempt):
 try:
@@ -77,7 +82,7 @@
 # Not valid base64.
 return 0
 salt = ref[20:]
-compare = b2a_base64(sha.new(attempt + salt).digest() + salt)[:-1]
+compare = b2a_base64(sha(attempt + salt).digest() + salt)[:-1]
 return (compare == reference)
 
 registerScheme('SSHA', SSHADigestScheme())
@@ -86,10 +91,10 @@
 class SHADigestScheme:
 
 def encrypt(self, pw):
-return b2a_base64(sha.new(pw).digest())[:-1]
+return b2a_base64(sha(pw).digest())[:-1]
 
 def validate(self, reference, attempt):
-compare = b2a_base64(sha.new(attempt).digest())[:-1]
+compare = b2a_base64(sha(attempt).digest())[:-1]
 return (compare == reference)
 
 registerScheme('SHA', SHADigestScheme())

Modified: Zope/trunk/lib/python/Products/PythonScripts/help/ModuleAccess.stx
===
--- Zope/trunk/lib/python/Products/PythonScripts/help/ModuleAccess.stx  
2009-01-14 17:28:52 UTC (rev 94736)
+++ Zope/trunk/lib/python/Products/PythonScripts/help/ModuleAccess.stx  
2009-01-14 17:36:51 UTC (rev 94737)
@@ -21,7 +21,7 @@
 
   from Products.PythonScripts.Utility import allow_module, allow_class
   from AccessControl import ModuleSecurityInfo, ClassSecurityInfo
-  from Globals import InitializeClass
+  from App.class_init import InitializeClass
 
 4. For each module to which you want to allow access, add
security declarations in '__init__.py'.

Modified: Zope/trunk/lib/python/Shared/DC/ZRDB/DA.py
===
--- Zope/trunk/lib/python/Shared/DC/ZRDB/DA.py  2009-01-14 17:28:52 UTC (rev 
94736)
+++ Zope/trunk/lib/python/Shared/DC/ZRDB/DA.py  2009-01-14 17:36:51 UTC (rev 
94737)
@@ -18,7 +18,6 @@
 from cPickle import loads
 from cStringIO import StringIO
 import marshal
-import md5
 import os
 import re
 import string
@@ -61,7 +60,6 @@
 from sqltest import SQLTest
 from sqlvar import SQLVar
 
-md5new = md5.new
 
 class DatabaseError(BadRequest):
" base class for external relational data base connection problems "

Modified: Zope/trunk/lib/python/ZClasses/ZClass.py
===
--- Zope/trunk/lib/python/ZClasses/ZClass.py2009-01-14 17:28:52 UTC (rev 
94736)
+++ Zope/trunk/lib/python/ZClasses/ZClass.py2009-01-14 17:36:51 UTC (rev 
94737)
@@ -345,9 +345,13 @@
 self._zbases=copy._zbases
 
 def _new_class_id(self):
-import md5, base64, time
+try:
+from hashlib import md5
+except:
+from md5 import new as md5
+import base64, time
 
-id=md5.new()
+id=md5()
 id.update(self.absolute_url())
 id.update(str(time.time()))
 id=id.digest()

Modified: Zope/trunk/lib/pytho

  1   2   3   4   5   6   7   8   9   10   >