Skip to content

Commit 24ea892

Browse files
authored
Merge pull request #61 from FreeCAD/dev
Merge dev to main
2 parents 8e1332d + f90227e commit 24ea892

File tree

4 files changed

+12
-22
lines changed

4 files changed

+12
-22
lines changed

CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,6 @@ SET(AddonManagerResourceFilesTranslations
144144
Resources/translations/AddonManager_zh-TW.qm
145145
)
146146

147-
LIST(APPEND AddonManager_SRCS
148-
${AddonManagerResourceFilesIcons}
149-
${AddonManagerResourceFilesLicenses}
150-
${AddonManagerResourceFilesTranslations}
151-
)
152-
153147
SET(AddonManagerResourceFilesLicenses
154148
Resources/licenses/Apache-2.0.txt
155149
Resources/licenses/BSD-2-Clause.txt
@@ -164,6 +158,12 @@ SET(AddonManagerResourceFilesLicenses
164158
Resources/licenses/spdx.json
165159
)
166160

161+
LIST(APPEND AddonManager_SRCS
162+
${AddonManagerResourceFilesIcons}
163+
${AddonManagerResourceFilesLicenses}
164+
${AddonManagerResourceFilesTranslations}
165+
)
166+
167167
SET(AddonManagerTests_SRCS
168168
AddonManagerTest/__init__.py
169169
AddonManagerTest/test_information.md

addonmanager_devmode.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
from addonmanager_devmode_predictor import Predictor
3737
from addonmanager_devmode_people_table import PeopleTable
3838
from addonmanager_devmode_licenses_table import LicensesTable
39-
from addonmanager_utilities import get_python_exe
4039

4140
from addonmanager_metadata import Metadata, MetadataReader
4241

@@ -602,7 +601,7 @@ def _ensure_vermin_loaded(self) -> bool:
602601
fci.Console.PrintMessage(
603602
translate("AddonsInstaller", "Attempting to install Vermin from PyPi") + "...\n"
604603
)
605-
python_exe = get_python_exe()
604+
python_exe = fci.get_python_exe()
606605
vendor_path = os.path.join(fci.DataPaths().data_dir, "AdditionalPythonPackages")
607606
if not os.path.exists(vendor_path):
608607
os.makedirs(vendor_path)

addonmanager_python_deps_gui.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,6 @@ def loadUi(ui_file: str) -> QtWidgets.QWidget:
6464
return loader.load(ui_file)
6565

6666

67-
try:
68-
from freecad.utils import get_python_exe
69-
except ImportError:
70-
71-
def get_python_exe():
72-
return shutil.which("python")
73-
74-
7567
import addonmanager_utilities as utils
7668

7769
translate = fci.translate

addonmanager_toolbar_adapter.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ class ToolbarAdapter:
2323
params = None
2424

2525
def __init__(self):
26-
if self.params is None:
27-
self.params = fci.ParamGet("User parameter:BaseApp/Workbench/Global/Toolbar")
28-
if fci.FreeCAD is not None:
26+
if fci.FreeCAD is None:
2927
raise RuntimeError("ToolbarAdapter can only be used when run from within FreeCAD")
28+
if self.params is None:
29+
self.params = fci.FreeCAD.ParamGet("User parameter:BaseApp/Workbench/Global/Toolbar")
3030

3131
def get_toolbars(self):
3232
"""Get a list of toolbars: the result is a set of parameter groups, each representing a toolbar."""
@@ -45,7 +45,7 @@ def create_new_custom_toolbar(self):
4545
# unique.
4646

4747
# First, the displayed name
48-
custom_toolbar_name = QT_TRANSLATE_NOOP("Workbench", "Auto-Created Macro Toolbar")
48+
custom_toolbar_name = str(QT_TRANSLATE_NOOP("Workbench", "Auto-Created Macro Toolbar"))
4949
custom_toolbars = self.params.GetGroups()
5050
name_taken = self.check_for_toolbar(custom_toolbar_name)
5151
if name_taken:
@@ -87,7 +87,6 @@ def get_toolbar_with_name(self, name: str):
8787

8888
@staticmethod
8989
def create_custom_command(
90-
cls,
9190
toolbar,
9291
filename,
9392
menu_text,
@@ -132,6 +131,6 @@ def get_custom_toolbars(self):
132131
return self.params.GetGroups()
133132

134133
@staticmethod
135-
def find_custom_command(cls, filename):
134+
def find_custom_command(filename):
136135
"""Wrap calls to FreeCADGui.Command.findCustomCommand so it can be faked in testing."""
137136
return fci.FreeCADGui.Command.findCustomCommand(filename)

0 commit comments

Comments
 (0)