~landscape/zope3/ztk-1.1.3

« back to all changes in this revision

Viewing changes to src/zodbcode/interfaces.py

  • Committer: Sidnei da Silva
  • Date: 2010-07-05 21:07:01 UTC
  • Revision ID: sidnei.da.silva@canonical.com-20100705210701-zmqhqrbzad1mhzsl
- Reduce deps

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
##############################################################################
2
 
#
3
 
# Copyright (c) 2002 Zope Corporation and Contributors.
4
 
# All Rights Reserved.
5
 
#
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.
12
 
#
13
 
##############################################################################
14
 
"""Persistent Module Interfaces
15
 
 
16
 
$Id$
17
 
"""
18
 
from zope.interface import Interface, Attribute
19
 
 
20
 
class IPersistentModuleImportRegistry(Interface):
21
 
 
22
 
    def findModule(name):
23
 
        """Return module registered under name or None."""
24
 
 
25
 
    def modules():
26
 
        """Return a list of module names in the registry."""
27
 
 
28
 
class IPersistentModuleUpdateRegistry(IPersistentModuleImportRegistry):
29
 
 
30
 
    def setModule(name, module):
31
 
        """Register module under name.
32
 
 
33
 
        Raises ValueError if module is already registered.
34
 
        """
35
 
 
36
 
    def delModule(name):
37
 
        """Unregister module registered under name.
38
 
 
39
 
        Raises KeyError in module is not registered.
40
 
        """
41
 
 
42
 
class IPersistentModuleManager(Interface):
43
 
 
44
 
    def new(name, source):
45
 
        """Create and register a new named module from source."""
46
 
 
47
 
    def update(src):
48
 
        """Update the source of the existing module."""
49
 
 
50
 
    def remove():
51
 
        """Unregister the module and forget about it."""
52
 
 
53
 
    name = Attribute("Absolute module name")
54
 
    source = Attribute("Module source string")