DefaultSettingsConfig   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 15
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A ready() 0 2 1
A load_config() 0 6 2
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