[Zope-Checkins] SVN: Products.Five/trunk/ Some cleanup of viewlet
stuff.
Alec Mitchell
apm13 at columbia.edu
Tue May 2 13:35:28 EDT 2006
Log message for revision 67842:
Some cleanup of viewlet stuff.
Changed:
U Products.Five/trunk/browser/TrustedExpression.py
U Products.Five/trunk/viewlet/metaconfigure.py
U Products.Five/trunk/viewlet/tests.py
-=-
Modified: Products.Five/trunk/browser/TrustedExpression.py
===================================================================
--- Products.Five/trunk/browser/TrustedExpression.py 2006-05-02 17:26:18 UTC (rev 67841)
+++ Products.Five/trunk/browser/TrustedExpression.py 2006-05-02 17:35:27 UTC (rev 67842)
@@ -22,7 +22,7 @@
getEngine, installHandlers,\
SecureModuleImporter
-from ProviderExpression import ProviderExpr
+from Products.Five.browser.ProviderExpression import ProviderExpr
from ReuseUtils import rebindFunction
Modified: Products.Five/trunk/viewlet/metaconfigure.py
===================================================================
--- Products.Five/trunk/viewlet/metaconfigure.py 2006-05-02 17:26:18 UTC (rev 67841)
+++ Products.Five/trunk/viewlet/metaconfigure.py 2006-05-02 17:35:27 UTC (rev 67842)
@@ -8,8 +8,8 @@
from zope.app.publisher.browser import viewmeta
from Products.Five.security import getSecurityInfo, protectClass, protectName
-import viewlet
-import manager
+from Products.Five.viewlet import viewlet
+from Products.Five.viewlet import manager
from Globals import InitializeClass as initializeClass
Modified: Products.Five/trunk/viewlet/tests.py
===================================================================
--- Products.Five/trunk/viewlet/tests.py 2006-05-02 17:26:18 UTC (rev 67841)
+++ Products.Five/trunk/viewlet/tests.py 2006-05-02 17:35:27 UTC (rev 67842)
@@ -19,13 +19,9 @@
import unittest
from Testing.ZopeTestCase import FunctionalDocFileSuite
-from zope.app.testing import setup, ztapi
-from zope.component import provideAdapter
+from zope.app.testing import setup
from zope.interface import Interface
from zope.interface import implements
-from zope.traversing.interfaces import ITraversable, ITraverser
-from zope.traversing.adapters import Traverser
-from zope.traversing.namespace import resource
from zope.viewlet import interfaces
from OFS.SimpleItem import SimpleItem
@@ -53,25 +49,20 @@
def checkPermission( self, permission, object, context) :
return 1
-
class ILeftColumn(interfaces.IViewletManager):
"""Left column of my page."""
-
class INewColumn(interfaces.IViewletManager):
"""Left column of my page."""
-
class WeightBasedSorting(object):
def sort(self, viewlets):
return sorted(viewlets,
lambda x, y: cmp(x[1].weight, y[1].weight))
-
class Weather(object):
weight = 0
-
class Stock(object):
weight = 0
def getStockTicker(self):
@@ -82,47 +73,18 @@
def __call__(self):
return u'Red Sox vs. White Sox'
-
def setUp(test):
setup.placefulSetUp()
-# # resource namespace setup
-# from zope.traversing.interfaces import ITraversable
-# from zope.traversing.namespace import resource
-# ztapi.provideAdapter(None, ITraversable, resource, name="resource")
-# ztapi.provideView(None, None, ITraversable, "resource", resource)
-#
-# from zope.app.pagetemplate import metaconfigure
-# from zope.contentprovider import tales
-# metaconfigure.registerType('provider', tales.TALESProviderExpression)
-#
-# zope.security.management.getInteraction().add(TestParticipation())
-
-#def directivesSetUp(test):
-# setUp(test)
-# setup.setUpTestAsModule(test, 'zope.viewlet.directives')
-
-
def tearDown(test):
setup.placefulTearDown()
-#def directivesTearDown(test):
-# tearDown(test)
-# setup.tearDownTestAsModule(test)
-
-
def test_suite():
return unittest.TestSuite((
- FunctionalDocFileSuite('README.txt',
- setUp=setUp, tearDown=tearDown
- ),
+ FunctionalDocFileSuite('README.txt'),
FunctionalDocFileSuite('directives.txt',
setUp=setUp, tearDown=tearDown
),
-# DocFileSuite('directives.txt',
-# setUp=directivesSetUp, tearDown=directivesTearDown,
-# optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
-# ),
))
if __name__ == '__main__':
More information about the Zope-Checkins
mailing list