[Zope3-checkins] CVS: Zope3/src/zope/app/applicationcontrol - translationdomaincontrol.py:1.1 configure.zcml:1.7 interfaces.py:1.2 globaltranslationservicecontrol.py:NONE

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


Update of /cvs-repository/Zope3/src/zope/app/applicationcontrol
In directory cvs.zope.org:/tmp/cvs-serv4343/src/zope/app/applicationcontrol

Modified Files:
	configure.zcml interfaces.py 
Added Files:
	translationdomaincontrol.py 
Removed Files:
	globaltranslationservicecontrol.py 
Log Message:


Updated the application control to reflect API changes. There are no tests for
this code at all. :(




=== Added File Zope3/src/zope/app/applicationcontrol/translationdomaincontrol.py ===
##############################################################################
#
# Copyright (c) 2003 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Translation Domain Control

$Id: translationdomaincontrol.py,v 1.1 2004/03/08 23:33:38 srichter Exp $
"""
from zope.interface import implements
from zope.app import zapi
from zope.i18n.interfaces import ITranslationDomain
from zope.app.applicationcontrol.interfaces import \
     IApplicationControl, ITranslationDomainControl

class TranslationDomainControl:
    implements(ITranslationDomainControl)
    __used_for__ = IApplicationControl

    def __init__(self, context):
        self.context = context

    def getCatalogsInfo(self):
        """See .interfaces.ITranslationDomainControl"""
        info = []
        for name, domain in zapi.getUtilitiesFor(None, ITranslationDomain):
            if not hasattr(domain, 'getCatalogsInfo'):
                continue
            for language, fileNames in domain.getCatalogsInfo().items():
                info.append({'domain': name,
                             'language': language,
                             'fileNames': fileNames})
        return info
                

    def reloadCatalogs(self, domain, language):
        """See .interfaces.ITranslationDomainControl"""
        domain = zapi.getUtility(None, ITranslationDomain, domain)
        for lang, fileNames in domain.getCatalogsInfo().items():
            if lang == language:
                domain.reloadCatalogs(fileNames)



=== Zope3/src/zope/app/applicationcontrol/configure.zcml 1.6 => 1.7 ===
--- Zope3/src/zope/app/applicationcontrol/configure.zcml:1.6	Mon Mar  1 08:43:24 2004
+++ Zope3/src/zope/app/applicationcontrol/configure.zcml	Mon Mar  8 18:33:38 2004
@@ -5,37 +5,37 @@
     >
 
   <content
-      class="zope.app.applicationcontrol.applicationcontrol.ApplicationControl">
+      class=".applicationcontrol.ApplicationControl">
     <require
         permission="zope.ManageApplication"
-        interface="zope.app.applicationcontrol.interfaces.IApplicationControl"/>
+        interface=".interfaces.IApplicationControl"/>
   </content>
 
   <adapter 
-      for="zope.app.applicationcontrol.interfaces.IApplicationControl"
-      provides="zope.app.applicationcontrol.interfaces.IRuntimeInfo"
-      factory="zope.app.applicationcontrol.runtimeinfo.RuntimeInfo"
+      for=".interfaces.IApplicationControl"
+      provides=".interfaces.IRuntimeInfo"
+      factory=".runtimeinfo.RuntimeInfo"
       permission="zope.ManageApplication" />
 
   <adapter 
-      for="zope.app.applicationcontrol.interfaces.IApplicationControl"
-      provides="zope.app.applicationcontrol.interfaces.IZODBControl"
-      factory="zope.app.applicationcontrol.zodbcontrol.ZODBControl"
+      for=".interfaces.IApplicationControl"
+      provides=".interfaces.IZODBControl"
+      factory=".zodbcontrol.ZODBControl"
       permission="zope.ManageApplication" />
 
   <adapter 
-      for="zope.app.applicationcontrol.interfaces.IApplicationControl"
-      provides="zope.app.applicationcontrol.interfaces.IGlobalTSControl"
-      factory="zope.app.applicationcontrol.globaltranslationservicecontrol.GlobalTSControl"
+      for=".interfaces.IApplicationControl"
+      provides=".interfaces.ITranslationDomainControl"
+      factory=".translationdomaincontrol.TranslationDomainControl"
       permission="zope.ManageApplication" />
 
   <utility 
-      component="zope.app.applicationcontrol.zopeversion.ZopeVersionUtility"
-      provides="zope.app.applicationcontrol.interfaces.IZopeVersion" />
+      component=".zopeversion.ZopeVersionUtility"
+      provides=".interfaces.IZopeVersion" />
 
   <utility 
-      provides="zope.app.applicationcontrol.interfaces.IServerControl"
-      factory="zope.app.applicationcontrol.servercontrol.ServerControl"
+      provides=".interfaces.IServerControl"
+      factory=".servercontrol.ServerControl"
       permission="zope.ManageApplication"/>
 
   <!-- Hint: Here you see how to register something on Zope shutdown -->


=== Zope3/src/zope/app/applicationcontrol/interfaces.py 1.1 => 1.2 ===
--- Zope3/src/zope/app/applicationcontrol/interfaces.py:1.1	Mon Mar  1 08:43:24 2004
+++ Zope3/src/zope/app/applicationcontrol/interfaces.py	Mon Mar  8 18:33:38 2004
@@ -110,12 +110,12 @@
         """Pack the ZODB. Remove all entries that are older than 'days' days."""
 
 
-class IGlobalTSControl(Interface):
+class ITranslationDomainControl(Interface):
     """This control manages the state of the translation service."""
 
     def getCatalogsInfo():
         """Return the registered languages."""
 
-    def reloadCatalogs(catalogNames):
+    def reloadCatalogs(domain, language):
         """reload the named catalogs from file"""
 

=== Removed File Zope3/src/zope/app/applicationcontrol/globaltranslationservicecontrol.py ===




More information about the Zope3-Checkins mailing list