mirror of
https://github.com/mupen64plus/mupen64plus-ui-python.git
synced 2025-04-02 10:51:53 -04:00
Merge pull request #13 from fayvel/failure_plugin
Handle missing dependencies of plugins during plugin_load_try
This commit is contained in:
commit
5ba1e04f64
1 changed files with 11 additions and 7 deletions
|
@ -219,13 +219,17 @@ class Core:
|
|||
|
||||
def plugin_load_try(self, plugin_path=None):
|
||||
"""Loads plugins and maps them by plugin type."""
|
||||
plugin_handle = C.cdll.LoadLibrary(plugin_path)
|
||||
version = self.plugin_get_version(plugin_handle, plugin_path)
|
||||
if version:
|
||||
plugin_type, plugin_version, plugin_api, plugin_desc, plugin_cap = version
|
||||
plugin_name = os.path.basename(plugin_path)
|
||||
self.plugin_map[plugin_type][plugin_name] = (
|
||||
plugin_handle, plugin_path, PLUGIN_NAME[plugin_type], plugin_desc, plugin_version)
|
||||
try:
|
||||
plugin_handle = C.cdll.LoadLibrary(plugin_path)
|
||||
version = self.plugin_get_version(plugin_handle, plugin_path)
|
||||
if version:
|
||||
plugin_type, plugin_version, plugin_api, plugin_desc, plugin_cap = version
|
||||
plugin_name = os.path.basename(plugin_path)
|
||||
self.plugin_map[plugin_type][plugin_name] = (
|
||||
plugin_handle, plugin_path, PLUGIN_NAME[plugin_type], plugin_desc, plugin_version)
|
||||
except OSError as e:
|
||||
log.debug("plugin_load_try()")
|
||||
log.error("failed to load plugin %s: %s" % (plugin_path, e))
|
||||
|
||||
def plugin_startup(self, handle, name, desc):
|
||||
"""This function initializes plugin for use by allocating memory,
|
||||
|
|
Loading…
Add table
Reference in a new issue