-
Notifications
You must be signed in to change notification settings - Fork 451
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
Showing
4 changed files
with
23 additions
and
5 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
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
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import pathlib | ||
import sys | ||
|
||
|
||
def get_webui_root() -> pathlib.Path: | ||
""" | ||
Get the location of the "ui" directory. | ||
When compiled through PyInstaller, the ui directory changes. | ||
When running from source or when using cx_Freeze, we can use the ``__file__``. | ||
""" | ||
if hasattr(sys, '_MEIPASS'): | ||
return pathlib.Path(sys._MEIPASS) / 'ui' # noqa: SLF001 | ||
return pathlib.Path(__file__).parent.absolute() / "ui" |
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