-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean prints and file test code. Move __main__ into app_init and pass…
… parser into AppState
- Loading branch information
Showing
23 changed files
with
63 additions
and
207 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,44 @@ | ||
import logging | ||
import sys | ||
|
||
from PySide6 import QtWidgets | ||
from qt_material import apply_stylesheet # type: ignore | ||
|
||
from joystick_diagrams.app_state import AppState | ||
from joystick_diagrams.db import db_init | ||
from joystick_diagrams.plugin_manager import ParserPluginManager | ||
from joystick_diagrams.ui.main_window import MainWindow | ||
|
||
_logger = logging.getLogger(__name__) | ||
|
||
|
||
def init(): | ||
# TODO log and orchestrate this better | ||
|
||
# Setup datastore | ||
db_init.init() | ||
# ------------------------------- | ||
|
||
# Get global state object | ||
_state = AppState() | ||
# ------------------------------- | ||
|
||
# -- Initialise Plugins System -- | ||
plugins = ParserPluginManager() | ||
plugins.load_discovered_plugins() | ||
plugins.create_plugin_wrappers() | ||
_state.init_plugins(plugins) | ||
|
||
# Setup global state with plugins | ||
_state = AppState(plugin_manager=plugins) | ||
# ------------------------------- | ||
|
||
# Setup UI and begin thread | ||
app = QtWidgets.QApplication(sys.argv) | ||
window = MainWindow() | ||
window.show() | ||
|
||
extra = { | ||
"font_family": "Roboto", | ||
} | ||
|
||
apply_stylesheet(app, theme="dark_blue.xml", invert_secondary=False, extra=extra) | ||
|
||
app.exec() | ||
|
||
|
||
if __name__ == "__main__": | ||
pass |
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
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 |
---|---|---|
|
@@ -43,5 +43,4 @@ def get_path(self) -> bool: | |
|
||
|
||
if __name__ == "__main__": | ||
plugin = ParserPlugin() | ||
print(plugin) | ||
pass |
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 |
---|---|---|
|
@@ -64,5 +64,4 @@ def icon(self): | |
|
||
|
||
if __name__ == "__main__": | ||
plugin = ParserPlugin() | ||
print(plugin) | ||
pass |
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.