[Zope-Checkins] SVN: Zope/trunk/ - Collector #2122: fixed missing is_proxying_match definition

2006-06-10 Thread Andreas Jung
Log message for revision 68564:
- Collector #2122: fixed missing is_proxying_match definition
  in ZServer/HTTPServer
  

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

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===
--- Zope/trunk/doc/CHANGES.txt  2006-06-10 13:21:05 UTC (rev 68563)
+++ Zope/trunk/doc/CHANGES.txt  2006-06-10 13:21:54 UTC (rev 68564)
@@ -24,3 +24,5 @@
 
 Bugs Fixed
 
+  - Collector #2122: fixed missing is_proxying_match definition
+in ZServer/HTTPServer

Modified: Zope/trunk/lib/python/ZServer/HTTPServer.py
===
--- Zope/trunk/lib/python/ZServer/HTTPServer.py 2006-06-10 13:21:05 UTC (rev 
68563)
+++ Zope/trunk/lib/python/ZServer/HTTPServer.py 2006-06-10 13:21:54 UTC (rev 
68564)
@@ -63,6 +63,9 @@
 CONNECTION  = re.compile('Connection: (.*)', re.I)
 USER_AGENT  = re.compile('User-Agent: (.*)', re.I)
 
+is_proxying_match = re.compile(r'[^ ]* [^ \\]*:').match
+
+
 # maps request some headers to environment variables.
 # (those that don't start with 'HTTP_')
 header2env={'content-length': 'CONTENT_LENGTH',

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


[Zope-Checkins] SVN: Zope/trunk/ - Collector #2122: fixed missing is_proxying_match definition

2006-06-10 Thread Andreas Jung
Log message for revision 68565:
- Collector #2122: fixed missing is_proxying_match definition
  in ZServer/HTTPServer
  

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  U   Zope/trunk/lib/python/Products/SiteAccess/SiteRoot.py
  A   Zope/trunk/lib/python/Products/SiteAccess/tests/testSiteRoot.py

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===
--- Zope/trunk/doc/CHANGES.txt  2006-06-10 13:21:54 UTC (rev 68564)
+++ Zope/trunk/doc/CHANGES.txt  2006-06-10 13:48:39 UTC (rev 68565)
@@ -26,3 +26,6 @@
 
   - Collector #2122: fixed missing is_proxying_match definition
 in ZServer/HTTPServer
+
+  - Collector 2077: fixed problem with ACTUAL_URL and SiteRoot
+

Modified: Zope/trunk/lib/python/Products/SiteAccess/SiteRoot.py
===
--- Zope/trunk/lib/python/Products/SiteAccess/SiteRoot.py   2006-06-10 
13:21:54 UTC (rev 68564)
+++ Zope/trunk/lib/python/Products/SiteAccess/SiteRoot.py   2006-06-10 
13:48:39 UTC (rev 68565)
@@ -117,10 +117,13 @@
 if srd[i] is None:
 srd[i] = request.environ.get(srp, None)
 if srd[0] is not None:
+request['ACTUAL_URL'] = 
request['ACTUAL_URL'].replace(request['SERVER_URL'], srd[0])
 request['SERVER_URL'] = srd[0]
 request._resetURLS()
 if srd[1] is not None:
+old = request['URL']
 request.setVirtualRoot(srd[1])
+request['ACTUAL_URL'] = request['ACTUAL_URL'].replace(old, 
request['URL'])
 
 def get_size(self):
 '''Make FTP happy'''

Added: Zope/trunk/lib/python/Products/SiteAccess/tests/testSiteRoot.py
===
--- Zope/trunk/lib/python/Products/SiteAccess/tests/testSiteRoot.py 
2006-06-10 13:21:54 UTC (rev 68564)
+++ Zope/trunk/lib/python/Products/SiteAccess/tests/testSiteRoot.py 
2006-06-10 13:48:39 UTC (rev 68565)
@@ -0,0 +1,50 @@
+SiteRoot regression tests.
+
+These tests verify that the request URL headers, in particular ACTUAL_URL, are
+set correctly when a SiteRoot is used.
+
+See http://www.zope.org/Collectors/Zope/2077
+
+
+
+from Testing.makerequest import makerequest
+
+import Zope2
+Zope2.startup()
+
+import transaction
+
+import unittest
+
+class SiteRootRegressions(unittest.TestCase):
+
+def setUp(self):
+transaction.begin()
+self.app = makerequest(Zope2.app())
+try:
+self.app.manage_addFolder('folder')
+   
self.app.folder.manage_addProduct['SiteAccess'].manage_addSiteRoot(title = 
'SiteRoot', base = 'http://test_base', path = '/test_path')
+   self.app.REQUEST.set('PARENTS', [self.app])
+   self.app.REQUEST.traverse('/folder')
+   
+except:
+self.tearDown()
+
+def tearDown(self):
+transaction.abort()
+self.app._p_jar.close()
+   
+def testRequest(self):
+self.assertEqual(self.app.REQUEST['SERVER_URL'], 'http://test_base') 
+   self.assertEqual(self.app.REQUEST['URL'], 
'http://test_base/test_path/index_html')
+   self.assertEqual(self.app.REQUEST['ACTUAL_URL'], 
'http://test_base/test_path')
+def testAbsoluteUrl(self): 
+   self.assertEqual(self.app.folder.absolute_url(), 
'http://test_base/test_path')
+
+def test_suite():
+suite = unittest.TestSuite()
+suite.addTest(unittest.makeSuite(SiteRootRegressions))
+return suite
+
+if __name__ == '__main__':
+unittest.main(defaultTest='test_suite')

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


[Zope-Checkins] SVN: Zope/branches/2.10/ - Collector 2077: fixed problem with ACTUAL_URL and SiteRoot

2006-06-10 Thread Andreas Jung
Log message for revision 68566:
- Collector 2077: fixed problem with ACTUAL_URL and SiteRoot
  
  

Changed:
  U   Zope/branches/2.10/doc/CHANGES.txt
  U   Zope/branches/2.10/lib/python/Products/SiteAccess/SiteRoot.py
  A   Zope/branches/2.10/lib/python/Products/SiteAccess/tests/testSiteRoot.py

-=-
Modified: Zope/branches/2.10/doc/CHANGES.txt
===
--- Zope/branches/2.10/doc/CHANGES.txt  2006-06-10 13:48:39 UTC (rev 68565)
+++ Zope/branches/2.10/doc/CHANGES.txt  2006-06-10 13:50:18 UTC (rev 68566)
@@ -29,7 +29,9 @@
   - Collector #2122: fixed missing is_proxying_match definition
 in ZServer/HTTPServer
 
+  - Collector 2077: fixed problem with ACTUAL_URL and SiteRoot
 
+
   Zope 2.10.0 beta 1 (2006/05/30)
 
 Restructuring

Modified: Zope/branches/2.10/lib/python/Products/SiteAccess/SiteRoot.py
===
--- Zope/branches/2.10/lib/python/Products/SiteAccess/SiteRoot.py   
2006-06-10 13:48:39 UTC (rev 68565)
+++ Zope/branches/2.10/lib/python/Products/SiteAccess/SiteRoot.py   
2006-06-10 13:50:18 UTC (rev 68566)
@@ -117,10 +117,13 @@
 if srd[i] is None:
 srd[i] = request.environ.get(srp, None)
 if srd[0] is not None:
+request['ACTUAL_URL'] = 
request['ACTUAL_URL'].replace(request['SERVER_URL'], srd[0])
 request['SERVER_URL'] = srd[0]
 request._resetURLS()
 if srd[1] is not None:
+old = request['URL']
 request.setVirtualRoot(srd[1])
+request['ACTUAL_URL'] = request['ACTUAL_URL'].replace(old, 
request['URL'])
 
 def get_size(self):
 '''Make FTP happy'''

Added: Zope/branches/2.10/lib/python/Products/SiteAccess/tests/testSiteRoot.py
===
--- Zope/branches/2.10/lib/python/Products/SiteAccess/tests/testSiteRoot.py 
2006-06-10 13:48:39 UTC (rev 68565)
+++ Zope/branches/2.10/lib/python/Products/SiteAccess/tests/testSiteRoot.py 
2006-06-10 13:50:18 UTC (rev 68566)
@@ -0,0 +1,50 @@
+SiteRoot regression tests.
+
+These tests verify that the request URL headers, in particular ACTUAL_URL, are
+set correctly when a SiteRoot is used.
+
+See http://www.zope.org/Collectors/Zope/2077
+
+
+
+from Testing.makerequest import makerequest
+
+import Zope2
+Zope2.startup()
+
+import transaction
+
+import unittest
+
+class SiteRootRegressions(unittest.TestCase):
+
+def setUp(self):
+transaction.begin()
+self.app = makerequest(Zope2.app())
+try:
+self.app.manage_addFolder('folder')
+   
self.app.folder.manage_addProduct['SiteAccess'].manage_addSiteRoot(title = 
'SiteRoot', base = 'http://test_base', path = '/test_path')
+   self.app.REQUEST.set('PARENTS', [self.app])
+   self.app.REQUEST.traverse('/folder')
+   
+except:
+self.tearDown()
+
+def tearDown(self):
+transaction.abort()
+self.app._p_jar.close()
+   
+def testRequest(self):
+self.assertEqual(self.app.REQUEST['SERVER_URL'], 'http://test_base') 
+   self.assertEqual(self.app.REQUEST['URL'], 
'http://test_base/test_path/index_html')
+   self.assertEqual(self.app.REQUEST['ACTUAL_URL'], 
'http://test_base/test_path')
+def testAbsoluteUrl(self): 
+   self.assertEqual(self.app.folder.absolute_url(), 
'http://test_base/test_path')
+
+def test_suite():
+suite = unittest.TestSuite()
+suite.addTest(unittest.makeSuite(SiteRootRegressions))
+return suite
+
+if __name__ == '__main__':
+unittest.main(defaultTest='test_suite')

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


[Zope-Checkins] SVN: Zope/branches/2.9/ - Collector 2077: fixed problem with ACTUAL_URL and SiteRoot

2006-06-10 Thread Andreas Jung
Log message for revision 68567:
  
- Collector 2077: fixed problem with ACTUAL_URL and SiteRoot
  
  

Changed:
  U   Zope/branches/2.9/doc/CHANGES.txt
  U   Zope/branches/2.9/lib/python/Products/SiteAccess/SiteRoot.py
  A   Zope/branches/2.9/lib/python/Products/SiteAccess/tests/testSiteRoot.py

-=-
Modified: Zope/branches/2.9/doc/CHANGES.txt
===
--- Zope/branches/2.9/doc/CHANGES.txt   2006-06-10 13:50:18 UTC (rev 68566)
+++ Zope/branches/2.9/doc/CHANGES.txt   2006-06-10 13:51:22 UTC (rev 68567)
@@ -23,6 +23,9 @@
   - Collector #2116: sequence.sort() did not work properly
 locale related comparison methods
 
+  - Collector 2077: fixed problem with ACTUAL_URL and SiteRoot
+
+
   Zope 2.9.3 (2006/05/13)
 
Bugs fixed

Modified: Zope/branches/2.9/lib/python/Products/SiteAccess/SiteRoot.py
===
--- Zope/branches/2.9/lib/python/Products/SiteAccess/SiteRoot.py
2006-06-10 13:50:18 UTC (rev 68566)
+++ Zope/branches/2.9/lib/python/Products/SiteAccess/SiteRoot.py
2006-06-10 13:51:22 UTC (rev 68567)
@@ -117,10 +117,13 @@
 if srd[i] is None:
 srd[i] = request.environ.get(srp, None)
 if srd[0] is not None:
+request['ACTUAL_URL'] = 
request['ACTUAL_URL'].replace(request['SERVER_URL'], srd[0])
 request['SERVER_URL'] = srd[0]
 request._resetURLS()
 if srd[1] is not None:
+old = request['URL']
 request.setVirtualRoot(srd[1])
+request['ACTUAL_URL'] = request['ACTUAL_URL'].replace(old, 
request['URL'])
 
 def get_size(self):
 '''Make FTP happy'''

Added: Zope/branches/2.9/lib/python/Products/SiteAccess/tests/testSiteRoot.py
===
--- Zope/branches/2.9/lib/python/Products/SiteAccess/tests/testSiteRoot.py  
2006-06-10 13:50:18 UTC (rev 68566)
+++ Zope/branches/2.9/lib/python/Products/SiteAccess/tests/testSiteRoot.py  
2006-06-10 13:51:22 UTC (rev 68567)
@@ -0,0 +1,50 @@
+SiteRoot regression tests.
+
+These tests verify that the request URL headers, in particular ACTUAL_URL, are
+set correctly when a SiteRoot is used.
+
+See http://www.zope.org/Collectors/Zope/2077
+
+
+
+from Testing.makerequest import makerequest
+
+import Zope2
+Zope2.startup()
+
+import transaction
+
+import unittest
+
+class SiteRootRegressions(unittest.TestCase):
+
+def setUp(self):
+transaction.begin()
+self.app = makerequest(Zope2.app())
+try:
+self.app.manage_addFolder('folder')
+   
self.app.folder.manage_addProduct['SiteAccess'].manage_addSiteRoot(title = 
'SiteRoot', base = 'http://test_base', path = '/test_path')
+   self.app.REQUEST.set('PARENTS', [self.app])
+   self.app.REQUEST.traverse('/folder')
+   
+except:
+self.tearDown()
+
+def tearDown(self):
+transaction.abort()
+self.app._p_jar.close()
+   
+def testRequest(self):
+self.assertEqual(self.app.REQUEST['SERVER_URL'], 'http://test_base') 
+   self.assertEqual(self.app.REQUEST['URL'], 
'http://test_base/test_path/index_html')
+   self.assertEqual(self.app.REQUEST['ACTUAL_URL'], 
'http://test_base/test_path')
+def testAbsoluteUrl(self): 
+   self.assertEqual(self.app.folder.absolute_url(), 
'http://test_base/test_path')
+
+def test_suite():
+suite = unittest.TestSuite()
+suite.addTest(unittest.makeSuite(SiteRootRegressions))
+return suite
+
+if __name__ == '__main__':
+unittest.main(defaultTest='test_suite')

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


[Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/ - Collector 2077: fixed problem with ACTUAL_URL and SiteRoot

2006-06-10 Thread Andreas Jung
Log message for revision 68568:
- Collector 2077: fixed problem with ACTUAL_URL and SiteRoot
  
  

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

-=-
Modified: Zope/branches/Zope-2_8-branch/doc/CHANGES.txt
===
--- Zope/branches/Zope-2_8-branch/doc/CHANGES.txt   2006-06-10 13:51:22 UTC 
(rev 68567)
+++ Zope/branches/Zope-2_8-branch/doc/CHANGES.txt   2006-06-10 13:52:14 UTC 
(rev 68568)
@@ -21,7 +21,9 @@
   - Collector #2116: sequence.sort() did not work properly
 locale related comparison methods
 
+  - Collector 2077: fixed problem with ACTUAL_URL and SiteRoot
 
+
   Zope 2.8.7 (2007/05/29)
 
 Features added:

Modified: 
Zope/branches/Zope-2_8-branch/lib/python/Products/SiteAccess/SiteRoot.py
===
--- Zope/branches/Zope-2_8-branch/lib/python/Products/SiteAccess/SiteRoot.py
2006-06-10 13:51:22 UTC (rev 68567)
+++ Zope/branches/Zope-2_8-branch/lib/python/Products/SiteAccess/SiteRoot.py
2006-06-10 13:52:14 UTC (rev 68568)
@@ -117,10 +117,13 @@
 if srd[i] is None:
 srd[i] = request.environ.get(srp, None)
 if srd[0] is not None:
+request['ACTUAL_URL'] = 
request['ACTUAL_URL'].replace(request['SERVER_URL'], srd[0])
 request['SERVER_URL'] = srd[0]
 request._resetURLS()
 if srd[1] is not None:
+old = request['URL']
 request.setVirtualRoot(srd[1])
+request['ACTUAL_URL'] = request['ACTUAL_URL'].replace(old, 
request['URL'])
 
 def get_size(self):
 '''Make FTP happy'''

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


[Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/ - Collector #2073: fixed misbehaviour of OFS.Owned.changeOwnership

2006-06-10 Thread Andreas Jung
Log message for revision 68572:
  
- Collector #2073: fixed misbehaviour of OFS.Owned.changeOwnership
  

Changed:
  U   Zope/branches/Zope-2_8-branch/doc/CHANGES.txt
  U   Zope/branches/Zope-2_8-branch/lib/python/AccessControl/Owned.py
  A   Zope/branches/Zope-2_8-branch/lib/python/AccessControl/tests/framework.py
  A   
Zope/branches/Zope-2_8-branch/lib/python/AccessControl/tests/testChownRecursive.py

-=-
Modified: Zope/branches/Zope-2_8-branch/doc/CHANGES.txt
===
--- Zope/branches/Zope-2_8-branch/doc/CHANGES.txt   2006-06-10 14:08:02 UTC 
(rev 68571)
+++ Zope/branches/Zope-2_8-branch/doc/CHANGES.txt   2006-06-10 14:09:26 UTC 
(rev 68572)
@@ -23,6 +23,7 @@
 
   - Collector 2077: fixed problem with ACTUAL_URL and SiteRoot
 
+  - Collector #2073: fixed misbehaviour of OFS.Owned.changeOwnership
 
   Zope 2.8.7 (2007/05/29)
 

Modified: Zope/branches/Zope-2_8-branch/lib/python/AccessControl/Owned.py
===
--- Zope/branches/Zope-2_8-branch/lib/python/AccessControl/Owned.py 
2006-06-10 14:08:02 UTC (rev 68571)
+++ Zope/branches/Zope-2_8-branch/lib/python/AccessControl/Owned.py 
2006-06-10 14:09:26 UTC (rev 68572)
@@ -147,8 +147,9 @@
 new=ownerInfo(user)
 if new is None: return # Special user!
 old = self.getOwnerTuple()
-if old==new: return
-if old is UnownableOwner: return
+if not recursive:
+if old==new: return
+if old is UnownableOwner: return
 
 for child in self.objectValues():
 if recursive:

Added: Zope/branches/Zope-2_8-branch/lib/python/AccessControl/tests/framework.py
===
--- Zope/branches/Zope-2_8-branch/lib/python/AccessControl/tests/framework.py   
2006-06-10 14:08:02 UTC (rev 68571)
+++ Zope/branches/Zope-2_8-branch/lib/python/AccessControl/tests/framework.py   
2006-06-10 14:09:26 UTC (rev 68572)
@@ -0,0 +1,116 @@
+##
+#
+# 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.
+#
+##
+ZopeTestCase framework
+
+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__ == '__main__':
+  framework()
+
+$Id: framework.py 37774 2005-08-07 18:07:31Z yuppie $
+
+
+__version__ = '0.2.4'
+
+# Save start state
+#
+__SOFTWARE_HOME = os.environ.get('SOFTWARE_HOME', '')
+__INSTANCE_HOME = os.environ.get('INSTANCE_HOME', '')
+
+if __SOFTWARE_HOME.endswith(os.sep):
+__SOFTWARE_HOME = os.path.dirname(__SOFTWARE_HOME)
+
+if __INSTANCE_HOME.endswith(os.sep):
+__INSTANCE_HOME = os.path.dirname(__INSTANCE_HOME)
+
+# Find and import the Testing package
+#
+if not sys.modules.has_key('Testing'):
+p0 = sys.path[0]
+if p0 and __name__ == '__main__':
+os.chdir(p0)
+p0 = ''
+s = __SOFTWARE_HOME
+p = d = s and s or os.getcwd()
+while d:
+if os.path.isdir(os.path.join(p, 'Testing')):
+zope_home = os.path.dirname(os.path.dirname(p))
+sys.path[:1] = [p0, p, zope_home]
+break
+p, d = s and ('','') or os.path.split(p)
+else:
+print 'Unable to locate Testing package.',
+print 'You might need to set SOFTWARE_HOME.'
+sys.exit(1)
+
+import Testing, unittest
+execfile(os.path.join(os.path.dirname(Testing.__file__), 'common.py'))
+
+# Include ZopeTestCase support
+#
+if 1:   # Create a new scope
+
+p = 

[Zope-Checkins] SVN: Products.Five/branches/philikon-viewzpt-refactor/ Branch for some work on ViewZPTs

2006-06-10 Thread Philipp von Weitershausen
Log message for revision 68573:
  Branch for some work on ViewZPTs
  

Changed:
  A   Products.Five/branches/philikon-viewzpt-refactor/

-=-
Copied: Products.Five/branches/philikon-viewzpt-refactor (from rev 68572, 
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-viewzpt-refactor/browser/pagetemplatefile.py Attempt at simplifying ZopeTwoPageTemplate. The code doesn't look *that*

2006-06-10 Thread Philipp von Weitershausen
Log message for revision 68574:
  Attempt at simplifying ZopeTwoPageTemplate. The code doesn't look *that*
  much simpler in the end :(.
  

Changed:
  U   
Products.Five/branches/philikon-viewzpt-refactor/browser/pagetemplatefile.py

-=-
Modified: 
Products.Five/branches/philikon-viewzpt-refactor/browser/pagetemplatefile.py
===
--- 
Products.Five/branches/philikon-viewzpt-refactor/browser/pagetemplatefile.py
2006-06-10 18:46:54 UTC (rev 68573)
+++ 
Products.Five/branches/philikon-viewzpt-refactor/browser/pagetemplatefile.py
2006-06-10 18:48:37 UTC (rev 68574)
@@ -15,80 +15,67 @@
 
 $Id$
 
-import os, sys
-
-from Globals import package_home
-from Products.PageTemplates.PageTemplateFile import PageTemplateFile
+import AccessControl.Owned
+from Acquisition import aq_inner, aq_acquire
+from DocumentTemplate.DT_Util import TemplateDict
+from Shared.DC.Scripts.Bindings import Bindings
 from Products.PageTemplates.Expressions import SecureModuleImporter
 from Products.PageTemplates.Expressions import createTrustedZopeEngine
+from zope.app.pagetemplate import viewpagetemplatefile
 
-from zope.app.pagetemplate.viewpagetemplatefile import ViewMapper
-from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile
-
 _engine = createTrustedZopeEngine()
 def getEngine():
 return _engine
 
-class ZopeTwoPageTemplateFile(PageTemplateFile):
-A strange hybrid between Zope 2 and Zope 3 page template.
+class ViewPageTemplateFile(Bindings, AccessControl.Owned.Owned,
+   viewpagetemplatefile.ViewPageTemplateFile):
 
-Uses Zope 2's engine, but with security disabled and with some
-initialization and API from Zope 3.
-
+_default_bindings = {'name_subpath': 'traverse_subpath'}
+_Bindings_ns_class = TemplateDict
 
 def __init__(self, filename, _prefix=None, content_type=None):
-# XXX doesn't use content_type yet
-
 self.ZBindings_edit(self._default_bindings)
+_prefix = self.get_path_from_prefix(_prefix)
+super(ViewPageTemplateFile, self).__init__(
+filename, _prefix, content_type)
 
-path = self.get_path_from_prefix(_prefix)
-self.filename = os.path.join(path, filename)
-if not os.path.isfile(self.filename):
-raise ValueError(No such file, self.filename)
-
-basepath, ext = os.path.splitext(self.filename)
-self.__name__ = os.path.basename(basepath)
-
-super(PageTemplateFile, self).__init__(self.filename, _prefix)
-
-def get_path_from_prefix(self, _prefix):
-if isinstance(_prefix, str):
-path = _prefix
-else:
-if _prefix is None:
-_prefix = sys._getframe(2).f_globals
-path = package_home(_prefix)
-return path
-
 def pt_getEngine(self):
 return getEngine()
 
-def pt_getContext(self):
+def pt_getContext(self, instance, request, **kw):
+namespace = super(ViewPageTemplateFile, self).pt_getContext(
+instance, request, **kw)
+bound_names = namespace['options'].pop('bound_names')
+namespace.update(bound_names)
+
+context = aq_inner(instance.context)
 try:
-root = self.getPhysicalRoot()
+root = aq_acquire(context, 'getPhysicalRoot')()
 except AttributeError:
-root = self.context.getPhysicalRoot()
-# Even if the context isn't a view (when would that be exaclty?),
-# there shouldn't be any dange in applying a view, because it
-# won't be used.  However assuming that a lack of getPhysicalRoot
-# implies a missing view causes problems.
-view = self._getContext()
+raise
+# we can't access the root, probably because 'context' is
+# something that doesn't support Acquisition.  You lose.
+root = None
+namespace.update({
+'context': context,
+'here': context,
+'container': context,
+'root': root,
+'user': AccessControl.getSecurityManager().getUser(),
+'modules': SecureModuleImporter,
+})
+return namespace
 
-here = self.context.aq_inner
+# this will be called by Bindings.__call__
+def _exec(self, bound_names, args, kw):
+kw['bound_names'] = bound_names
+return viewpagetemplatefile.ViewPageTemplateFile.__call__(
+self, *args, **kw)
 
-request = getattr(root, 'REQUEST', None)
-c = {'template': self,
- 'here': here,
- 'context': here,
- 'container': here,
- 'nothing': None,
- 'options': {},
- 'root': root,
- 'request': request,
- 'modules': SecureModuleImporter,
- }
-if view is not None:
-c['view'] = view
-c['views'] 

[Zope-Checkins] SVN: Products.Five/branches/philikon-viewzpt-refactor/browser/tests/template_variables.pt Don't use template.aq_base (the template isn't acquisitionish anymore)

2006-06-10 Thread Philipp von Weitershausen
Log message for revision 68575:
  Don't use template.aq_base (the template isn't acquisitionish anymore)
  and adjust accordign to new class name
  

Changed:
  U   
Products.Five/branches/philikon-viewzpt-refactor/browser/tests/template_variables.pt

-=-
Modified: 
Products.Five/branches/philikon-viewzpt-refactor/browser/tests/template_variables.pt
===
--- 
Products.Five/branches/philikon-viewzpt-refactor/browser/tests/template_variables.pt
2006-06-10 18:48:37 UTC (rev 68574)
+++ 
Products.Five/branches/philikon-viewzpt-refactor/browser/tests/template_variables.pt
2006-06-10 18:49:37 UTC (rev 68575)
@@ -10,7 +10,7 @@
 Root is the application: tal:block 
   replace=python:repr(root).find('Application') != -1 /
 Template is a template: tal:block 
-  
replace=python:repr(template.aq_base).startswith('ZopeTwoPageTemplateFile') 
/
+  replace=python:'ViewPageTemplateFile object' in repr(template) /
 Traverse_subpath exists and is empty: tal:block 
   replace=python:traverse_subpath == [] /
 Request is a request: tal:block 

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


[Zope-Checkins] SVN: Products.Five/branches/philikon-viewzpt-refactor/viewlet/directives.txt ViewPTF isn't a simpleitem anymore, so no meta_type

2006-06-10 Thread Philipp von Weitershausen
Log message for revision 68576:
  ViewPTF isn't a simpleitem anymore, so no meta_type
  

Changed:
  U   Products.Five/branches/philikon-viewzpt-refactor/viewlet/directives.txt

-=-
Modified: 
Products.Five/branches/philikon-viewzpt-refactor/viewlet/directives.txt
===
--- Products.Five/branches/philikon-viewzpt-refactor/viewlet/directives.txt 
2006-06-10 18:49:37 UTC (rev 68575)
+++ Products.Five/branches/philikon-viewzpt-refactor/viewlet/directives.txt 
2006-06-10 18:50:36 UTC (rev 68576)
@@ -130,8 +130,8 @@
   Products.Five.viewlet.manager.ViewletManager providing ILeftColumn object 
...
ILeftColumn.providedBy(manager)
   True
-   manager.template.meta_type
-  'Page Template (File)'
+   manager.template
+  BoundPageTemplateFile of Products.Five.viewlet.manager.ViewletManager 
providing ILeftColumn object at ...
manager.update()
print manager.render().strip()
   div class=column
@@ -164,8 +164,8 @@
class 'Products.Five.viewlet.manager.ViewletManagerBase')
ILeftColumn.providedBy(manager)
   True
-   manager.template.meta_type
-  'Page Template (File)'
+   manager.template
+  BoundPageTemplateFile of Products.Five.viewlet.manager.ViewletManager 
providing ILeftColumn object at ...
manager.update()
print manager.render().strip()
   div class=column

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


[Zope-Checkins] SVN: Products.Five/trunk/ * Added Five.browser.pagetemplatefile.ViewPageTemplateFile as an alias

2006-06-10 Thread Philipp von Weitershausen
Log message for revision 68579:
  * Added Five.browser.pagetemplatefile.ViewPageTemplateFile as an alias
to ZopeTwoPageTemplateFile and as a Zope 2 correspondence to
zope.app.pagetemplate.ViewPageTemplateFile.
  
  

Changed:
  U   Products.Five/trunk/CHANGES.txt
  U   Products.Five/trunk/browser/pagetemplatefile.py

-=-
Modified: Products.Five/trunk/CHANGES.txt
===
--- Products.Five/trunk/CHANGES.txt 2006-06-10 22:47:34 UTC (rev 68578)
+++ Products.Five/trunk/CHANGES.txt 2006-06-10 23:13:52 UTC (rev 68579)
@@ -2,6 +2,13 @@
 Five Changes
 
 
+Five 1.5 (unreleased)
+=
+
+* Added Five.browser.pagetemplatefile.ViewPageTemplateFile as an alias
+  to ZopeTwoPageTemplateFile and as a Zope 2 correspondence to
+  zope.app.pagetemplate.ViewPageTemplateFile.
+
 Five 1.5c (2006-05-29)
 ==
 

Modified: Products.Five/trunk/browser/pagetemplatefile.py
===
--- Products.Five/trunk/browser/pagetemplatefile.py 2006-06-10 22:47:34 UTC 
(rev 68578)
+++ Products.Five/trunk/browser/pagetemplatefile.py 2006-06-10 23:13:52 UTC 
(rev 68579)
@@ -21,9 +21,7 @@
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 from Products.PageTemplates.Expressions import SecureModuleImporter
 from Products.PageTemplates.Expressions import createTrustedZopeEngine
-
 from zope.app.pagetemplate.viewpagetemplatefile import ViewMapper
-from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile
 
 _engine = createTrustedZopeEngine()
 def getEngine():
@@ -92,3 +90,5 @@
 c['views'] = ViewMapper(here, request)
 
 return c
+
+ViewPageTemplateFile = ZopeTwoPageTemplateFile

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


[ZWeb] newbie

2006-06-10 Thread Chuzo Okuda
I am a newbie on zope and python on window xp that I
just downloaded.

First, I wanted to learn Zope Tutorial, but I do not
understand where I can locate Select type to add...
list in the following steps to follow as I cannot find
where is such list in the html window.

First you need to create a Page Template for the home
page. Zope uses Page Templates for web pages.

   1. Select Page Template from the Select type to
add... list.

Thank you very much in advance.



__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
___
Zope-web maillist  -  Zope-web@zope.org
http://mail.zope.org/mailman/listinfo/zope-web


Re: [Zope] prefix attribute in dtml-in

2006-06-10 Thread Gabriel Genellina

At Thursday 8/6/2006 22:12, you wrote:


Error Type: NameError
Error Value: name 'topic_var_fulltitle' is not defined

I accidentally put 'sequence_var_fulltitle' in the example code below,
I'm actually using 'topic_var_fulltitle'


That should work, given that getConsulting() returns a result with a 
column named var_fulltitle.
You can use names to see the actual column names: dtml-var 
expr=getConsulting().names

(or perhaps it is .names(), this code is untested)



Gabriel Genellina
Softlab SRL 






___ 
1GB gratis, Antivirus y Antispam 
Correo Yahoo!, el mejor correo web del mundo 
http://correo.yahoo.com.ar 


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

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


Re: [Zope-DB] A web based rewards management system for [EMAIL PROTECTED]

2006-06-10 Thread Philip Kilner
Hi Bob,

Since this is somewhat off topic for this list, I have replied to Philip
directly, cc'ing yourself.

Bottom line: Implementing something like this with Plone and some RDBMS
integration should be relatively simple. For my own part, I think that
the RDBMS route has advantages over a pure Plone route (hey, that's
why I'm on this list!), but it's important to acknowledge that others
would disagree.


-- 

Regards,

PhilK

Human language continually changes, innit.
- Stephen Juan
___
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db