Passed
Pull Request — 2.x (#1778)
by Ramon
05:34
created

IDataManager.can_read()   A

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 2
rs 10
c 0
b 0
f 0
cc 1
nop 0
1
# -*- coding: utf-8 -*-
2
3
from zope import interface
4
5
6
class NO_VALUE(object):
7
    def __repr__(self):
8
        return "<NO_VALUE>"
9
10
11
NO_VALUE = NO_VALUE()
12
13
14
class IDataManager(interface.Interface):
15
    """Data manager."""
16
17
    def get(name):
18
        """Get the value.
19
20
        If no value can be found, raise an error
21
        """
22
23
    def query(name, default=NO_VALUE):
24
        """Query the name for its value
25
26
        If no value can be found, return the default value.
27
        If read is forbidden, raise an error.
28
        """
29
30
    def set(name, value):
31
        """Set the value by name
32
33
        Returns a list of updated objects
34
        """
35
36
    def can_read():
37
        """Checks if the object is readable
38
        """
39
40
    def can_write():
41
        """Checks if the object is writable
42
        """
43