Conditions | 4 |
Total Lines | 23 |
Code Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 4 |
Changes | 0 |
1 | #!/usr/bin/env python3 |
||
15 | 1 | def __init__(self, locale_var, NEDITOR): |
|
16 | 1 | path_to_locale_dir = os.path.abspath( |
|
17 | os.path.join( |
||
18 | os.getcwd(), |
||
19 | "./locale/{0}/".format(locale_var[0]) |
||
20 | ) |
||
21 | ) |
||
22 | 1 | if os.path.exists(path_to_locale_dir) is False: |
|
23 | 1 | os.makedirs(path_to_locale_dir) |
|
24 | 1 | with open( |
|
25 | "{0}/neditor.txt".format(path_to_locale_dir), |
||
26 | encoding='utf-8', |
||
27 | mode='w' |
||
28 | ) as f: |
||
29 | 1 | f.write(NEDITOR) |
|
30 | |||
31 | 1 | with open( |
|
32 | "{0}/neditor.txt".format(path_to_locale_dir), |
||
33 | encoding='utf-8' |
||
34 | ) as f: |
||
35 | 1 | l_strip = f.read() |
|
36 | |||
37 | 1 | self.dic = ast.literal_eval(l_strip) |
|
38 | |||
56 |