[Zope3-checkins]
SVN: Zope3/branches/philikon-simplify-skinning/src/zope/app/
Replace occurrences of ISkin with IBrowserSkinType.
Philipp von Weitershausen
philikon at philikon.de
Sat Feb 18 06:06:03 EST 2006
Log message for revision 41657:
Replace occurrences of ISkin with IBrowserSkinType.
Changed:
U Zope3/branches/philikon-simplify-skinning/src/zope/app/demo/skinpref/configure.zcml
U Zope3/branches/philikon-simplify-skinning/src/zope/app/demo/skinpref/skin.py
U Zope3/branches/philikon-simplify-skinning/src/zope/app/publisher/browser/__init__.py
U Zope3/branches/philikon-simplify-skinning/src/zope/app/publisher/browser/configure.zcml
U Zope3/branches/philikon-simplify-skinning/src/zope/app/publisher/browser/tests/test_directives.py
U Zope3/branches/philikon-simplify-skinning/src/zope/app/traversing/namespace.py
U Zope3/branches/philikon-simplify-skinning/src/zope/app/traversing/tests/test_skin.py
-=-
Modified: Zope3/branches/philikon-simplify-skinning/src/zope/app/demo/skinpref/configure.zcml
===================================================================
--- Zope3/branches/philikon-simplify-skinning/src/zope/app/demo/skinpref/configure.zcml 2006-02-18 10:56:54 UTC (rev 41656)
+++ Zope3/branches/philikon-simplify-skinning/src/zope/app/demo/skinpref/configure.zcml 2006-02-18 11:06:02 UTC (rev 41657)
@@ -7,10 +7,12 @@
handler=".skin.applySkin"
/>
+ <!-- TODO Browser Skin Names vocabulary can take over -->
<vocabulary
name="Skins"
factory="zope.app.component.vocabulary.UtilityVocabulary"
- interface="zope.publisher.interfaces.browser.ISkin" />
+ interface="zope.publisher.interfaces.browser.IBrowserSkinType"
+ />
<preferenceGroup
id="zmi"
Modified: Zope3/branches/philikon-simplify-skinning/src/zope/app/demo/skinpref/skin.py
===================================================================
--- Zope3/branches/philikon-simplify-skinning/src/zope/app/demo/skinpref/skin.py 2006-02-18 10:56:54 UTC (rev 41656)
+++ Zope3/branches/philikon-simplify-skinning/src/zope/app/demo/skinpref/skin.py 2006-02-18 11:06:02 UTC (rev 41657)
@@ -18,7 +18,7 @@
__docformat__ = "reStructuredText"
import zope.interface
-from zope.publisher.interfaces.browser import ISkin
+from zope.publisher.interfaces.browser import IBrowserSkinType
from zope.app.component.interfaces import ISite
from zope.app.preference.interfaces import IUserPreferences
from zope.app.publisher.browser import applySkin as applySkinOnRequest
Modified: Zope3/branches/philikon-simplify-skinning/src/zope/app/publisher/browser/__init__.py
===================================================================
--- Zope3/branches/philikon-simplify-skinning/src/zope/app/publisher/browser/__init__.py 2006-02-18 10:56:54 UTC (rev 41656)
+++ Zope3/branches/philikon-simplify-skinning/src/zope/app/publisher/browser/__init__.py 2006-02-18 11:06:02 UTC (rev 41657)
@@ -26,7 +26,7 @@
from zope.app.location import Location
from zope.app.publisher.interfaces.browser import IBrowserView
-from zope.publisher.interfaces.browser import ISkin
+from zope.publisher.interfaces.browser import IBrowserSkinType
key = "zope.app.publisher.browser.IUserPreferredLanguages"
@@ -107,9 +107,9 @@
>>> import pprint
>>> from zope.interface import Interface, providedBy
>>> class SkinA(Interface): pass
- >>> directlyProvides(SkinA, ISkin)
+ >>> directlyProvides(SkinA, IBrowserSkinType)
>>> class SkinB(Interface): pass
- >>> directlyProvides(SkinB, ISkin)
+ >>> directlyProvides(SkinB, IBrowserSkinType)
>>> class IRequest(Interface): pass
>>> class Request(object):
@@ -130,7 +130,7 @@
# Remove all existing skin declarations (commonly the default skin).
ifaces = [iface
for iface in directlyProvidedBy(request)
- if not ISkin.providedBy(iface)]
+ if not IBrowserSkinType.providedBy(iface)]
# Add the new skin.
ifaces.append(skin)
directlyProvides(request, *ifaces)
Modified: Zope3/branches/philikon-simplify-skinning/src/zope/app/publisher/browser/configure.zcml
===================================================================
--- Zope3/branches/philikon-simplify-skinning/src/zope/app/publisher/browser/configure.zcml 2006-02-18 10:56:54 UTC (rev 41656)
+++ Zope3/branches/philikon-simplify-skinning/src/zope/app/publisher/browser/configure.zcml 2006-02-18 11:06:02 UTC (rev 41657)
@@ -3,12 +3,9 @@
xmlns:browser="http://namespaces.zope.org/browser">
<interface
- interface="zope.publisher.interfaces.browser.ILayer" />
+ interface="zope.publisher.interfaces.browser.IBrowserSkinType" />
<interface
- interface="zope.publisher.interfaces.browser.ISkin" />
-
-<interface
interface="zope.app.publisher.interfaces.browser.IMenuItemType" />
<browser:layer name="default"
Modified: Zope3/branches/philikon-simplify-skinning/src/zope/app/publisher/browser/tests/test_directives.py
===================================================================
--- Zope3/branches/philikon-simplify-skinning/src/zope/app/publisher/browser/tests/test_directives.py 2006-02-18 10:56:54 UTC (rev 41656)
+++ Zope3/branches/philikon-simplify-skinning/src/zope/app/publisher/browser/tests/test_directives.py 2006-02-18 11:06:02 UTC (rev 41657)
@@ -29,7 +29,7 @@
from zope.publisher.interfaces import ILayer
from zope.publisher.interfaces.browser import IBrowserPublisher
from zope.publisher.interfaces.browser import IBrowserRequest
-from zope.publisher.interfaces.browser import ISkin, IDefaultSkin
+from zope.publisher.interfaces.browser import IBrowserSkinType, IDefaultSkin
from zope.security.proxy import removeSecurityProxy, ProxyFactory
from zope.testing.doctestunit import DocTestSuite
@@ -142,7 +142,7 @@
<browser:skin name="testskin" layers="default" />
'''
)))
- testskin = zapi.getUtility(ISkin, "testskin")
+ testskin = zapi.getUtility(IBrowserSkinType, "testskin")
import zope.app.skins
self.assert_(zope.app.skins.testskin is testskin)
@@ -342,7 +342,7 @@
self.assertEqual(
zapi.queryAdapter(request, name='test').__class__, R1)
- zmi = zapi.getUtility(ISkin, 'zmi')
+ zmi = zapi.getUtility(IBrowserSkinType, 'zmi')
self.assertEqual(
zapi.queryAdapter(TestRequest(skin=zmi), name='test').__class__,
RZMI)
@@ -407,7 +407,7 @@
v = zapi.queryMultiAdapter((ob, request), name='test')
self.assert_(issubclass(v.__class__, V1))
- zmi = zapi.getUtility(ISkin, 'zmi')
+ zmi = zapi.getUtility(IBrowserSkinType, 'zmi')
v = zapi.queryMultiAdapter((ob, TestRequest(skin=zmi)), name='test')
self.assert_(issubclass(v.__class__, VZMI))
@@ -894,7 +894,7 @@
v = zapi.getMultiAdapter((ob, request), name='index.html')
self.assertEqual(v(), 'V1 here')
- skinny = zapi.getUtility(ISkin, 'skinny')
+ skinny = zapi.getUtility(IBrowserSkinType, 'skinny')
v = zapi.getMultiAdapter((ob, TestRequest(skin=skinny)),
name='index.html')
self.assertEqual(v(), 'done')
@@ -964,7 +964,7 @@
self.assertEqual(zapi.queryAdapter(request, name='test'), None)
- zmi = zapi.getUtility(ISkin, 'zmi')
+ zmi = zapi.getUtility(IBrowserSkinType, 'zmi')
r = zapi.getAdapter(TestRequest(skin=zmi), name='test')
r = removeSecurityProxy(r)
self.assertEqual(r._testData(), open(path, 'rb').read())
Modified: Zope3/branches/philikon-simplify-skinning/src/zope/app/traversing/namespace.py
===================================================================
--- Zope3/branches/philikon-simplify-skinning/src/zope/app/traversing/namespace.py 2006-02-18 10:56:54 UTC (rev 41656)
+++ Zope3/branches/philikon-simplify-skinning/src/zope/app/traversing/namespace.py 2006-02-18 11:06:02 UTC (rev 41657)
@@ -23,7 +23,7 @@
from zope.i18n.interfaces import IModifiableUserPreferredLanguages
from zope.component.exceptions import ComponentLookupError
from zope.interface import providedBy, directlyProvides, directlyProvidedBy
-from zope.publisher.interfaces.browser import ISkin
+from zope.publisher.interfaces.browser import IBrowserSkinType
from zope.security.proxy import removeSecurityProxy
from zope.app.publisher.browser import applySkin
@@ -385,7 +385,7 @@
def traverse(self, name, ignored):
self.request.shiftNameToApplication()
- skin = zope.component.getUtility(ISkin, name)
+ skin = zope.component.getUtility(IBrowserSkinType, name)
applySkin(self.request, skin)
return self.context
@@ -507,8 +507,8 @@
>>> class Debug(IBrowserRequest):
... pass
- >>> directlyProvides(Debug, ISkin)
- >>> ztapi.provideUtility(ISkin, Debug, 'Debug')
+ >>> directlyProvides(Debug, IBrowserSkinType)
+ >>> ztapi.provideUtility(IBrowserSkinType, Debug, 'Debug')
>>> Debug.providedBy(request)
False
@@ -542,7 +542,7 @@
# TODO: I am not sure this is the best solution. What
# if we want to enable tracebacks when also trying to
# debug a different skin?
- skin = zope.component.getUtility(ISkin, 'Debug')
+ skin = zope.component.getUtility(IBrowserSkinType, 'Debug')
directlyProvides(request, providedBy(request)+skin)
else:
raise ValueError("Unknown debug flag: %s" % flag)
Modified: Zope3/branches/philikon-simplify-skinning/src/zope/app/traversing/tests/test_skin.py
===================================================================
--- Zope3/branches/philikon-simplify-skinning/src/zope/app/traversing/tests/test_skin.py 2006-02-18 10:56:54 UTC (rev 41656)
+++ Zope3/branches/philikon-simplify-skinning/src/zope/app/traversing/tests/test_skin.py 2006-02-18 11:06:02 UTC (rev 41657)
@@ -18,7 +18,7 @@
from unittest import TestCase, main, makeSuite
from zope.interface import Interface, directlyProvides
-from zope.publisher.interfaces.browser import ISkin
+from zope.publisher.interfaces.browser import IBrowserSkinType
from zope.app.testing import ztapi
from zope.app.testing.placelesssetup import PlacelessSetup
@@ -29,14 +29,14 @@
class IFoo(Interface):
pass
-directlyProvides(IFoo, ISkin)
+directlyProvides(IFoo, IBrowserSkinType)
class Test(PlacelessSetup, TestCase):
def setUp(self):
super(Test, self).setUp()
- ztapi.provideUtility(ISkin, IFoo, 'foo')
+ ztapi.provideUtility(IBrowserSkinType, IFoo, 'foo')
def test(self):
from zope.app.traversing.namespace import skin
More information about the Zope3-Checkins
mailing list