| Total Complexity | 3 |
| Total Lines | 15 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | import xml.etree.ElementTree as etree |
||
| 7 | class DefaultSettingsConfig(AppConfig): |
||
| 8 | name = 'chat' |
||
| 9 | verbose_name = 'pychat' |
||
| 10 | |||
| 11 | colors = {} |
||
| 12 | |||
| 13 | def load_config(self): |
||
| 14 | """Loads default color scheme for html chat page """ |
||
| 15 | tree = etree.parse(settings.BASE_DIR + '/chat/DefaultScheme.xml') |
||
| 16 | root = tree.getroot().find('colors') |
||
| 17 | for child in root: |
||
| 18 | self.colors[child.tag] = child.text |
||
| 19 | |||
| 20 | def ready(self): |
||
| 21 | self.load_config() |
||
| 22 | |||
| 23 |