forked from altendky/pyqt-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eb76681
commit ce393f0
Showing
1 changed file
with
7 additions
and
14 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,12 @@ | ||
""" Enables support for calling entrypoints using `python -m` or `pythonw -m`. | ||
On windows using `pythonw -m pyqt6_tools designer` in a shortcut allows opening | ||
QtDesigner without showing a command prompt window that stays open the entire | ||
time that QtDesigner is open. | ||
""" Enables support for calling entrypoints using `python -m`. | ||
Examples: | ||
Launching PyQt6 designer: `python -m pyqt6_tools designer` | ||
Launching PyQt5 designer: `python -m pyqt5_tools designer` | ||
""" | ||
|
||
|
||
import importlib | ||
import pathlib | ||
import sys | ||
from . import entrypoints | ||
|
||
if __name__ == "__main__": | ||
# Relative imports don't work when called by `python -m ...`, get the name | ||
# of the parent folder so we can import entrypoints from it. This is needed | ||
# because the package name is not hard coded between PyQt versions. | ||
module_name = pathlib.Path(__file__).parent.stem | ||
entrypoints = importlib.import_module(f"{module_name}.entrypoints") | ||
|
||
sys.exit(entrypoints.main()) | ||
sys.exit(entrypoints.main()) |