diff --git a/src/Mod/Path/PathScripts/PathPreferencesPathDressup.py b/src/Mod/Path/PathScripts/PathPreferencesPathDressup.py index 1285546204..ce00ad56e9 100644 --- a/src/Mod/Path/PathScripts/PathPreferencesPathDressup.py +++ b/src/Mod/Path/PathScripts/PathPreferencesPathDressup.py @@ -20,26 +20,28 @@ # * * # *************************************************************************** +import FreeCAD from PySide import QtCore, QtGui -# Qt translation handling -def translate(context, text, disambig=None): - return QtCore.QCoreApplication.translate(context, text, disambig) +translate = FreeCAD.Qt.translate + _dressups = [] + def RegisterDressup(dressup): _dressups.append(dressup) + class DressupPreferencesPage: def __init__(self, parent=None): # pylint: disable=unused-argument self.form = QtGui.QToolBox() - self.form.setWindowTitle(translate("Path_PreferencesPathDressup", 'Dressups')) + self.form.setWindowTitle(translate("Path_PreferencesPathDressup", "Dressups")) pages = [] for dressup in _dressups: page = dressup.preferencesPage() - if hasattr(page, 'icon') and page.icon: + if hasattr(page, "icon") and page.icon: self.form.addItem(page.form, page.icon, page.label) else: self.form.addItem(page.form, page.label) @@ -53,4 +55,3 @@ class DressupPreferencesPage: def loadSettings(self): for page in self.pages: page.loadSettings() - diff --git a/src/Mod/Path/PathScripts/PathProfileContourGui.py b/src/Mod/Path/PathScripts/PathProfileContourGui.py index 465ac16cab..89ecb38ad6 100644 --- a/src/Mod/Path/PathScripts/PathProfileContourGui.py +++ b/src/Mod/Path/PathScripts/PathProfileContourGui.py @@ -25,28 +25,31 @@ import FreeCAD import PathScripts.PathOpGui as PathOpGui import PathScripts.PathProfile as PathProfile import PathScripts.PathProfileGui as PathProfileGui -from PySide import QtCore - +from PySide.QtCore import QT_TRANSLATE_NOOP __title__ = "Path Contour Operation UI (depreciated)" __author__ = "sliptonic (Brad Collette)" __url__ = "https://www.freecadweb.org" -__doc__ = "Contour operation page controller and command implementation (depreciated)." +__doc__ = "Contour operation page controller and command implementation (deprecated)." class TaskPanelOpPage(PathProfileGui.TaskPanelOpPage): - '''Psuedo page controller class for Profile operation, - allowing for backward compatibility with pre-existing "Contour" operations.''' + """Psuedo page controller class for Profile operation, + allowing for backward compatibility with pre-existing "Contour" operations.""" + pass -# Eclass -Command = PathOpGui.SetupOperation('Profile', - PathProfile.Create, - TaskPanelOpPage, - 'Path_Contour', - QtCore.QT_TRANSLATE_NOOP("Path_Profile", "Profile"), - QtCore.QT_TRANSLATE_NOOP("Path_Profile", "Profile entire model, selected face(s) or selected edge(s)"), - PathProfile.SetupProperties) +Command = PathOpGui.SetupOperation( + "Profile", + PathProfile.Create, + TaskPanelOpPage, + "Path_Contour", + QT_TRANSLATE_NOOP("Path_Profile", "Profile"), + QT_TRANSLATE_NOOP( + "Path_Profile", "Profile entire model, selected face(s) or selected edge(s)" + ), + PathProfile.SetupProperties, +) FreeCAD.Console.PrintLog("Loading PathProfileContourGui... done\n") diff --git a/src/Mod/Path/PathScripts/PathProfileEdgesGui.py b/src/Mod/Path/PathScripts/PathProfileEdgesGui.py index e893e65ef0..fae0f913f1 100644 --- a/src/Mod/Path/PathScripts/PathProfileEdgesGui.py +++ b/src/Mod/Path/PathScripts/PathProfileEdgesGui.py @@ -25,28 +25,33 @@ import FreeCAD import PathScripts.PathOpGui as PathOpGui import PathScripts.PathProfile as PathProfile import PathScripts.PathProfileGui as PathProfileGui -from PySide import QtCore - +from PySide.QtCore import QT_TRANSLATE_NOOP __title__ = "Path Profile Edges Operation UI (depreciated)" __author__ = "sliptonic (Brad Collette)" __url__ = "https://www.freecadweb.org" -__doc__ = "Profile Edges operation page controller and command implementation (depreciated)." +__doc__ = ( + "Profile Edges operation page controller and command implementation (deprecated)." +) class TaskPanelOpPage(PathProfileGui.TaskPanelOpPage): - '''Psuedo page controller class for Profile operation, - allowing for backward compatibility with pre-existing "Profile Edges" operations.''' + """Psuedo page controller class for Profile operation, + allowing for backward compatibility with pre-existing "Profile Edges" operations.""" + pass -# Eclass -Command = PathOpGui.SetupOperation('Profile', - PathProfile.Create, - TaskPanelOpPage, - 'Path_Contour', - QtCore.QT_TRANSLATE_NOOP("Path_Profile", "Profile"), - QtCore.QT_TRANSLATE_NOOP("Path_Profile", "Profile entire model, selected face(s) or selected edge(s)"), - PathProfile.SetupProperties) +Command = PathOpGui.SetupOperation( + "Profile", + PathProfile.Create, + TaskPanelOpPage, + "Path_Contour", + QT_TRANSLATE_NOOP("Path_Profile", "Profile"), + QT_TRANSLATE_NOOP( + "Path_Profile", "Profile entire model, selected face(s) or selected edge(s)" + ), + PathProfile.SetupProperties, +) FreeCAD.Console.PrintLog("Loading PathProfileEdgesGui... done\n") diff --git a/src/Mod/Path/PathScripts/PathProfileFacesGui.py b/src/Mod/Path/PathScripts/PathProfileFacesGui.py index 69bfdbf459..f3bd9814a7 100644 --- a/src/Mod/Path/PathScripts/PathProfileFacesGui.py +++ b/src/Mod/Path/PathScripts/PathProfileFacesGui.py @@ -25,28 +25,33 @@ import FreeCAD import PathScripts.PathOpGui as PathOpGui import PathScripts.PathProfile as PathProfile import PathScripts.PathProfileGui as PathProfileGui -from PySide import QtCore - +from PySide.QtCore import QT_TRANSLATE_NOOP __title__ = "Path Profile Faces Operation UI (depreciated)" __author__ = "sliptonic (Brad Collette)" __url__ = "https://www.freecadweb.org" -__doc__ = "Profile Faces operation page controller and command implementation (depreciated)." +__doc__ = ( + "Profile Faces operation page controller and command implementation (deprecated)." +) class TaskPanelOpPage(PathProfileGui.TaskPanelOpPage): - '''Psuedo page controller class for Profile operation, - allowing for backward compatibility with pre-existing "Profile Faces" operations.''' + """Psuedo page controller class for Profile operation, + allowing for backward compatibility with pre-existing "Profile Faces" operations.""" + pass -# Eclass -Command = PathOpGui.SetupOperation('Profile', - PathProfile.Create, - TaskPanelOpPage, - 'Path_Contour', - QtCore.QT_TRANSLATE_NOOP("Path_Profile", "Profile"), - QtCore.QT_TRANSLATE_NOOP("Path_Profile", "Profile entire model, selected face(s) or selected edge(s)"), - PathProfile.SetupProperties) +Command = PathOpGui.SetupOperation( + "Profile", + PathProfile.Create, + TaskPanelOpPage, + "Path_Contour", + QT_TRANSLATE_NOOP("Path_Profile", "Profile"), + QT_TRANSLATE_NOOP( + "Path_Profile", "Profile entire model, selected face(s) or selected edge(s)" + ), + PathProfile.SetupProperties, +) FreeCAD.Console.PrintLog("Loading PathProfileFacesGui... done\n")