@@ -77,21 +77,35 @@ def get_plugins():
7777 "Please double-check the installed plugins!"
7878 )
7979 continue
80- plugins [plugin_package_name ] = importlib .resources .files (
81- plugin_package_name
82- )
80+ plugins [plugin_package_name ] = plugin_package_name
8381 return plugins
8482
8583 @staticmethod
86- def load_controller (package_name , package_path , controller_name ):
84+ def load_config (package_name ):
85+ """Load plugin_config.yml
86+
87+ Parameters
88+ ----------
89+ package_name : str
90+ package name
91+
92+ Returns
93+ -------
94+ plugin_config : dict
95+ plugin configuration
96+ """
97+ package_path = importlib .resources .files (package_name )
98+ plugin_config = load_yaml_file (os .path .join (package_path , "plugin_config.yml" ))
99+ return plugin_config
100+
101+ @staticmethod
102+ def load_controller (package_name , controller_name ):
87103 """Load controller
88104
89105 Parameters
90106 ----------
91107 package_name : str
92108 package name
93- package_path : str
94- package path
95109 controller_name : str
96110 controller name
97111
@@ -111,15 +125,13 @@ def load_controller(package_name, package_path, controller_name):
111125 return None
112126
113127 @staticmethod
114- def load_view (package_name , package_path , frame_name ):
128+ def load_view (package_name , frame_name ):
115129 """Load view
116130
117131 Parameters
118132 ----------
119133 package_name : str
120134 package name
121- package_path : str
122- package path
123135 frame_name : str
124136 frame name
125137
@@ -139,15 +151,13 @@ def load_view(package_name, package_path, frame_name):
139151 return None
140152
141153 @staticmethod
142- def load_feature_lists (package_name , package_path , register_func ):
154+ def load_feature_lists (package_name , register_func ):
143155 """Load feature lists
144156
145157 Parameters
146158 ----------
147159 package_name : str
148160 package name
149- package_path : str
150- package path
151161 register_func : func
152162 the function to handle feature lists
153163 """
@@ -161,15 +171,13 @@ def load_feature_lists(package_name, package_path, register_func):
161171 pass
162172
163173 @staticmethod
164- def load_features (package_name , package_path ):
174+ def load_features (package_name ):
165175 """Load features
166176
167177 Parameters
168178 ----------
169179 package_name : str
170180 package name
171- package_path : str
172- package path
173181 """
174182 for _ , module_name , is_pkg in pkgutil .iter_modules (
175183 [importlib .resources .files (package_name ).joinpath ("model/features" )]
@@ -183,17 +191,13 @@ def load_features(package_name, package_path):
183191 register_features (module )
184192
185193 @staticmethod
186- def load_acquisition_modes (
187- package_name , package_path , acquisition_modes , register_func
188- ):
194+ def load_acquisition_modes (package_name , acquisition_modes , register_func ):
189195 """Load acquisition modes
190196
191197 Parameters
192198 ----------
193199 package_name : str
194200 package name
195- package_path : str
196- package path
197201 acquisition_modes : []
198202 list of acquisition mode configurations
199203 register_func : func
@@ -209,15 +213,13 @@ def load_acquisition_modes(
209213 register_func (acquisition_mode_config ["name" ], module )
210214
211215 @staticmethod
212- def load_devices (package_name , package_path , register_func ):
216+ def load_devices (package_name , register_func ):
213217 """Load devices
214218
215219 Parameters
216220 ----------
217221 package_name : str
218222 package name
219- package_path : str
220- package path
221223 register_func : func
222224 the function to register devices
223225 """
@@ -268,7 +270,24 @@ def get_plugins(self):
268270 return plugins
269271
270272 @staticmethod
271- def load_controller (plugin_name , plugin_path , controller_name ):
273+ def load_config (plugin_path ):
274+ """Load plugin_config.yml
275+
276+ Parameters
277+ ----------
278+ plugin_path : str
279+ plugin path
280+
281+ Returns
282+ -------
283+ plugin_config : dict
284+ plugin configuration
285+ """
286+ plugin_config = load_yaml_file (os .path .join (plugin_path , "plugin_config.yml" ))
287+ return plugin_config
288+
289+ @staticmethod
290+ def load_controller (plugin_path , controller_name ):
272291 """Load controller
273292
274293 Parameters
@@ -300,7 +319,7 @@ def load_controller(plugin_name, plugin_path, controller_name):
300319 return None
301320
302321 @staticmethod
303- def load_view (plugin_name , plugin_path , frame_name ):
322+ def load_view (plugin_path , frame_name ):
304323 """Load view
305324
306325 Parameters
@@ -326,7 +345,7 @@ def load_view(plugin_name, plugin_path, frame_name):
326345 return None
327346
328347 @staticmethod
329- def load_feature_lists (plugin_name , plugin_path , register_func ):
348+ def load_feature_lists (plugin_path , register_func ):
330349 """Load feature lists
331350
332351 Parameters
@@ -344,7 +363,7 @@ def load_feature_lists(plugin_name, plugin_path, register_func):
344363 register_func (plugin_feature_list , module )
345364
346365 @staticmethod
347- def load_features (plugin_name , plugin_path ):
366+ def load_features (plugin_path ):
348367 """Load features
349368
350369 Parameters
@@ -365,9 +384,7 @@ def load_features(plugin_name, plugin_path):
365384 register_features (module )
366385
367386 @staticmethod
368- def load_acquisition_modes (
369- plugin_name , plugin_path , acquisition_modes , register_func
370- ):
387+ def load_acquisition_modes (plugin_path , acquisition_modes , register_func ):
371388 """Load acquisition modes
372389
373390 Parameters
@@ -390,7 +407,7 @@ def load_acquisition_modes(
390407 register_func (acquisition_mode_config ["name" ], module )
391408
392409 @staticmethod
393- def load_devices (plugin_name , plugin_path , register_func ):
410+ def load_devices (plugin_path , register_func ):
394411 """Load devices
395412
396413 Parameters
0 commit comments