Total Complexity | 6 |
Total Lines | 42 |
Duplicated Lines | 0 % |
Changes | 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 |