DefaultSettingsConfig.load_config()   A
last analyzed

Complexity

Conditions 2

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
c 0
b 0
f 0
dl 0
loc 6
rs 10
1
import xml.etree.ElementTree as etree
2
3
from django.apps import AppConfig
4
5
from django.conf import settings
6
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