[Zope3-checkins] CVS: Zope3/src/zope/app/security/browser - permissionwidget.py:1.3

Stephan Richter srichter at cosmos.phy.tufts.edu
Mon Mar 8 18:36:03 EST 2004


Update of /cvs-repository/Zope3/src/zope/app/security/browser
In directory cvs.zope.org:/tmp/cvs-serv5173/src/zope/app/security/browser

Modified Files:
	permissionwidget.py 
Log Message:



=== Zope3/src/zope/app/security/browser/permissionwidget.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/security/browser/permissionwidget.py:1.2	Mon Mar  8 14:40:33 2004
+++ Zope3/src/zope/app/security/browser/permissionwidget.py	Mon Mar  8 18:35:32 2004
@@ -15,15 +15,15 @@
 
 $Id$
 """
+from zope.interface import implements
+from zope.i18n import translate 
 
+from zope.app import zapi
 from zope.app.browser.form import widget
 from zope.app.i18n import ZopeMessageIDFactory as _
-from zope.app import zapi
 from zope.app.security.interfaces import IPermission
-from zope.app.services.servicenames import Translation
 from zope.security.checker import CheckerPublic
 import zope.app.interfaces.form
-import zope.interface
 
 
 class BaseWidget:
@@ -51,7 +51,7 @@
 
 class SinglePermissionWidget(BaseWidget, widget.BrowserWidget):
 
-    zope.interface.implements(zope.app.interfaces.form.IInputWidget)
+    implements(zope.app.interfaces.form.IInputWidget)
 
     def __call__(self):
         search_name = self.name + ".search"
@@ -69,11 +69,9 @@
         select_name = self.name
         selected = self._showData()
 
-        ts = zapi.getService(self.context.context, Translation)
         sel_perm = _('---select permission---')
-        trans = ts.translate(sel_perm, "zope", context=self.request)
-        if trans is not None:
-            sel_perm = trans
+        sel_perm = translate(self.context.context, sel_perm,
+                             context=self.request)
         
         options = ['<option value=\"\">'+sel_perm+'</option>']
         for permission in permissions:




More information about the Zope3-Checkins mailing list