Completed
Push — master ( 91d748...e1a893 )
by Andreas
19s queued 12s
created

f_getconfig   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

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

1 Function

Rating   Name   Duplication   Size   Complexity  
A getconfig() 0 10 2
1
"""Функция работы с файлом конфигурации."""
2
import yaml
3
4
5
def getconfig():
6
    """Определяет наличие конфига и загружает его."""
7
    try:
8
        conffile = open('conf/main.yml', 'r')
9
    except IOError:  # FIXME: Убрать exit() в результате эксепшена
10
        exit(messagebox.showerror('ERROR', _('Config file not found')))
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable messagebox does not seem to be defined.
Loading history...
Comprehensibility Best Practice introduced by
The variable _ does not seem to be defined.
Loading history...
11
12
    config = yaml.full_load(conffile)
13
    conffile.close()
14
    return config
15