[Zope3-checkins] CVS: Zope3/src/zope/i18n - negotiator.py:1.10

Jim Fulton jim at zope.com
Sat Mar 6 11:51:09 EST 2004


Update of /cvs-repository/Zope3/src/zope/i18n
In directory cvs.zope.org:/tmp/cvs-serv11249/src/zope/i18n

Modified Files:
	negotiator.py 
Log Message:
Converted most getAdapter calls to use interface calls instead.


=== Zope3/src/zope/i18n/negotiator.py 1.9 => 1.10 ===
--- Zope3/src/zope/i18n/negotiator.py:1.9	Mon Mar  1 08:08:19 2004
+++ Zope3/src/zope/i18n/negotiator.py	Sat Mar  6 11:50:38 2004
@@ -17,7 +17,6 @@
 """
 from zope.i18n.interfaces import INegotiator
 from zope.i18n.interfaces import IUserPreferredLanguages
-from zope.component import getAdapter
 from zope.interface import implements
 
 def normalize_lang(lang):
@@ -39,7 +38,7 @@
     implements(INegotiator)
 
     def getLanguage(self, langs, env):
-        envadapter = getAdapter(env, IUserPreferredLanguages)
+        envadapter = IUserPreferredLanguages(env)
         userlangs = envadapter.getPreferredLanguages()
         # Prioritize on the user preferred languages.  Return the first user
         # preferred language that the object has available.




More information about the Zope3-Checkins mailing list