-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Move most imports from editor.py to __init__.py #1340
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tburrows13
added
the
feature
New addition to the API i.e. a new class, method or parameter.
label
Oct 9, 2020
7 tasks
mondeja
reviewed
Jan 13, 2021
tburrows13
force-pushed
the
change-editor
branch
from
January 13, 2021 23:33
60700b2
to
1048ee8
Compare
I think that this is ready to merge |
tburrows13
requested review from
mondeja
and removed request for
keikoro and
Zulko
January 13, 2021 23:40
mondeja
reviewed
Jan 14, 2021
mondeja
previously requested changes
Jan 14, 2021
This was referenced Jan 14, 2021
4 tasks
mondeja
approved these changes
Jan 15, 2021
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.
Great! Thank you @tburrows13
Probably my favourite change in 2.0 👍🏼 |
tburrows13
added a commit
to tburrows13/moviepy
that referenced
this pull request
Jan 19, 2021
* Move most imports from editor.py to __init__.py * Move Pygame environment variable to editor.py * Fix missing os import * Convert all __init__.py imports to absolute * Convert `moviepy.editor` to `moviepy` in documentation and examples * Assign clip.preview and clip.show in __init__.py to prevent confusion * Add changelog entry * Re-add test_fx AudioClip import * Add __all__ to __init__.py and editor.py * Update html_tools documentation; add ipython_display to editor.py __all__ * Apply black
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR moves most of the importing to
__init__.py
. This means that most users can import everything that they need directly frommoviepy
instead of frommoviepy.editor
ormoviepy.video.io.VideoFileClip
... you get the picture :)I've kept
editor.py
to handle the stuff that the user runs interactively: Pygame, matplotlib and IPython.This change is also fully backwards compatible because in
editor.py
, I callfrom . import *
so anything that is now in__init__.py
is also available fromeditor.py
.I've included an example change to
test_fx.py
that demonstrates the change. This could be applied to most of the test suite imports. I've not yet updated the documentation but in general it will advise things likefrom moviepy import VideoFileClip
orfrom moviepy import *
.Let me know your thoughts and feedback.
Todo: