Total Complexity | 2 |
Total Lines | 52 |
Duplicated Lines | 0 % |
Coverage | 93.33% |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | # coding: utf-8 |
||
22 | 1 | @zope.interface.implementer(INISerializable) |
|
23 | 1 | class ServerConfig(Model): |
|
24 | 1 | about = ModelType( |
|
25 | model_spec=About, |
||
26 | required=True, |
||
27 | ) |
||
28 | 1 | anticheat = ModelType( |
|
29 | model_spec=Anticheat, |
||
30 | required=True, |
||
31 | ) |
||
32 | 1 | connection = ModelType( |
|
33 | model_spec=Connection, |
||
34 | required=True, |
||
35 | ) |
||
36 | 1 | console = ModelType( |
|
37 | model_spec=Console, |
||
38 | required=True, |
||
39 | ) |
||
40 | 1 | device_link = ModelType( |
|
41 | model_spec=DeviceLink, |
||
42 | required=True, |
||
43 | ) |
||
44 | 1 | events = ModelType( |
|
45 | model_spec=Events, |
||
46 | required=True, |
||
47 | ) |
||
48 | 1 | hud = ModelType( |
|
49 | model_spec=HUD, |
||
50 | required=True, |
||
51 | ) |
||
52 | 1 | morse = ModelType( |
|
53 | model_spec=Morse, |
||
54 | required=True, |
||
55 | ) |
||
56 | 1 | refly = ModelType( |
|
57 | model_spec=Refly, |
||
58 | required=True, |
||
59 | ) |
||
60 | 1 | statistics = ModelType( |
|
61 | model_spec=Statistics, |
||
62 | required=True, |
||
63 | ) |
||
64 | 1 | other = ModelType( |
|
65 | model_spec=Other, |
||
66 | required=True, |
||
67 | ) |
||
68 | |||
69 | 1 | @classmethod |
|
70 | def from_ini(cls, ini): |
||
71 | return cls({ |
||
72 | field_name: model_type.model_class.from_ini(ini) |
||
73 | for field_name, model_type in cls.fields.items() |
||
74 | }) |
||
75 |