Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the documentation about "get_current_plugin_path" method #66

Open
sambarza opened this issue Nov 17, 2023 · 3 comments
Open

Add the documentation about "get_current_plugin_path" method #66

sambarza opened this issue Nov 17, 2023 · 3 comments

Comments

@sambarza
Copy link
Collaborator

Document the method "get_current_plugin_path" in the settings page

@pieroit
Copy link
Member

pieroit commented Nov 17, 2023

We'll try to add also a get_plugin method to get the object itself

Do you thing from a devx point of view, which name is better?
get_current_plugin_path
get_plugin_path
plugin_path
?

@sambarza
Copy link
Collaborator Author

sambarza commented Nov 18, 2023

Are two different topics, correct?
1- We'll try to add also a get_plugin method to get the object itself
2- Question about the name

If correct, I like the method to get the current plugin instance, then the dev can do:

get_plugin().load_settings()
get_plugin().path

Maybe the method get_plugin can have the argument plugin_name, if not specified it returns the current plugin instance.
Can be useful to get the plugin instance from other plugins?

@pieroit
Copy link
Member

pieroit commented Nov 20, 2023

Thanks @sambarza merged your idea with @Jhonnyr97 PR (cheshire-cat-ai/core#550)

Now we can do from a plugin:

cat.mad_hatter.get_plugin().id # gets plugin folder name
cat.mad_hatter.get_plugin().path # gets plugin folder path
cat.mad_hatter.get_plugin().load_settings()
cat.mad_hatter.get_plugin().save_settings(settings)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants