@@ -110,7 +110,7 @@ def _read_virtual_configurations(cls) -> Dict[str, core.HttpConfiguration]:
110110 A dictionary mapping each loaded configuration ID to its corresponding
111111 :class:`HttpConfiguration`.
112112 """
113- configurations = {} # type : Dict[str, core.HttpConfiguration]
113+ configurations : Dict [str , core .HttpConfiguration ] = {}
114114 try :
115115 configurations [cls ._HTTP_JUPYTER_CONFIGURATION_ID ] = (
116116 core .JupyterHttpConfiguration ()
@@ -135,7 +135,7 @@ def _read_configurations(cls) -> Dict[str, core.HttpConfiguration]:
135135 ApiException: if an OS or permission error prevents reading the directory
136136 that contains HTTP configurations.
137137 """
138- configurations = {} # type : Dict[str, core.HttpConfiguration]
138+ configurations : Dict [str , core .HttpConfiguration ] = {}
139139 path = cls ._http_configurations_directory ()
140140 if not path .exists ():
141141 return configurations
@@ -162,14 +162,12 @@ def _read_configurations(cls) -> Dict[str, core.HttpConfiguration]:
162162 if not config_file .uri :
163163 continue
164164
165- cert_path = None # type : Optional[pathlib.Path]
165+ cert_path : Optional [pathlib .Path ] = None
166166 if config_file .cert_path :
167- cert_path = typing .cast (
168- pathlib .Path ,
169- PathConstants .application_data_directory
170- / "Certificates"
171- / config_file .cert_path ,
167+ app_data_dir = typing .cast (
168+ pathlib .Path , PathConstants .application_data_directory
172169 )
170+ cert_path = app_data_dir / "Certificates" / config_file .cert_path
173171 if not cert_path .exists ():
174172 cert_path = None
175173 configurations [config_file .id ] = core .HttpConfiguration (
@@ -226,7 +224,10 @@ def _http_configurations_directory(cls) -> pathlib.Path:
226224 Returns:
227225 pathlib.Path: The path of the HTTP Configurations directory.
228226 """
229- return PathConstants .application_data_directory / "HttpConfigurations"
227+ app_data_dir = typing .cast (
228+ pathlib .Path , PathConstants .application_data_directory
229+ )
230+ return app_data_dir / "HttpConfigurations"
230231
231232 @classmethod
232233 def _salt_grains_path (cls ) -> pathlib .Path :
@@ -235,7 +236,8 @@ def _salt_grains_path(cls) -> pathlib.Path:
235236 Returns:
236237 pathlib.Path: The path of SALT grains config file
237238 """
238- return PathConstants .salt_data_directory / "conf" / "grains"
239+ salt_data_dir = typing .cast (pathlib .Path , PathConstants .salt_data_directory )
240+ return salt_data_dir / "conf" / "grains"
239241
240242 @classmethod
241243 def _read_system_workspace (cls ) -> Optional [str ]:
0 commit comments