[Zope3-checkins] CVS: Zope3/src/zope/app/applicationcontrol - interfaces.py:1.1 applicationcontrol.py:1.9 configure.zcml:1.6 globaltranslationservicecontrol.py:1.3 metaconfigure.py:1.6 runtimeinfo.py:1.5 servercontrol.py:1.8 zodbcontrol.py:1.5 zopeversion.py:1.6

Philipp von Weitershausen philikon at philikon.de
Mon Mar 1 08:43:55 EST 2004


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

Modified Files:
	applicationcontrol.py configure.zcml 
	globaltranslationservicecontrol.py metaconfigure.py 
	runtimeinfo.py servercontrol.py zodbcontrol.py zopeversion.py 
Added Files:
	interfaces.py 
Log Message:
Moved browser views and interfaces for applicationcontrol to the
zope.app.applicationcontrol package.


=== Added File Zope3/src/zope/app/applicationcontrol/interfaces.py ===
##############################################################################
#
# Copyright (c) 2001, 2002 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.
#
##############################################################################
"""Application Control Interface

$Id: interfaces.py,v 1.1 2004/03/01 13:43:24 philikon Exp $
"""
from zope.interface import Interface

class ServerControlError(Exception):
    """Represents an error in the ServerControl."""

class DoublePriorityError(ServerControlError):
    """A second hook was registered for a priority."""

class NotCallableError(ServerControlError):
    """Raisen if a given object is not callable."""


class IApplicationControl(Interface):
    """The application control instance is usually generated upon startup and
    can therefore record the startup time."""

    def getStartTime():
        """Return time the application started in seconds since the epoch."""


class IRuntimeInfo(Interface):
    """ Runtime Information Adapter for Application Control """

    def getZopeVersion():
        """Return a string containing the descriptive version of the
           current zope installation"""

    def getPythonVersion():
        """Return a string containing verbose description of the python
           interpreter"""

    def getPythonPath():
        """Return a tuple containing the lookup paths of the python interpreter
        """

    def getSystemPlatform():
        """Return the system platform name in a 5 tuple of
           (sysname, nodename, release, version, machine)"""

    def getCommandLine():
        """Return the command line string Zope was invoked with"""

    def getProcessId():
        """Return the process id number currently serving the request
        """

    def getUptime():
        """Return a string containing the Zope server uptime in unix uptime
           format with seconds ([NN days, ]HH:MM:SS)"""


class IZopeVersion(Interface):
    """ Zope version """

    def getZopeVersion():
        """Return a string containing the Zope version (possibly including
           CVS information)"""


class IServerControl(Interface):
    """Defines methods for shutting down and restarting the server.

    This utility also keeps a registry of things to call when shutting down
    zope. You can register using this interface or the zcml on the global
    ServerController instance.
    """

    def shutdown():
        """Shutdown the server gracefully

        Returns: Nothing
        """

    def restart():
        """Restart the server gracefully

        Returns: Nothing
        """

    def registerShutdownHook(call, priority, name):
        """Register a function that will be callen on server shutdown.
        
        The function needs to takes no argument at all."""


class IZODBControl(Interface):
    """This control manages the state of the ZODB."""

    def getDatabaseSize(db):
        """Return the database size in bytes."""

    def pack(db, days):
        """Pack the ZODB. Remove all entries that are older than 'days' days."""


class IGlobalTSControl(Interface):
    """This control manages the state of the translation service."""

    def getCatalogsInfo():
        """Return the registered languages."""

    def reloadCatalogs(catalogNames):
        """reload the named catalogs from file"""



=== Zope3/src/zope/app/applicationcontrol/applicationcontrol.py 1.8 => 1.9 ===
--- Zope3/src/zope/app/applicationcontrol/applicationcontrol.py:1.8	Wed Feb 25 17:26:47 2004
+++ Zope3/src/zope/app/applicationcontrol/applicationcontrol.py	Mon Mar  1 08:43:24 2004
@@ -22,7 +22,7 @@
 
 from zope.app.location import Location
 from zope.app.folder import rootFolder
-from zope.app.interfaces.applicationcontrol import IApplicationControl
+from zope.app.applicationcontrol.interfaces import IApplicationControl
 
 class ApplicationControl(Location):
 


=== Zope3/src/zope/app/applicationcontrol/configure.zcml 1.5 => 1.6 ===
--- Zope3/src/zope/app/applicationcontrol/configure.zcml:1.5	Tue Aug 12 11:50:09 2003
+++ Zope3/src/zope/app/applicationcontrol/configure.zcml	Mon Mar  1 08:43:24 2004
@@ -8,33 +8,33 @@
       class="zope.app.applicationcontrol.applicationcontrol.ApplicationControl">
     <require
         permission="zope.ManageApplication"
-        interface="zope.app.interfaces.applicationcontrol.IApplicationControl"/>
+        interface="zope.app.applicationcontrol.interfaces.IApplicationControl"/>
   </content>
 
   <adapter 
-      for="zope.app.interfaces.applicationcontrol.IApplicationControl"
-      provides="zope.app.interfaces.applicationcontrol.IRuntimeInfo"
+      for="zope.app.applicationcontrol.interfaces.IApplicationControl"
+      provides="zope.app.applicationcontrol.interfaces.IRuntimeInfo"
       factory="zope.app.applicationcontrol.runtimeinfo.RuntimeInfo"
       permission="zope.ManageApplication" />
 
   <adapter 
-      for="zope.app.interfaces.applicationcontrol.IApplicationControl"
-      provides="zope.app.interfaces.applicationcontrol.IZODBControl"
+      for="zope.app.applicationcontrol.interfaces.IApplicationControl"
+      provides="zope.app.applicationcontrol.interfaces.IZODBControl"
       factory="zope.app.applicationcontrol.zodbcontrol.ZODBControl"
       permission="zope.ManageApplication" />
 
   <adapter 
-      for="zope.app.interfaces.applicationcontrol.IApplicationControl"
-      provides="zope.app.interfaces.applicationcontrol.IGlobalTSControl"
+      for="zope.app.applicationcontrol.interfaces.IApplicationControl"
+      provides="zope.app.applicationcontrol.interfaces.IGlobalTSControl"
       factory="zope.app.applicationcontrol.globaltranslationservicecontrol.GlobalTSControl"
       permission="zope.ManageApplication" />
 
   <utility 
       component="zope.app.applicationcontrol.zopeversion.ZopeVersionUtility"
-      provides="zope.app.interfaces.applicationcontrol.IZopeVersion" />
+      provides="zope.app.applicationcontrol.interfaces.IZopeVersion" />
 
   <utility 
-      provides="zope.app.interfaces.applicationcontrol.IServerControl"
+      provides="zope.app.applicationcontrol.interfaces.IServerControl"
       factory="zope.app.applicationcontrol.servercontrol.ServerControl"
       permission="zope.ManageApplication"/>
 
@@ -44,5 +44,10 @@
        priority="0"
        call=".servercontrol.shutdownLogger"
        />
+
+
+  <!-- Include borwser package -->
+
+  <include package=".browser" />
 
 </configure>


=== Zope3/src/zope/app/applicationcontrol/globaltranslationservicecontrol.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/applicationcontrol/globaltranslationservicecontrol.py:1.2	Sun Aug 17 02:05:20 2003
+++ Zope3/src/zope/app/applicationcontrol/globaltranslationservicecontrol.py	Mon Mar  1 08:43:24 2004
@@ -17,7 +17,7 @@
 """
 
 from zope.interface import implements
-from zope.app.interfaces.applicationcontrol import \
+from zope.app.applicationcontrol.interfaces import \
      IApplicationControl, IGlobalTSControl
 from zope.i18n.globaltranslationservice import translationService
 
@@ -30,10 +30,10 @@
         self.context = context
 
     def getCatalogsInfo(self):
-        """See zope.app.interfaces.applicationControl.IGlobalTSControl"""
+        """See zope.app.applicationcontrol.interfaces.IGlobalTSControl"""
         return translationService.getCatalogsInfo()
 
     def reloadCatalogs(self, catalogName):
-        """See zope.app.interfaces.applicationControl.IGlobalTSControl"""
+        """See zope.app.applicationcontrol.interfaces.IGlobalTSControl"""
         return translationService.reloadCatalogs(catalogName)
 


=== Zope3/src/zope/app/applicationcontrol/metaconfigure.py 1.5 => 1.6 ===
--- Zope3/src/zope/app/applicationcontrol/metaconfigure.py:1.5	Sun Aug 17 02:05:20 2003
+++ Zope3/src/zope/app/applicationcontrol/metaconfigure.py	Mon Mar  1 08:43:24 2004
@@ -17,7 +17,7 @@
 """
 
 from zope.component import getUtility
-from zope.app.interfaces.applicationcontrol import IServerControl
+from zope.app.applicationcontrol.interfaces import IServerControl
 
 def registerShutdownHook(_context, call, name, priority):
     """Register a shutdown hook with the current server control utility"""


=== Zope3/src/zope/app/applicationcontrol/runtimeinfo.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/applicationcontrol/runtimeinfo.py:1.4	Thu Jul 31 17:37:18 2003
+++ Zope3/src/zope/app/applicationcontrol/runtimeinfo.py	Mon Mar  1 08:43:24 2004
@@ -17,7 +17,7 @@
 """
 import sys, os, time
 
-from zope.app.interfaces.applicationcontrol import \
+from zope.app.applicationcontrol.interfaces import \
      IRuntimeInfo, IApplicationControl, IZopeVersion
 from zope.component import getUtility, ComponentLookupError
 from zope.interface import implements
@@ -31,7 +31,7 @@
         self.context = context
 
     def getZopeVersion(self):
-        """See zope.app.interfaces.applicationcontrol.IRuntimeInfo"""
+        """See zope.app.applicationcontrol.interfaces.IRuntimeInfo"""
         try:
             version_utility = getUtility(self.context, IZopeVersion)
         except ComponentLookupError:
@@ -39,29 +39,29 @@
         return version_utility.getZopeVersion()
 
     def getPythonVersion(self):
-        """See zope.app.interfaces.applicationcontrol.IRuntimeInfo"""
+        """See zope.app.applicationcontrol.interfaces.IRuntimeInfo"""
         return sys.version
 
     def getPythonPath(self):
-        """See zope.app.interfaces.applicationcontrol.IRuntimeInfo"""
+        """See zope.app.applicationcontrol.interfaces.IRuntimeInfo"""
         return tuple(map(str, sys.path))
 
     def getSystemPlatform(self):
-        """See zope.app.interfaces.applicationcontrol.IRuntimeInfo"""
+        """See zope.app.applicationcontrol.interfaces.IRuntimeInfo"""
         if hasattr(os, "uname"):
             return os.uname()
         else:
             return (sys.platform,)
 
     def getCommandLine(self):
-        """See zope.app.interfaces.applicationcontrol.IRuntimeInfo"""
+        """See zope.app.applicationcontrol.interfaces.IRuntimeInfo"""
         return sys.argv
 
     def getProcessId(self):
-        """See zope.app.interfaces.applicationcontrol.IRuntimeInfo"""
+        """See zope.app.applicationcontrol.interfaces.IRuntimeInfo"""
         return os.getpid()
 
     def getUptime(self):
-        """See zope.app.interfaces.applicationcontrol.IRuntimeInfo"""
+        """See zope.app.applicationcontrol.interfaces.IRuntimeInfo"""
         return time.time() - self.context.getStartTime()
 


=== Zope3/src/zope/app/applicationcontrol/servercontrol.py 1.7 => 1.8 ===
--- Zope3/src/zope/app/applicationcontrol/servercontrol.py:1.7	Thu Jul 31 17:37:18 2003
+++ Zope3/src/zope/app/applicationcontrol/servercontrol.py	Mon Mar  1 08:43:24 2004
@@ -17,7 +17,7 @@
 """
 import logging
 
-from zope.app.interfaces.applicationcontrol import \
+from zope.app.applicationcontrol.interfaces import \
      IServerControl, DoublePriorityError, NotCallableError
 from zope.interface import implements
 
@@ -33,7 +33,7 @@
         self._shutdown_reg = {}
 
     def shutdown(self):
-        """See zope.app.interfaces.applicationcontrol.IServerControl"""
+        """See zope.app.applicationcontrol.interfaces.IServerControl"""
         order = self._shutdown_reg.keys()
         order.sort()
 
@@ -42,11 +42,11 @@
             hook[0]()
 
     def restart(self):
-        """See zope.app.interfaces.applicationcontrol.IServerControl"""
+        """See zope.app.applicationcontrol.interfaces.IServerControl"""
         pass
 
     def registerShutdownHook(self, call, priority, name):
-        """See zope.app.interfaces.applicationcontrol.IServerControl"""
+        """See zope.app.applicationcontrol.interfaces.IServerControl"""
         priority = float(priority)
         if priority in self._shutdown_reg:
             raise DoublePriorityError, (call, priority, name)


=== Zope3/src/zope/app/applicationcontrol/zodbcontrol.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/applicationcontrol/zodbcontrol.py:1.4	Wed Feb 25 17:26:47 2004
+++ Zope3/src/zope/app/applicationcontrol/zodbcontrol.py	Mon Mar  1 08:43:24 2004
@@ -16,7 +16,7 @@
 $Id$
 """
 from zope.interface import implements
-from zope.app.interfaces.applicationcontrol import \
+from zope.app.applicationcontrol.interfaces import \
      IApplicationControl, IZODBControl
 
 class ZODBControl:
@@ -28,7 +28,7 @@
         self.context = context
 
     def getDatabaseSize(self, db):
-        """See zope.app.interfaces.applicationControl.IZODBControl"""
+        """See zope.app.applicationcontrol.interfaces.IZODBControl"""
         # XXX ZODB 4 doesn't support getting the database size
         # the original implementation (commnted out) depended on internal
         # file-storage implementation details.
@@ -37,5 +37,5 @@
         return 0
 
     def pack(self, db, days):
-        """See zope.app.interfaces.applicationControl.IZODBControl"""
+        """See zope.app.applicationcontrol.interfaces.IZODBControl"""
         db.pack(days=days)


=== Zope3/src/zope/app/applicationcontrol/zopeversion.py 1.5 => 1.6 ===
--- Zope3/src/zope/app/applicationcontrol/zopeversion.py:1.5	Thu Jul 31 17:37:18 2003
+++ Zope3/src/zope/app/applicationcontrol/zopeversion.py	Mon Mar  1 08:43:24 2004
@@ -18,7 +18,7 @@
 import os
 
 import zope
-from zope.app.interfaces.applicationcontrol import IZopeVersion
+from zope.app.applicationcontrol.interfaces import IZopeVersion
 from zope.interface import implements
 
 class ZopeVersion:
@@ -26,7 +26,7 @@
     implements(IZopeVersion)
 
     def getZopeVersion(self):
-        """See zope.app.interfaces.applicationcontrol.IZopeVersion"""
+        """See zope.app.applicationcontrol.interfaces.IZopeVersion"""
 
         version_id = "Development/Unknown"
         version_tag = ""




More information about the Zope3-Checkins mailing list