Updated __init__ files; theming css changes, other

This commit is contained in:
itdominator 2024-10-14 21:57:18 -05:00
parent e2e9dc8c1f
commit fafc1a985f
18 changed files with 55 additions and 37 deletions

View File

@ -1,3 +1,3 @@
"""
Start of package.
Src Package.
"""

View File

@ -1,3 +1,3 @@
"""
Core Module
Core Package
"""

View File

@ -1,3 +1,3 @@
"""
Containers Module
Containers Package
"""

View File

@ -1,3 +1,3 @@
"""
Controllers Module
Controllers Package
"""

View File

@ -1,3 +1,3 @@
"""
Widgets Module
Widgets Package
"""

View File

@ -1,3 +1,3 @@
"""
Widgets.Controls Module
Widgets.Controls Package
"""

View File

@ -1,3 +1,3 @@
"""
WebKit2 UI Module
WebKit2 UI Package
"""

View File

@ -1,3 +1,3 @@
"""
Utils module
Libs Package
"""

View File

@ -1,5 +1,5 @@
"""
DB module
DB Package
"""
from .models import User

View File

@ -1,5 +1,5 @@
"""
Dasta Class module
Dasta Class Package
"""
from .event import Event

View File

@ -56,7 +56,7 @@ class IPCServer(Singleton):
@daemon_threaded
def _run_ipc_loop(self, listener) -> None:
# NOTE: Not thread safe if using with Gtk. Need to import GLib and use idle_add
while True:
while self.is_ipc_alive:
try:
conn = listener.accept()
start_time = time.perf_counter()
@ -67,7 +67,7 @@ class IPCServer(Singleton):
listener.close()
def _handle_ipc_message(self, conn, start_time) -> None:
while True:
while self.is_ipc_alive:
msg = conn.recv()
logger.debug(msg)
@ -76,6 +76,9 @@ class IPCServer(Singleton):
if file:
event_system.emit("handle-file-from-ipc", file)
conn.close()
break
if "DIR|" in msg:
file = msg.split("DIR|")[1].strip()
if file:

View File

@ -1,3 +1,3 @@
"""
Utils/Mixins module
Libs.Mixins Package
"""

View File

@ -1,6 +1,8 @@
# Python imports
# Lib imports
import gi
from gi.repository import GLib
# Application imports
@ -8,13 +10,22 @@
class IPCSignalsMixin:
""" IPCSignalsMixin handle messages from another starting solarfm process. """
""" IPCSignalsMixin handle messages from another starting {APP_NAME} process. """
def print_to_console(self, message=None):
def print_to_console(self, message = None):
logger.debug(message)
def handle_file_from_ipc(self, path: str) -> None:
logger.debug(f"File From IPC: {path}")
def handle_file_from_ipc(self, fpath: str) -> None:
logger.debug(f"File From IPC: {fpath}")
GLib.idle_add(
self.broadcast_message, "handle-file", (fpath,)
)
def handle_dir_from_ipc(self, path: str) -> None:
logger.debug(f"Dir From IPC: {path}")
def handle_dir_from_ipc(self, fpath: str) -> None:
logger.debug(f"Dir From IPC: {fpath}")
GLib.idle_add(
self.broadcast_message, "handle-folder", (fpath,)
)
def broadcast_message(self, message_type: str = "none", data: () = ()) -> None:
event_system.emit(message_type, data)

View File

@ -1,4 +1,4 @@
"""
Settings module
Settings Package
"""
from .manager import SettingsManager

View File

@ -114,13 +114,13 @@ class SettingsManager(StartCheckMixin, Singleton):
self._starting_files = []
def register_signals_to_builder(self, classes=None):
def register_signals_to_builder(self, classes = None):
handlers = {}
for c in classes:
methods = None
try:
methods = inspect.getmembers(c, predicate=inspect.ismethod)
methods = inspect.getmembers(c, predicate = inspect.ismethod)
handlers.update(methods)
except Exception as e:
...
@ -153,7 +153,7 @@ class SettingsManager(StartCheckMixin, Singleton):
def get_home_config_path(self) -> str: return self._HOME_CONFIG_PATH
def get_window_icon(self) -> str: return self._WINDOW_ICON
def get_home_path(self) -> str: return self._USER_HOME
def get_starting_files(self) -> []: return self._starting_files
def get_starting_files(self) -> list: return self._starting_files
def is_trace_debug(self) -> str: return self._trace_debug
def is_debug(self) -> str: return self._debug
@ -170,7 +170,7 @@ class SettingsManager(StartCheckMixin, Singleton):
def set_main_window_height(self, height = 600): self.settings.config.main_window_height = height
def set_main_window_min_width(self, width = 720): self.settings.config.main_window_min_width = width
def set_main_window_min_height(self, height = 480): self.settings.config.main_window_min_height = height
def set_starting_files(self, files: []) -> None: self._starting_files = files
def set_starting_files(self, files: list) -> None: self._starting_files = files
def set_trace_debug(self, trace_debug):
self._trace_debug = trace_debug
@ -178,7 +178,7 @@ class SettingsManager(StartCheckMixin, Singleton):
def set_debug(self, debug):
self._debug = debug
def set_is_starting_with_file(self, is_passed_in_file: False):
def set_is_starting_with_file(self, is_passed_in_file: bool = False):
self._passed_in_file = is_passed_in_file
def load_settings(self):

View File

@ -1,5 +1,5 @@
"""
Options module
Settings.Options Package
"""
from .settings import Settings
from .config import Config

View File

@ -1,3 +1,3 @@
"""
Settings Other module
Settings.Other Package
"""

View File

@ -69,3 +69,7 @@ class ManifestProcessor:
loading_data["bind_keys"] = requests["bind_keys"]
return self._plugin, loading_data
def is_pre_launch(self):
return self._plugin.pre_launch