1
##############################################################################
3
# Copyright (c) 2002 Zope Corporation and Contributors.
6
# This software is subject to the provisions of the Zope Public License,
7
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
8
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
9
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
10
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
11
# FOR A PARTICULAR PURPOSE.
13
##############################################################################
14
"""Persistent Module Interfaces
18
from zope.interface import Interface, Attribute
20
class IPersistentModuleImportRegistry(Interface):
23
"""Return module registered under name or None."""
26
"""Return a list of module names in the registry."""
28
class IPersistentModuleUpdateRegistry(IPersistentModuleImportRegistry):
30
def setModule(name, module):
31
"""Register module under name.
33
Raises ValueError if module is already registered.
37
"""Unregister module registered under name.
39
Raises KeyError in module is not registered.
42
class IPersistentModuleManager(Interface):
44
def new(name, source):
45
"""Create and register a new named module from source."""
48
"""Update the source of the existing module."""
51
"""Unregister the module and forget about it."""
53
name = Attribute("Absolute module name")
54
source = Attribute("Module source string")