2
2
# -*- coding: utf-8 -*-
3
3
# Copyright (c) 2021 LG Electronics Inc.
4
4
# SPDX-License-Identifier: Apache-2.0
5
- import os
6
5
7
6
8
7
def parse_setting_json (data ):
9
8
# check type, if invalid = init value
10
9
mode = data .get ('mode' , [])
11
10
path = data .get ('path' , [])
12
11
dep_argument = data .get ('dep_argument' , '' )
13
- outputDir = data .get ('outputDir' , '' )
14
- outputFile = data .get ('outputFile' , '' )
12
+ output = data .get ('output' , '' )
15
13
format = data .get ('format' , '' )
16
- link = data .get ('link' , [] )
14
+ link = data .get ('link' , "" )
17
15
db_url = data .get ('db_url' , '' )
18
16
timer = data .get ('timer' , False )
19
17
raw = data .get ('raw' , False )
20
18
core = data .get ('core' , - 1 )
21
19
no_correction = data .get ('no_correction' , False )
22
20
correct_fpath = data .get ('correct_fpath' , '' )
23
21
ui = data .get ('ui' , False )
24
- exclude_path = data .get ('exclude_path ' , [])
22
+ exclude_path = data .get ('exclude ' , [])
25
23
26
- str_lists = [mode , path , link , exclude_path ]
27
- strings = [dep_argument , outputDir , outputFile , format , db_url , correct_fpath ]
24
+ str_lists = [mode , path , exclude_path ]
25
+ strings = [dep_argument , output , format , db_url , correct_fpath , link ]
28
26
booleans = [timer , raw , no_correction , ui ]
29
27
is_incorrect = False
30
28
@@ -48,16 +46,8 @@ def parse_setting_json(data):
48
46
is_incorrect = True
49
47
core = - 1
50
48
51
- if ( is_incorrect ) :
49
+ if is_incorrect :
52
50
print ('Ignoring some values with incorrect format in the setting file.' )
53
51
54
- if not mode :
55
- mode = ['all' ]
56
- final_mode = mode [0 ].split ()
57
- if (not ("compare" in final_mode ) and (len (path ) > 0 )):
58
- path = [path [0 ]]
59
- link = link [0 ] if (link and not path ) else ''
60
- output = os .path .join (outputDir , outputFile )
61
-
62
- return final_mode , path , dep_argument , output , format , link , db_url , timer , \
52
+ return mode , path , dep_argument , output , format , link , db_url , timer , \
63
53
raw , core , no_correction , correct_fpath , ui , exclude_path
0 commit comments