0001# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
0002# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
0003class IAppInstall(object):
0004
0005    """
0006    The interface for objects in the entry point group
0007    ``paste.app_install``
0008    """
0009
0010    def __init__(distribution, entry_group, entry_name):
0011        """
0012        An object representing a specific application (the
0013        distribution is a pkg_resource.Distribution object), for the
0014        given entry point name in the given group.  Right now the only
0015        group used for this is ``'paste.app_factory'``.
0016        """
0017
0018    def description(sys_config):
0019        """
0020        Return a text description of the application and its
0021        configuration.  ``sys_config`` is a dictionary representing
0022        the system configuration, and can be used for giving more
0023        explicit defaults if the application preparation uses the
0024        system configuration.  It may be None, in which case the
0025        description should be more abstract.
0026
0027        Applications are free to ignore ``sys_config``.
0028        """
0029
0030    def write_config(command, filename, sys_config):
0031        """
0032        Write a fresh config file to ``filename``.  ``command`` is a
0033        ``paste.script.command.Command`` object, and should be used
0034        for the actual operations.  It handles things like simulation
0035        and verbosity.
0036
0037        ``sys_config`` is (if given) a dictionary of system-wide
0038        configuration options.
0039        """
0040
0041    def setup_config(command, config_filename,
0042                     config_section, sys_config):
0043        """
0044        Set up the application, using ``command`` (to ensure simulate,
0045        etc).  The application is described by the configuration file
0046        ``config_filename``.  ``sys_config`` is the system
0047        configuration (though probably the values from it should have
0048        already been encorporated into the configuration file).
0049        """