[Zope-Checkins] SVN: Products.Five/branches/easter-sprint_traversal-refactor/ This branch isn't needed the fix is on the trunk.
Log message for revision 67609: This branch isn't needed the fix is on the trunk. Changed: D Products.Five/branches/easter-sprint_traversal-refactor/ -=- ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/easter-sprint_traversal-refactor/lib/python/Products/ Use the trunk version of Five for now, since contains
Log message for revision 67608: Use the trunk version of Five for now, since contains a fix for traverse views. Changed: _U Zope/branches/easter-sprint_traversal-refactor/lib/python/Products/ -=- Property changes on: Zope/branches/easter-sprint_traversal-refactor/lib/python/Products ___ Name: svn:externals - Five svn://svn.zope.org/repos/main/Products.Five/tags/1.3.3 + Five svn://svn.zope.org/repos/main/Products.Five/trunk ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Products.Five/trunk/browser/metaconfigure.py I have fixed this bug 3 times in has many minutes, and just realised
Log message for revision 67607: I have fixed this bug 3 times in has many minutes, and just realised this fix should go on the trunk, has we are just going to get a nameerror if either the publishTraverse methods are called, since zapi hasn't been imported. Changed: U Products.Five/trunk/browser/metaconfigure.py -=- Modified: Products.Five/trunk/browser/metaconfigure.py === --- Products.Five/trunk/browser/metaconfigure.py2006-04-25 19:38:26 UTC (rev 67606) +++ Products.Five/trunk/browser/metaconfigure.py2006-04-25 19:42:27 UTC (rev 67607) @@ -20,6 +20,7 @@ """ import os +from zope import component from zope.interface import Interface from zope.configuration.exceptions import ConfigurationError from zope.publisher.interfaces.browser import IBrowserRequest, \ @@ -192,11 +193,12 @@ if name in pages: return getattr(self, pages[name]) -view = zapi.queryView(self, name, request) +view = component.queryMultiAdapter((self, request), name = name, + default = None) if view is not None: -return view +return view.__of__(self) -m = class_.publishTraverse.__get__(self) +m = class_.publishTraverse.__get__(self).__of__(self) return m(request, name) else: @@ -205,9 +207,10 @@ if name in pages: return getattr(self, pages[name]) -view = zapi.queryView(self, name, request) +view = component.queryMultiAdapter((self, request), name = name, + default = None) if view is not None: -return view +return view.__of__(self) raise NotFoundError(self, name, request) ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Products.Five/branches/easter-sprint_traversal-refactor/browser/metaconfigure.py use queryMultiAdapter instead of queryView and do that __of__(parent)
Log message for revision 67605: use queryMultiAdapter instead of queryView and do that __of__(parent) acquisition stuff in order for security to work correctly in Zope2. Changed: U Products.Five/branches/easter-sprint_traversal-refactor/browser/metaconfigure.py -=- Modified: Products.Five/branches/easter-sprint_traversal-refactor/browser/metaconfigure.py === --- Products.Five/branches/easter-sprint_traversal-refactor/browser/metaconfigure.py 2006-04-25 19:26:25 UTC (rev 67604) +++ Products.Five/branches/easter-sprint_traversal-refactor/browser/metaconfigure.py 2006-04-25 19:33:52 UTC (rev 67605) @@ -20,6 +20,7 @@ """ import os +from zope import component from zope.interface import Interface from zope.configuration.exceptions import ConfigurationError from zope.publisher.interfaces.browser import IBrowserRequest, \ @@ -192,11 +193,12 @@ if name in pages: return getattr(self, pages[name]) -view = zapi.queryView(self, name, request) +view = component.queryMultiAdapter((self, request), name = name, + default = None) if view is not None: -return view +return view.__of__(self) -m = class_.publishTraverse.__get__(self) +m = class_.publishTraverse.__get__(self).__of__(self) return m(request, name) else: @@ -205,9 +207,10 @@ if name in pages: return getattr(self, pages[name]) -view = zapi.queryView(self, name, request) +view = component.queryMultiAdapter((self, request), name = name, + default = None) if view is not None: -return view +return view.__of__(self) raise NotFoundError(self, name, request) ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Products.Five/branches/easter-sprint_traversal-refactor/ create another Five branch to get Zope easter-sprint_traversal-refactor
Log message for revision 67604: create another Five branch to get Zope easter-sprint_traversal-refactor branch working. Changed: A Products.Five/branches/easter-sprint_traversal-refactor/ -=- Copied: Products.Five/branches/easter-sprint_traversal-refactor (from rev 67603, Products.Five/trunk) ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Products.Five/branches/publication-refactor2/browser/metaconfigure.py use zope.component instead of zope.app.zapi.
Log message for revision 67603: use zope.component instead of zope.app.zapi. Changed: U Products.Five/branches/publication-refactor2/browser/metaconfigure.py -=- Modified: Products.Five/branches/publication-refactor2/browser/metaconfigure.py === --- Products.Five/branches/publication-refactor2/browser/metaconfigure.py 2006-04-25 18:51:30 UTC (rev 67602) +++ Products.Five/branches/publication-refactor2/browser/metaconfigure.py 2006-04-25 19:10:08 UTC (rev 67603) @@ -20,7 +20,7 @@ """ import os -from zope.app import zapi +from zope import component from zope.interface import Interface from zope.configuration.exceptions import ConfigurationError from zope.publisher.interfaces.browser import IBrowserRequest, \ @@ -193,7 +193,8 @@ if name in pages: return getattr(self, pages[name]) -view = zapi.queryView(self, name, request) +view = component.queryMultiAdapter((self, request), name, + default = None) if view is not None: return view.__of__(self) @@ -206,7 +207,8 @@ if name in pages: return getattr(self, pages[name]) -view = zapi.queryView(self, name, request) +view = component.queryMultiAdapter((self, request), name, + default = None) if view is not None: return view.__of__(self) ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/easter-sprint_traversal-refactor/lib/python/ZPublisher/BaseRequest.py Now using an adapter. Two tests fail in Five, and I don't know why.
Log message for revision 67602: Now using an adapter. Two tests fail in Five, and I don't know why. Changed: U Zope/branches/easter-sprint_traversal-refactor/lib/python/ZPublisher/BaseRequest.py -=- Modified: Zope/branches/easter-sprint_traversal-refactor/lib/python/ZPublisher/BaseRequest.py === --- Zope/branches/easter-sprint_traversal-refactor/lib/python/ZPublisher/BaseRequest.py 2006-04-25 18:50:23 UTC (rev 67601) +++ Zope/branches/easter-sprint_traversal-refactor/lib/python/ZPublisher/BaseRequest.py 2006-04-25 18:51:30 UTC (rev 67602) @@ -18,8 +18,15 @@ import xmlrpc from zExceptions import Forbidden, Unauthorized +from zope.interface import implements +from zope.component import queryMultiAdapter from zope.event import notify from zope.app.publication.interfaces import EndRequestEvent +from zope.publisher.interfaces import IPublishTraverse +from zope.publisher.interfaces import NotFound +from zope.app.traversing.interfaces import TraversalError +from zope.app.traversing.namespace import nsParse +from zope.app.traversing.namespace import namespaceLookup UNSPECIFIED_ROLES='' @@ -45,7 +52,60 @@ def getRoles(container, name, value, default): return getattr(value, '__roles__', default) +class DefaultPublishTraverse(object): +implements(IPublishTraverse) + +def __init__(self, context, request): +self.context = context +self.request = request + +def publishTraverse(self, name): +object = self.context +URL=self.request['URL'] + +if name[:1]=='_': +raise Forbidden("Object name begins with an underscore at: %s" % URL) + +if hasattr(object,'__bobo_traverse__'): +subobject=object.__bobo_traverse__(self.request, name) +if type(subobject) is type(()) and len(subobject) > 1: +# Add additional parents into the path +parents[-1:] = list(subobject[:-1]) +object, subobject = subobject[-2:] +else: +try: +subobject=getattr(object, name) +except AttributeError: +subobject=object[name] + +# Ensure that the object has a docstring, or that the parent +# object has a pseudo-docstring for the object. Objects that +# have an empty or missing docstring are not published. +doc = getattr(subobject, '__doc__', None) +if doc is None: +doc = getattr(object, '%s__doc__' % name, None) +if not doc: +raise Forbidden( +"The object at %s has an empty or missing " \ +"docstring. Objects must have a docstring to be " \ +"published." % URL +) + +# Hack for security: in Python 2.2.2, most built-in types +# gained docstrings that they didn't have before. That caused +# certain mutable types (dicts, lists) to become publishable +# when they shouldn't be. The following check makes sure that +# the right thing happens in both 2.2.2+ and earlier versions. + +if not typeCheck(subobject): +raise Forbidden( +"The object at %s is not publishable." % URL +) + +return subobject + + _marker=[] class BaseRequest: """Provide basic ZPublisher request management @@ -184,50 +244,38 @@ __repr__=__str__ -def traverseName(self, object, entry_name): -URL=self['URL'] -if entry_name[:1]=='_': -raise Forbidden("Object name begins with an underscore at: %s" % URL) +def traverseName(self, ob, name): +nm = name # the name to look up the object with -if hasattr(object,'__bobo_traverse__'): -subobject=object.__bobo_traverse__(self,entry_name) -if type(subobject) is type(()) and len(subobject) > 1: -# Add additional parents into the path -parents[-1:] = list(subobject[:-1]) -object, subobject = subobject[-2:] +if name and name[:1] in '@+': +# Process URI segment parameters. +ns, nm = nsParse(name) +if ns: +try: +ob2 = namespaceLookup(ns, nm, ob, self) +except TraversalError: +raise NotFound(ob, name) + +return ob2.__of__(ob) + +if nm == '.': +return ob + +if IPublishTraverse.providedBy(ob): +ob2 = ob.publishTraverse(self, nm) else: -try: -subobject=getattr(object, entry_name) -except AttributeError: -subobject=object[entry_name] +# self is marker +adapter = queryMultiAdapter((ob, self), IPublishTraverse) +if adapter is None: +## Zope2 doesn't set up its own adapters in a lot of cases +
[Zope-Checkins] SVN: Products.Five/branches/philikon-local-components/form/metaconfigure.py use new registration API
Log message for revision 67592: use new registration API Changed: U Products.Five/branches/philikon-local-components/form/metaconfigure.py -=- Modified: Products.Five/branches/philikon-local-components/form/metaconfigure.py === --- Products.Five/branches/philikon-local-components/form/metaconfigure.py 2006-04-25 10:02:07 UTC (rev 67591) +++ Products.Five/branches/philikon-local-components/form/metaconfigure.py 2006-04-25 10:10:07 UTC (rev 67592) @@ -55,7 +55,7 @@ layer = IDefaultBrowserLayer s = zope.component.getGlobalSiteManager() -s.provideAdapter((for_, layer), Interface, name, class_) +s.registerAdapter(class_, (for_, layer), Interface, name) # Reminder: the permission we got has already been processed by # BaseFormDirective, that means that zope.Public has been @@ -118,7 +118,7 @@ layer = IDefaultBrowserLayer s = zope.component.getGlobalSiteManager() -s.provideAdapter((for_, layer), Interface, name, class_) +s.registerAdapter(class_, (for_, layer), Interface, name) # Reminder: the permission we got has already been processed by # BaseFormDirective, that means that zope.Public has been ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Products.Five/branches/philikon-local-components/browser/configure.zcml zope.app.traversing -> zope.traversing
Log message for revision 67591: zope.app.traversing -> zope.traversing Changed: U Products.Five/branches/philikon-local-components/browser/configure.zcml -=- Modified: Products.Five/branches/philikon-local-components/browser/configure.zcml === --- Products.Five/branches/philikon-local-components/browser/configure.zcml 2006-04-25 10:00:51 UTC (rev 67590) +++ Products.Five/branches/philikon-local-components/browser/configure.zcml 2006-04-25 10:02:07 UTC (rev 67591) @@ -28,7 +28,7 @@ /> http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Products.Five/branches/philikon-local-components/site/tests/test_localsite.py give stub site manager a __bases__ argument which is required in Zope 3.3 (jim-adapter
Log message for revision 67590: give stub site manager a __bases__ argument which is required in Zope 3.3 (jim-adapter branch) Changed: U Products.Five/branches/philikon-local-components/site/tests/test_localsite.py -=- Modified: Products.Five/branches/philikon-local-components/site/tests/test_localsite.py === --- Products.Five/branches/philikon-local-components/site/tests/test_localsite.py 2006-04-25 09:57:35 UTC (rev 67589) +++ Products.Five/branches/philikon-local-components/site/tests/test_localsite.py 2006-04-25 10:00:51 UTC (rev 67590) @@ -41,6 +41,13 @@ class SiteManager(Implicit): zope.interface.implements(IComponentLookup) +@property +def __bases__(self): +next = getattr(self, 'next', None) +if next is None: +return () +return (next,) + class Folder(ObjectManager): def setSiteManager(self, sm): ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Products.Five/branches/philikon-local-components/site/localsite.py give site manager a __bases__ argument which is required in Zope 3.3 (jim-adapter
Log message for revision 67589: give site manager a __bases__ argument which is required in Zope 3.3 (jim-adapter branch) Changed: U Products.Five/branches/philikon-local-components/site/localsite.py -=- Modified: Products.Five/branches/philikon-local-components/site/localsite.py === --- Products.Five/branches/philikon-local-components/site/localsite.py 2006-04-25 09:52:03 UTC (rev 67588) +++ Products.Five/branches/philikon-local-components/site/localsite.py 2006-04-25 09:57:35 UTC (rev 67589) @@ -31,6 +31,13 @@ self.context = self.__parent__ = context @property +def __bases__(self): +next = self.next +if next is None: +return () +return (next,) + +@property def next(self): obj = self.context while obj is not None: ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Products.Five/branches/philikon-local-components/browser/tests/skin. Test skins the new way
Log message for revision 67587: Test skins the new way Changed: A Products.Five/branches/philikon-local-components/browser/tests/skin.py U Products.Five/branches/philikon-local-components/browser/tests/skin.zcml -=- Added: Products.Five/branches/philikon-local-components/browser/tests/skin.py === --- Products.Five/branches/philikon-local-components/browser/tests/skin.py 2006-04-25 09:13:03 UTC (rev 67586) +++ Products.Five/branches/philikon-local-components/browser/tests/skin.py 2006-04-25 09:19:37 UTC (rev 67587) @@ -0,0 +1,21 @@ +## +# +# Copyright (c) 2006 Zope Corporation and Contributors. +# All Rights Reserved. +# +# This software is subject to the provisions of the Zope Public License, +# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +# FOR A PARTICULAR PURPOSE. +# +## +"""Test skins + +$Id$ +""" +from zope.publisher.interfaces.browser import IDefaultBrowserLayer + +class ITestSkin(IDefaultBrowserLayer): +pass Property changes on: Products.Five/branches/philikon-local-components/browser/tests/skin.py ___ Name: svn:keywords + Id Name: svn:eol-style + native Modified: Products.Five/branches/philikon-local-components/browser/tests/skin.zcml === --- Products.Five/branches/philikon-local-components/browser/tests/skin.zcml 2006-04-25 09:13:03 UTC (rev 67586) +++ Products.Five/branches/philikon-local-components/browser/tests/skin.zcml 2006-04-25 09:19:37 UTC (rev 67587) @@ -5,11 +5,10 @@ - - - ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Products.Five/branches/philikon-local-components/site/ mport ComponentLookupError from righ tplace
Log message for revision 67586: mport ComponentLookupError from righ tplace Changed: U Products.Five/branches/philikon-local-components/site/localsite.py U Products.Five/branches/philikon-local-components/site/tests/test_utility.py U Products.Five/branches/philikon-local-components/site/utility.py -=- Modified: Products.Five/branches/philikon-local-components/site/localsite.py === --- Products.Five/branches/philikon-local-components/site/localsite.py 2006-04-25 09:11:08 UTC (rev 67585) +++ Products.Five/branches/philikon-local-components/site/localsite.py 2006-04-25 09:13:03 UTC (rev 67586) @@ -17,7 +17,7 @@ """ from zope.interface import implements from zope.component import getGlobalSiteManager -from zope.component.exceptions import ComponentLookupError +from zope.component.interfaces import ComponentLookupError from zope.app.component.interfaces import ISite, IPossibleSite from Acquisition import aq_parent, aq_inner from Products.Five.site.interfaces import IFiveSiteManager, IFiveUtilityRegistry Modified: Products.Five/branches/philikon-local-components/site/tests/test_utility.py === --- Products.Five/branches/philikon-local-components/site/tests/test_utility.py 2006-04-25 09:11:08 UTC (rev 67585) +++ Products.Five/branches/philikon-local-components/site/tests/test_utility.py 2006-04-25 09:13:03 UTC (rev 67586) @@ -26,7 +26,7 @@ from zope.interface import directlyProvides from zope.component import provideUtility -from zope.component.exceptions import ComponentLookupError +from zope.component.interfaces import ComponentLookupError from zope.app import zapi from zope.app.testing.placelesssetup import setUp, tearDown from zope.app.component import getNextUtility Modified: Products.Five/branches/philikon-local-components/site/utility.py === --- Products.Five/branches/philikon-local-components/site/utility.py 2006-04-25 09:11:08 UTC (rev 67585) +++ Products.Five/branches/philikon-local-components/site/utility.py 2006-04-25 09:13:03 UTC (rev 67586) @@ -17,7 +17,7 @@ """ from zope.interface import implements from zope.component import getGlobalSiteManager -from zope.component.exceptions import ComponentLookupError +from zope.component.interfaces import ComponentLookupError from zope.app.component import getNextSiteManager from Acquisition import aq_base ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins
[Zope-Checkins] SVN: Zope/branches/philikon-local-components/lib/python/zope/ added viewlet and contentprovider external that were added on 2.9/trunk recently
Log message for revision 67585: added viewlet and contentprovider external that were added on 2.9/trunk recently Changed: _U Zope/branches/philikon-local-components/lib/python/zope/ -=- Property changes on: Zope/branches/philikon-local-components/lib/python/zope ___ Name: svn:externals - app svn://svn.zope.org/repos/main/Zope3/branches/jim-adapter/src/zope/app cachedescriptors -r 41215 svn://svn.zope.org/repos/main/Zope3/trunk/src/zope/cachedescriptors component svn://svn.zope.org/repos/main/Zope3/branches/jim-adapter/src/zope/component configuration-r 41215 svn://svn.zope.org/repos/main/Zope3/trunk/src/zope/configuration documenttemplate -r 41215 svn://svn.zope.org/repos/main/Zope3/trunk/src/zope/documenttemplate event-r 41215 svn://svn.zope.org/repos/main/Zope3/trunk/src/zope/event exceptions svn://svn.zope.org/repos/main/Zope3/branches/jim-adapter/src/zope/exceptions hookable -r 41215 svn://svn.zope.org/repos/main/Zope3/trunk/src/zope/hookable i18n svn://svn.zope.org/repos/main/Zope3/branches/jim-adapter/src/zope/i18n i18nmessageid svn://svn.zope.org/repos/main/Zope3/branches/jim-adapter/src/zope/i18nmessageid interface svn://svn.zope.org/repos/main/Zope3/branches/jim-adapter/src/zope/interface modulealias -r 41215 svn://svn.zope.org/repos/main/Zope3/trunk/src/zope/modulealias pagetemplate -r 41215 svn://svn.zope.org/repos/main/Zope3/trunk/src/zope/pagetemplate proxy svn://svn.zope.org/repos/main/Zope3/branches/jim-adapter/src/zope/proxy publisher svn://svn.zope.org/repos/main/Zope3/branches/jim-adapter/src/zope/publisher schema svn://svn.zope.org/repos/main/Zope3/branches/jim-adapter/src/zope/schema security svn://svn.zope.org/repos/main/Zope3/branches/jim-adapter/src/zope/security server -r 41215 svn://svn.zope.org/repos/main/Zope3/trunk/src/zope/server structuredtext -r 41215 svn://svn.zope.org/repos/main/Zope3/trunk/src/zope/structuredtext tal svn://svn.zope.org/repos/main/Zope3/branches/jim-adapter/src/zope/tal tales-r 41215 svn://svn.zope.org/repos/main/Zope3/trunk/src/zope/tales testing -r 40941 svn://svn.zope.org/repos/main/zope.testing/trunk/src/zope/testing thread -r 41215 svn://svn.zope.org/repos/main/Zope3/trunk/src/zope/thread deprecation svn://svn.zope.org/repos/main/Zope3/branches/jim-adapter/src/zope/deprecation dottedname -r 41215 svn://svn.zope.org/repos/main/Zope3/trunk/src/zope/dottedname formlib svn://svn.zope.org/repos/main/Zope3/branches/jim-adapter/src/zope/formlib index-r 41215 svn://svn.zope.org/repos/main/Zope3/trunk/src/zope/index testbrowser -r 41215 svn://svn.zope.org/repos/main/Zope3/trunk/src/zope/testbrowser annotation svn://svn.zope.org/repos/main/Zope3/branches/jim-adapter/src/zope/annotation contenttype svn://svn.zope.org/repos/main/Zope3/branches/jim-adapter/src/zope/contenttype copypastemove svn://svn.zope.org/repos/main/Zope3/branches/jim-adapter/src/zope/copypastemove datetime svn://svn.zope.org/repos/main/Zope3/branches/jim-adapter/src/zope/datetime decorator svn://svn.zope.org/repos/main/Zope3/branches/jim-adapter/src/zope/decorator deferredimport svn://svn.zope.org/repos/main/Zope3/branches/jim-adapter/src/zope/deferredimport dublincore svn://svn.zope.org/repos/main/Zope3/branches/jim-adapter/src/zope/dublincore filerepresentation svn://svn.zope.org/repos/main/Zope3/branches/jim-adapter/src/zope/filerepresentation lifecycleevent svn://svn.zope.org/repos/main/Zope3/branches/jim-adapter/src/zope/lifecycleevent location svn://svn.zope.org/repos/main/Zope3/branches/jim-adapter/src/zope/location rdb svn://svn.zope.org/repos/main/Zope3/branches/jim-adapter/src/zope/rdb sendmail svn://svn.zope.org/repos/main/Zope3/branches/jim-adapter/src/zope/sendmail size svn://svn.zope.org/repos/main/Zope3/branches/jim-adapter/src/zope/size traversing svn://svn.zope.org/repos/main/Zope3/branches/jim-adapter/src/zope/traversing + app svn://svn.zope.org/repos/main/Zope3/branches/jim-adapter/src/zope/app cachedescriptors -r 41215 svn://svn.zope.org/repos/main/Zope3/trunk/src/zope/cachedescriptors component svn://svn.zope.org/repos/main/Zope3/branches/jim-adapter/src/zope/component configuration-r 41215 svn://svn.zope.org/repos/main/Zope3/trunk/src/zope/configuration documenttemplate -r 41215 svn://svn.zope.org/repos/main/Zope3/trunk/src/zope/documenttemplate event-r 41215 svn://svn.zope.org/repos/main/Zope3/trunk/src/zope/event exceptions svn://svn.zope.org/repos/main/Zope3/branches/jim-adapter/src/zope/exceptions hookable -r 41215 svn://svn.zope.org/repos/main/Zope3/trunk/src/zope/hookable i18n svn://
[Zope-Checkins] SVN: Products.Five/branches/philikon-local-components/component/ get rid of zpt customization prototype. it won't be ready in time for Five 1.5/Zope2.10
Log message for revision 67584: get rid of zpt customization prototype. it won't be ready in time for Five 1.5/Zope2.10 Changed: U Products.Five/branches/philikon-local-components/component/browser.py U Products.Five/branches/philikon-local-components/component/component.txt U Products.Five/branches/philikon-local-components/component/components.pt U Products.Five/branches/philikon-local-components/component/configure.zcml D Products.Five/branches/philikon-local-components/component/customizezpt.pt U Products.Five/branches/philikon-local-components/component/tests.py D Products.Five/branches/philikon-local-components/component/zpt.py D Products.Five/branches/philikon-local-components/component/zpt.txt D Products.Five/branches/philikon-local-components/component/zptviews.pt -=- Modified: Products.Five/branches/philikon-local-components/component/browser.py === --- Products.Five/branches/philikon-local-components/component/browser.py 2006-04-25 08:46:29 UTC (rev 67583) +++ Products.Five/branches/philikon-local-components/component/browser.py 2006-04-25 08:49:16 UTC (rev 67584) @@ -15,26 +15,14 @@ $Id$ """ -import os.path - -from Acquisition import aq_inner from Products.Five.browser import BrowserView -from Products.Five.component import enableSite, disableSite, findSite +from Products.Five.component import enableSite, disableSite from Products.Five.component.interfaces import IObjectManagerSite -from Products.Five.component.zpt import ZPTViewFactory, IRegisteredViewPageTemplate -from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate -import zope.interface -import zope.component -import zope.dottedname.resolve -from zope.component.globalregistry import base from zope.component.persistentregistry import PersistentComponents -from zope.publisher.interfaces.browser import IBrowserRequest -from zope.traversing.browser import absoluteURL from zope.app.component.hooks import clearSite -from zope.app.apidoc.presentation import getViews -class ComponentsView(BrowserView): +class ObjectManagerSiteView(BrowserView): def update(self): form = self.request.form @@ -72,114 +60,3 @@ clearSite() self.context.setSiteManage(None) - -def mangleAbsoluteFilename(filename): -""" -Mangle an absolute filename when the file happens to be in a -package. The mangled name will then be of the form:: - - /. - -For example, let's take Five's configure.zcml as an example. We -assemble it in an OS-independent way so this test works on all -platforms: - - >>> def filesystemPath(*elements): - ... return os.path.sep.join(elements) - -We see that the filename is now mangled: - - >>> mangleAbsoluteFilename(filesystemPath( - ... '', 'path', 'to', 'Products', 'Five', 'configure.zcml')) - 'Products.Five/configure.zcml' - -The name of a file that's not in a package is returned unchanged: - - >>> not_in_a_package = filesystemPath('', 'path', 'to', 'configure.zcml') - >>> mangleAbsoluteFilename(not_in_a_package) == not_in_a_package - True -""" -if not os.path.isabs(filename): -raise ValueError("Can only determine package for absolute filenames") -dir, basename = os.path.split(filename) -pieces = dir.split(os.path.sep) -if pieces[0] == '': -pieces = pieces[1:] -while pieces: -try: -zope.dottedname.resolve.resolve('.'.join(pieces)) -break -except ImportError: -pieces = pieces[1:] -if not pieces: -return filename -return '.'.join(pieces) + '/' + basename - -class CustomizationView(BrowserView): - -def templateViewRegistrations(self): -for reg in getViews(zope.interface.providedBy(self.context), -IBrowserRequest): -factory = reg.factory -while hasattr(factory, 'factory'): -factory = factory.factory -#XXX this should really be dealt with using a marker interface -# on the view factory -if hasattr(factory, '__name__') and \ - factory.__name__.startswith('SimpleViewClass'): -yield reg - -def templateViewRegInfo(self): -def regkey(reg): -return reg.name -for reg in sorted(self.templateViewRegistrations(), key=regkey): -yield { -'viewname': reg.name, -'for': reg.required[0].__identifier__, -'type': reg.required[1].__identifier__, -'zptfile': mangleAbsoluteFilename(reg.factory.index.filename), -'zcmlfile': mangleAbsoluteFilename(reg.info.file) -} - -def templateFromViewname(self, viewname): -view = zope.component.getMultiAdapter((self.context, self.request), -
[Zope-Checkins] SVN: Products.Five/tags/philikon-localzptcustomization-prototype/ Save away prototype that I won't be able to complete before feature freeze next Monday
Log message for revision 67582: Save away prototype that I won't be able to complete before feature freeze next Monday Changed: A Products.Five/tags/philikon-localzptcustomization-prototype/ -=- Copied: Products.Five/tags/philikon-localzptcustomization-prototype (from rev 67581, Products.Five/branches/philikon-local-components) ___ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins