Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions InitGui.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

# __file__ ist im FlatPak-FreeCAD nicht gesetzt → Fallback auf getUserAppDataDir.
# globals() schreibt _MODDIR in exec-globals, damit Klassen-Methoden es sehen.
# Statische Prüfer sehen diese Zuweisung nicht — jede Verwendung von _MODDIR
# trägt deshalb ein "# noqa: F821". Zur Laufzeit ist der Name gesetzt.
try:
globals()['_MODDIR'] = os.path.dirname(os.path.abspath(__file__))
except NameError:
Expand All @@ -25,7 +27,7 @@ class KiAssistentCommand:
def GetResources(self):
ki_path = os.path.join(os.path.expanduser("~"), "Schreibtisch",
"Macros", "KI Muli source Assistent")
assets = os.path.join(_MODDIR, "assets")
assets = os.path.join(_MODDIR, "assets") # noqa: F821
icon = ""
for kandidat in (os.path.join(ki_path, "ki_icon.svg"),
os.path.join(assets, "Icon.svg")):
Expand Down Expand Up @@ -89,8 +91,8 @@ def Activated(self):

# ── Pfade einrichten ───────────────────────────────────────────────────────────
def _pfade_einrichten():
if _MODDIR not in sys.path:
sys.path.insert(0, _MODDIR)
if _MODDIR not in sys.path: # noqa: F821
sys.path.insert(0, _MODDIR) # noqa: F821


def _panel_starten():
Expand All @@ -114,7 +116,7 @@ class MeineMakroWorkbench(Gui.Workbench):

def __init__(self):
super().__init__()
self.Icon = os.path.join(_MODDIR, "Icon.svg")
self.Icon = os.path.join(_MODDIR, "Icon.svg") # noqa: F821

def Initialize(self):
# Immer aufgerufen wenn Workbench zum ersten Mal aktiviert wird
Expand Down
1 change: 1 addition & 0 deletions editor/controller/snippet_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"""

import os
import json

from core.qt_compat import QtWidgets, QtCore, QtGui
from core import theme
Expand Down
24 changes: 24 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
"""
conftest.py
───────────
Sammel-Regeln für pytest.

test_editor_live.py startet echte Qt-Widgets und importiert PySide6 bzw.
PySide2 schon beim Laden der Datei. Auf Rechnern ohne Qt — etwa dem
GitHub-Actions-Runner — bricht pytest deshalb bereits beim Einsammeln der
Tests ab, bevor ein einziger Test läuft.

Fehlt Qt, wird die Datei hier übersprungen. Die Qt-freien Tests in
test_back_funktionen.py laufen davon unberührt weiter.
"""

collect_ignore = []

try:
import PySide6 # noqa: F401
except ImportError:
try:
import PySide2 # noqa: F401
except ImportError:
collect_ignore.append("test_editor_live.py")
5 changes: 2 additions & 3 deletions ui/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,8 @@ def _filter_makros(self, text):
sichtbare_ordner.add(rel_low)

anzahl = sum(1 for btn, *_ in self._makro_buttons if btn.isVisible())
if inhalt_modus:
self.status.setText(
f"{anzahl} Treffer – Klick öffnet Datei im Editor")
self.status.setText(
f"{anzahl} Treffer – Klick öffnet Datei im Editor")

for rel_pfad, lbl in self._ordner_labels.items():
rel_low = rel_pfad.lower()
Expand Down
Loading