1
1
import os
2
2
from pathlib import Path
3
- from typing import Any , Dict , List
3
+ from typing import Any
4
4
5
5
from multiversx_sdk import NetworkProviderConfig
6
6
@@ -81,12 +81,12 @@ def delete_value(name: str):
81
81
write_file (data )
82
82
83
83
84
- def get_active () -> Dict [str , Any ]:
84
+ def get_active () -> dict [str , Any ]:
85
85
data = read_file ()
86
86
configs = data .get ("configurations" , {})
87
87
active_config_name : str = data .get ("active" , "default" )
88
- empty_config : Dict [str , Any ] = dict ()
89
- result : Dict [str , Any ] = configs .get (active_config_name , empty_config )
88
+ empty_config : dict [str , Any ] = dict ()
89
+ result : dict [str , Any ] = configs .get (active_config_name , empty_config )
90
90
91
91
return result
92
92
@@ -143,7 +143,7 @@ def _guard_valid_config_deletion(name: str):
143
143
raise errors .ConfigurationProtectedError (name )
144
144
145
145
146
- def get_defaults () -> Dict [str , Any ]:
146
+ def get_defaults () -> dict [str , Any ]:
147
147
return {
148
148
"dependencies.vmtools.tag" : "v1.5.24" ,
149
149
"dependencies.vmtools.urlTemplate.linux" : "https://github.com/multiversx/mx-chain-vm-go/archive/{TAG}.tar.gz" ,
@@ -179,20 +179,20 @@ def resolve_config_path() -> Path:
179
179
return GLOBAL_CONFIG_PATH
180
180
181
181
182
- def read_file () -> Dict [str , Any ]:
182
+ def read_file () -> dict [str , Any ]:
183
183
config_path = resolve_config_path ()
184
184
if config_path .exists ():
185
- data : Dict [str , Any ] = utils .read_json_file (config_path )
185
+ data : dict [str , Any ] = utils .read_json_file (config_path )
186
186
return data
187
187
return dict ()
188
188
189
189
190
- def write_file (data : Dict [str , Any ]):
190
+ def write_file (data : dict [str , Any ]):
191
191
config_path = resolve_config_path ()
192
192
utils .write_json_file (str (config_path ), data )
193
193
194
194
195
- def add_config_args (argv : List [str ]) -> List [str ]:
195
+ def add_config_args (argv : list [str ]) -> list [str ]:
196
196
try :
197
197
command , subcommand , * _ = argv
198
198
except ValueError :
@@ -210,8 +210,8 @@ def add_config_args(argv: List[str]) -> List[str]:
210
210
return final_args
211
211
212
212
213
- def determine_final_args (argv : List [str ], config_args : Dict [str , Any ]) -> List [str ]:
214
- extra_args : List [str ] = []
213
+ def determine_final_args (argv : list [str ], config_args : dict [str , Any ]) -> list [str ]:
214
+ extra_args : list [str ] = []
215
215
for key , value in config_args .items ():
216
216
key_arg = f"--{ key } "
217
217
# arguments from the command line override the config
@@ -222,9 +222,9 @@ def determine_final_args(argv: List[str], config_args: Dict[str, Any]) -> List[s
222
222
extra_args .append (key_arg )
223
223
if value is True :
224
224
continue
225
- if isinstance (value , List ):
226
- for item in value :
227
- extra_args .append (str (item ))
225
+ if isinstance (value , list ):
226
+ for item in value : # type: ignore
227
+ extra_args .append (str (item )) # type: ignore
228
228
else :
229
229
extra_args .append (str (value ))
230
230
0 commit comments