Skip to content

Commit

Permalink
ci: auto fixes from pre-commit.com hooks.
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] authored and germa89 committed Jan 10, 2025
1 parent 35bcf88 commit 2dea3bc
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/ansys/mapdl/core/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ def _mapdl(self):
"""Return the weakly referenced instance of mapdl."""
return self._mapdl_weakref()


def load(self, plugin_name: str, feature: str = "CMD") -> str:
"""
Loads a plugin into MAPDL.
Expand All @@ -83,14 +82,15 @@ def load(self, plugin_name: str, feature: str = "CMD") -> str:
PluginLoadError
If the plugin fails to load.
"""

command = f"*PLUG,LOAD,{plugin_name},{feature}"
response = self._mapdl.run(command)
if "error" in response.lower():
raise PluginLoadError(f"Failed to load plugin '{plugin_name}' with feature '{feature}'.")
raise PluginLoadError(
f"Failed to load plugin '{plugin_name}' with feature '{feature}'."
)
return f"Plugin '{plugin_name}' with feature '{feature}' loaded successfully."


def unload(self, plugin_name: str) -> str:
"""
Unloads a plugin from MAPDL.
Expand All @@ -117,7 +117,6 @@ def unload(self, plugin_name: str) -> str:
raise PluginUnloadError(f"Failed to unload plugin '{plugin_name}'.")
return f"Plugin '{plugin_name}' unloaded successfully."


def list(self) -> list:
"""
Lists all currently loaded plugins in MAPDL.
Expand Down

0 comments on commit 2dea3bc

Please sign in to comment.