Passed
Push — master ( 74faac...3512c9 )
by Daniel
01:17
created

ManageSettings.fn_set_extract_behaviour()   A

Complexity

Conditions 3

Size

Total Lines 13
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 11
nop 1
dl 0
loc 13
rs 9.85
c 0
b 0
f 0
1
2
3
class ManageSettings:
4
5
    @staticmethod
6
    def fn_set_extract_behaviour(in_session):
7
        default_value = 'skip-if-output-file-exists'
8
        allowed_values = [
9
            'skip-if-output-file-exists',
10
            'overwrite-if-output-file-exists',
11
        ]
12
        if ('extract-behaviour' not in in_session) \
13
                or (in_session['extract-behaviour'] not in allowed_values):
14
            value_to_return = default_value
15
        else:
16
            value_to_return = in_session['extract-behaviour']
17
        return value_to_return
18