rebase codebase, delete trunk, move threads to backend

This commit is contained in:
2025-01-14 16:20:08 +01:00
parent fba652006f
commit 08cd18f3f1
106 changed files with 1604 additions and 1057 deletions

View File

@@ -1,6 +1,5 @@
from .blob import create_blob
from .icon import Icon
from .pickles import dump_pickle, load_pickle
from .sortgenerator import app_sort, name_sort
from .richtext import SemesterDocument
from .richtext import SemesterDocument

View File

@@ -1,4 +1,3 @@
def create_blob(file):
"""
Creates a blob from a file.

View File

@@ -1,4 +1,3 @@
import darkdetect
from omegaconf import OmegaConf
from PyQt6 import QtGui
@@ -21,12 +20,12 @@ class Icon:
recolor (bool, optional): If Icon should be recolored. Defaults to True.
color (str, optional): Color type to use. Configured in config file. Defaults to None.
"""
assert (
icon_type in settings.icons.icons.keys()
), f"Icon {icon_type} not in config file"
assert (
color in settings.icons.colors.keys() or color is None
), f"Color {color} not in config file"
assert icon_type in settings.icons.icons.keys(), (
f"Icon {icon_type} not in config file"
)
assert color in settings.icons.colors.keys() or color is None, (
f"Color {color} not in config file"
)
icon = settings.icons.get(icon_type)
dark = darkdetect.isDark()
if dark:
@@ -49,8 +48,8 @@ class Icon:
except AttributeError:
widget.setWindowIcon(self.icon)
def add_icon(self, icon_path,recolor=False):
icon = self.changeColor(icon_path,recolor)
def add_icon(self, icon_path, recolor=False):
icon = self.changeColor(icon_path, recolor)
# use icon bytes to create a pixmap
pixmap = QtGui.QPixmap()
@@ -70,7 +69,7 @@ class Icon:
stroke = re.search(r"stroke=\"(.*?)\"", cicon)
if stroke:
stroke = stroke.group(1)
if fill and stroke:
# replace stroke
newicon = icon.replace(stroke.encode(), config.color.encode())
@@ -87,8 +86,7 @@ class Icon:
)
return self.icon
def changeColor(self,icon_path,recolor) -> bytes:
def changeColor(self, icon_path, recolor) -> bytes:
"""change the color of the svg icon to the color set in the config file
Args:
@@ -102,7 +100,7 @@ class Icon:
icon = file.read()
if recolor:
cicon = str(icon)
try:
fill = re.search(r"fill=\"(.*?)\"", cicon).group(1)
except AttributeError:
@@ -112,6 +110,5 @@ class Icon:
return icon
if __name__ == "__main__":
print("This is a module and can not be executed directly.")

View File

@@ -1,4 +1,3 @@
import pickle