[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/OFS/Services/RoleService - Role.py:1.5 RoleService.py:1.6 configure.zcml:1.9
Steve Alexander
steve@cat-box.net
Mon, 11 Nov 2002 03:36:54 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Services/RoleService
In directory cvs.zope.org:/tmp/cvs-serv12187
Modified Files:
Role.py RoleService.py configure.zcml
Log Message:
Reformatted code to be closer to z3 style.
Removed extraneous import.
=== Zope3/lib/python/Zope/App/OFS/Services/RoleService/Role.py 1.4 => 1.5 ===
--- Zope3/lib/python/Zope/App/OFS/Services/RoleService/Role.py:1.4 Sun Jun 23 13:03:42 2002
+++ Zope3/lib/python/Zope/App/OFS/Services/RoleService/Role.py Mon Nov 11 03:36:54 2002
@@ -17,7 +17,6 @@
$Id$
"""
-from Zope.App.Security.IRole import IRole
from Zope.App.Security.Registries.RoleRegistry import Role
from Persistence import Persistent
=== Zope3/lib/python/Zope/App/OFS/Services/RoleService/RoleService.py 1.5 => 1.6 ===
--- Zope3/lib/python/Zope/App/OFS/Services/RoleService/RoleService.py:1.5 Thu Aug 1 14:42:12 2002
+++ Zope3/lib/python/Zope/App/OFS/Services/RoleService/RoleService.py Mon Nov 11 03:36:54 2002
@@ -19,7 +19,6 @@
from Zope.App.OFS.Container.BTreeContainer import BTreeContainer
from Zope.App.Security.IRoleService import IRoleService
from Zope.App.OFS.Container.IContainer import IContainer
-from Zope.App.Security.Registries.RoleRegistry import roleRegistry
from Zope.ContextWrapper import ContextMethod
from Zope.App.ComponentArchitecture.NextService import getNextService
@@ -28,7 +27,7 @@
class RoleService(BTreeContainer):
- __implements__ = ILocalRoleService
+ __implements__ = ILocalRoleService
############################################################
# Implementation methods for interface
@@ -36,14 +35,15 @@
def getRole(wrapped_self, rid):
'''See interface IRoleService'''
- try: return wrapped_self[rid]
+ try:
+ return wrapped_self[rid]
except KeyError:
# We failed locally: delegate to a higher-level service.
- sv= getNextService(wrapped_self, 'Roles')
- if sv: return sv.getRole(rid)
+ sv = getNextService(wrapped_self, 'Roles')
+ if sv:
+ return sv.getRole(rid)
raise # will be original Key Error
-
- getRole=ContextMethod(getRole)
+ getRole = ContextMethod(getRole)
def getRoles(wrapped_self):
'''See interface IRoleService'''
@@ -52,8 +52,7 @@
if roleserv:
roles.extend(roleserv.getRoles())
return roles
-
- getRoles=ContextMethod(getRoles)
+ getRoles = ContextMethod(getRoles)
#
############################################################
=== Zope3/lib/python/Zope/App/OFS/Services/RoleService/configure.zcml 1.8 => 1.9 ===
--- Zope3/lib/python/Zope/App/OFS/Services/RoleService/configure.zcml:1.8 Thu Jul 11 14:21:31 2002
+++ Zope3/lib/python/Zope/App/OFS/Services/RoleService/configure.zcml Mon Nov 11 03:36:54 2002
@@ -3,26 +3,26 @@
xmlns:browser='http://namespaces.zope.org/browser'
xmlns:service='http://namespaces.zope.org/service'>
- <content class=".RoleService.">
- <factory
- id="RoleService"
- permission="Zope.ManageServices"
- />
- <require
- permission="Zope.Security"
- interface="Zope.App.Security.IRoleService." />
- <require
- permission="Zope.ManageServices"
- interface="Zope.App.OFS.Container.IContainer." />
- </content>
+<content class=".RoleService.">
+ <factory
+ id="RoleService"
+ permission="Zope.ManageServices"
+ />
+ <require
+ permission="Zope.Security"
+ interface="Zope.App.Security.IRoleService." />
+ <require
+ permission="Zope.ManageServices"
+ interface="Zope.App.OFS.Container.IContainer." />
+</content>
- <content class=".Role.">
- <factory />
- <require
- permission="Zope.Security"
- interface="Zope.App.Security.IRole." />
- </content>
+<content class=".Role.">
+ <factory />
+ <require
+ permission="Zope.Security"
+ interface="Zope.App.Security.IRole." />
+</content>
- <include package=".Views" />
+<include package=".Views" />
</zopeConfigure>