17
17
18
18
init (autoreset = True )
19
19
20
- path_config_filename = "path_config.json"
21
20
home = os .path .expanduser ("~" )
22
21
tempdir = tempfile .gettempdir ()
23
22
build_id = time .strftime ("_%Y-%m-%d_%H-%M-%S" )
24
23
script_path = os .path .dirname (os .path .abspath (__file__ ))
24
+ path_config_filename = os .path .join (script_path , "path_config.json" )
25
25
26
26
arduino_cli_path = ""
27
27
stm32_url = "https://github.com/stm32duino/BoardManagerFiles/raw/master/STM32/package_stm_index.json"
39
39
40
40
# Default
41
41
sketch_default = os .path .join (script_path , "examples" , "BareMinimum" )
42
- exclude_file_default = os .path .join ("conf" , "exclude_list.txt" )
43
- cores_config_file_default = os .path .join ("conf" , "cores_config.json" )
44
- cores_config_file_ci = os .path .join ("conf" , "cores_config_ci.json" )
45
- path_config_ci_filename = os .path .join ("conf" , "path_config_ci.json" )
42
+ exclude_file_default = os .path .join (script_path , "conf" , "exclude_list.txt" )
43
+ cores_config_file_default = os .path .join (script_path , "conf" , "cores_config.json" )
44
+ cores_config_file_ci = os .path .join (script_path , "conf" , "cores_config_ci.json" )
46
45
47
46
maintainer_default = "STM32"
48
47
arch_default = "stm32"
@@ -132,10 +131,10 @@ def create_config():
132
131
# Create a Json file for a better path management
133
132
print (
134
133
"'{}' file created. Please check the configuration." .format (
135
- os . path . join ( script_path , path_config_filename )
134
+ path_config_filename
136
135
)
137
136
)
138
- path_config_file = open (os . path . join ( script_path , path_config_filename ) , "w" )
137
+ path_config_file = open (path_config_filename , "w" )
139
138
path_config_file .write (
140
139
json .dumps (
141
140
{
@@ -160,11 +159,9 @@ def check_config():
160
159
global output_dir
161
160
global log_file
162
161
if args .ci is False :
163
- if os .path .isfile (os . path . join ( script_path , path_config_filename ) ):
162
+ if os .path .isfile (path_config_filename ):
164
163
try :
165
- path_config_file = open (
166
- os .path .join (script_path , path_config_filename ), "r"
167
- )
164
+ path_config_file = open (path_config_filename , "r" )
168
165
path_config = json .load (path_config_file )
169
166
# Common path
170
167
arduino_cli_path = path_config ["ARDUINO_CLI_PATH" ]
@@ -244,9 +241,10 @@ def load_core_config():
244
241
cores_config_filename = cores_config_file_ci
245
242
else :
246
243
cores_config_filename = cores_config_file_default
247
- print ("Cores configuration JSON file that will be used: " + cores_config_filename )
244
+ print ("Cores configuration JSON file that will be used:" )
245
+ print (cores_config_filename )
248
246
try :
249
- cores_config_file = open (os . path . join ( script_path , cores_config_filename ) , "r" )
247
+ cores_config_file = open (cores_config_filename , "r" )
250
248
cores_config = json .load (cores_config_file )
251
249
cores_config_file .close ()
252
250
@@ -859,7 +857,7 @@ def build(build_conf):
859
857
then applicable to all board. Default core configuration is for '"
860
858
+ arch_default
861
859
+ " 'architecture in: "
862
- + os . path . join ( script_path , cores_config_file_default ) ,
860
+ + cores_config_file_default ,
863
861
)
864
862
865
863
parser .add_argument (
@@ -897,7 +895,7 @@ def build(build_conf):
897
895
metavar = "<excluded sketches list filepath>" ,
898
896
help = "file containing sketches pattern to ignore.\
899
897
Default path : "
900
- + os . path . join ( script_path , exclude_file_default ) ,
898
+ + exclude_file_default ,
901
899
)
902
900
903
901
args = parser .parse_args ()
0 commit comments