22# -*- coding: utf-8 -*-
33# Copyright (c) 2021 LG Electronics Inc.
44# SPDX-License-Identifier: Apache-2.0
5- import os
65
76
87def parse_setting_json (data ):
98 # check type, if invalid = init value
109 mode = data .get ('mode' , [])
1110 path = data .get ('path' , [])
1211 dep_argument = data .get ('dep_argument' , '' )
13- outputDir = data .get ('outputDir' , '' )
14- outputFile = data .get ('outputFile' , '' )
12+ output = data .get ('output' , '' )
1513 format = data .get ('format' , '' )
16- link = data .get ('link' , [] )
14+ link = data .get ('link' , "" )
1715 db_url = data .get ('db_url' , '' )
1816 timer = data .get ('timer' , False )
1917 raw = data .get ('raw' , False )
2018 core = data .get ('core' , - 1 )
2119 no_correction = data .get ('no_correction' , False )
2220 correct_fpath = data .get ('correct_fpath' , '' )
2321 ui = data .get ('ui' , False )
24- exclude_path = data .get ('exclude_path ' , [])
22+ exclude_path = data .get ('exclude ' , [])
2523
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 ]
2826 booleans = [timer , raw , no_correction , ui ]
2927 is_incorrect = False
3028
@@ -48,16 +46,8 @@ def parse_setting_json(data):
4846 is_incorrect = True
4947 core = - 1
5048
51- if ( is_incorrect ) :
49+ if is_incorrect :
5250 print ('Ignoring some values with incorrect format in the setting file.' )
5351
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 , \
6353 raw , core , no_correction , correct_fpath , ui , exclude_path
0 commit comments