-
-
Notifications
You must be signed in to change notification settings - Fork 467
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
Rework extension loading #1423
Rework extension loading #1423
Conversation
Should we change load_extensions, load_extension , reload_extension and unload_extension to asynchronous function? |
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as resolved.
This comment was marked as resolved.
PR isn't ready for merge just yet, recursive loading doesn't appear to work currently. |
8c2e519
to
31c7eb3
Compare
…bama/pycord into rework-extension-loading
Ready for review again, hopefully, bug-free this time around. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I would suggest adding a parameter to ignore (or just print) extension loading errors if multiple extensions are being loaded, or some other solution that doesn't raise an exception and stop extensions from being loaded.
Additionally, we could consider potentially unloading loaded extensions if one fails.
The first implementation of this idea is done in |
This is now implemented in |
Currently mulling this over and I'm wondering about one last thing before this PR should be fully ready for review/merge: should |
I would prefer full name too tbh @Dorukyum what you think |
I agree, it should return the full name. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
This reverts commit 5a42fff.
On line 856 the check is not correct, you check final_out -> it's dict in isinstance(final_out, Exception) it's wrong. Need change to isinstance(final_out[name], Exception) |
Summary
This PR allows for folders to be loaded (allows for recursing through folders as well) in
load_extension
and adds the helper methodload_extensions
that allows for loading multiple extensions in one function call.Closes #946
Checklist
type: ignore
comments were used, a comment is also left explaining whyNotes