-
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.
Merge pull request #1 from TejasIsCool/detached
Update v1.3 Exe Compatiblity with PyInstaller
- Loading branch information
Showing
15 changed files
with
197 additions
and
85 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,38 @@ | ||
#!/usr/bin/env python | ||
# PySimpleGui library: https://pypi.org/project/PySimpleGUI/ | ||
import os | ||
import importlib.util | ||
|
||
from src.logic import manage_events | ||
from src.window import window as window_maker | ||
import multiprocessing | ||
import logging | ||
from src.logger import configure_logging | ||
|
||
if __name__ == "__main__": | ||
|
||
configure_logging() | ||
logging.info("This is the log console. Most events that take place will be shown here") | ||
|
||
# Py Installer SPlash manager | ||
if '_PYIBoot_SPLASH' in os.environ and importlib.util.find_spec("pyi_splash"): | ||
import pyi_splash | ||
|
||
pyi_splash.update_text('UI Loaded ...') | ||
pyi_splash.close() | ||
logging.info('Splash screen closed.') | ||
|
||
# Enable Multiprocessing to work in executable form | ||
multiprocessing.freeze_support() | ||
logging.debug("Multiprocessing freeze_support enabled") | ||
|
||
# Instantiate the window | ||
window = window_maker.make_window() | ||
logging.debug("Window instantiated") | ||
|
||
# Manage all its events | ||
manage_events.manage_events(window) | ||
# Finish up by removing from the screen | ||
window.close() | ||
logging.warning("The Program has been closed!") | ||
|
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,27 @@ | ||
import logging | ||
import time | ||
import os | ||
|
||
|
||
def configure_logging(): | ||
# Not using resource_path here, because I want it to be seen outside the executable | ||
if not os.path.exists("./mcIVASMAKER_logs"): | ||
os.makedirs("./mcIVASMAKER_logs") | ||
logging.basicConfig( | ||
filename=f"./mcIVASMAKER_logs/Log{time.strftime('%y_%m_%d-%H_%M_%S', time.localtime())}.log", | ||
format="{asctime:s}::{name:s}_[{levelname:^8s}] - {message:s}", | ||
datefmt='%Y/%m/%d %I:%M:%S%p', | ||
style='{', | ||
encoding='utf-8', | ||
level=logging.DEBUG | ||
) | ||
console = logging.StreamHandler() | ||
console.setLevel(logging.INFO) | ||
console.setFormatter(logging.Formatter( | ||
"{asctime:s}::{name:s}_[{levelname:^8s}] - {message:s}", | ||
style="{", | ||
datefmt='%Y/%m/%d %I:%M:%S%p' | ||
)) | ||
# add the handler to the root logger | ||
logging.getLogger('').addHandler(console) | ||
|
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
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
Oops, something went wrong.