Passed
Push — dev ( 20c194...b9ffd7 )
by Andreas
01:08
created

f_getconfig   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

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

1 Function

Rating   Name   Duplication   Size   Complexity  
A getconfig() 0 10 2
1
import yaml
2
3
def getconfig():
4
    """Определяет наличие конфига и загружает его."""
5
    try:
6
        conffile = open('conf/main.yml', 'r')
7
    except IOError:  # FIXME: Убрать exit() в результате эксепшена
8
        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...
9
10
    config = yaml.full_load(conffile)
11
    conffile.close()
12
    return config
13