From 6718d8797e7be602d55bdb5d395fabde56c6d587 Mon Sep 17 00:00:00 2001 From: luz paz Date: Sat, 12 Feb 2022 07:58:39 -0500 Subject: [PATCH] Fix some typos and whitespace --- src/Base/PyExport.h | 2 +- src/Mod/Mesh/App/MeshPy.xml | 2 +- .../Path/PathScripts/PathSurfaceSupport.py | 2 +- src/Mod/Robot/App/kdl_cp/solveri.hpp | 2 +- src/Mod/TechDraw/Gui/CommandExtensionDims.cpp | 2 +- src/Mod/TechDraw/Gui/CommandExtensionPack.cpp | 22 +++++++++---------- src/Tools/_TEMPLATEPY_/InitGui.py | 4 ++-- src/Tools/_TEMPLATE_/InitGui.py | 20 +++++++++-------- 8 files changed, 29 insertions(+), 27 deletions(-) diff --git a/src/Base/PyExport.h b/src/Base/PyExport.h index 2a43bcbefd..6348aee352 100644 --- a/src/Base/PyExport.h +++ b/src/Base/PyExport.h @@ -79,7 +79,7 @@ class PyObjectBase; * @remark One big consequence of this specification is that the programmer must know whether the Python interpreter * gets the Python object or not. If the interpreter gets the object then it decrements the counter later on when * the internal variable is freed. In case the interpreter doesn't get this object then the programmer must do the - * decrement on his own. + * decrement on their own. * * @note To not to undermine this specification the programmer must make sure to get the Python object always via * GetPyObject(). diff --git a/src/Mod/Mesh/App/MeshPy.xml b/src/Mod/Mesh/App/MeshPy.xml index 6ae3ecdf79..0ea21cddbf 100644 --- a/src/Mod/Mesh/App/MeshPy.xml +++ b/src/Mod/Mesh/App/MeshPy.xml @@ -523,7 +523,7 @@ an empty dictionary if there is no intersection. getPlanarSegments(dev,[min faces=0]) -> list Get all planes of the mesh as segment. In the worst case each triangle can be regarded as single -plane if none of its neighours is coplanar. +plane if none of its neighbours is coplanar. diff --git a/src/Mod/Path/PathScripts/PathSurfaceSupport.py b/src/Mod/Path/PathScripts/PathSurfaceSupport.py index 8ba42c20b4..b81b039f9d 100644 --- a/src/Mod/Path/PathScripts/PathSurfaceSupport.py +++ b/src/Mod/Path/PathScripts/PathSurfaceSupport.py @@ -1987,7 +1987,7 @@ class FindUnifiedRegions: tfBB_Area = tfBB.XLength * tfBB.YLength # self._showShape(topFace, 'topFaceAlt_2_{}'.format(fNum)) if tfBB_Area < (fBB_Area * 0.9): - msg = "Faild to extract processing region for Face {}\n".format( + msg = "Failed to extract processing region for Face {}\n".format( fNum ) FreeCAD.Console.PrintError(msg) diff --git a/src/Mod/Robot/App/kdl_cp/solveri.hpp b/src/Mod/Robot/App/kdl_cp/solveri.hpp index 63775e8ac7..b2e37df3c6 100644 --- a/src/Mod/Robot/App/kdl_cp/solveri.hpp +++ b/src/Mod/Robot/App/kdl_cp/solveri.hpp @@ -36,7 +36,7 @@ namespace KDL { * class MySolver : public SolverI * { * public: - * static const int E_CHILDFAILD = xxx; + * static const int E_CHILDFAILED = xxx; * * MySolver(SomeOtherSolver& other); * virtual ~MySolver(); diff --git a/src/Mod/TechDraw/Gui/CommandExtensionDims.cpp b/src/Mod/TechDraw/Gui/CommandExtensionDims.cpp index 834c080c2c..bfe5a60b89 100644 --- a/src/Mod/TechDraw/Gui/CommandExtensionDims.cpp +++ b/src/Mod/TechDraw/Gui/CommandExtensionDims.cpp @@ -156,7 +156,7 @@ CmdTechDrawExtensionInsertDiameter::CmdTechDrawExtensionInsertDiameter() void CmdTechDrawExtensionInsertDiameter::activated(int iMsg) { Q_UNUSED(iMsg); - execInsertPrefixChar(this, "⌀"); + execInsertPrefixChar(this, "⌀"); } bool CmdTechDrawExtensionInsertDiameter::isActive(void) diff --git a/src/Mod/TechDraw/Gui/CommandExtensionPack.cpp b/src/Mod/TechDraw/Gui/CommandExtensionPack.cpp index 1c3e22b81a..d6d7eeafcb 100644 --- a/src/Mod/TechDraw/Gui/CommandExtensionPack.cpp +++ b/src/Mod/TechDraw/Gui/CommandExtensionPack.cpp @@ -1640,7 +1640,7 @@ CmdTechDrawExtendShortenLineGroup::CmdTechDrawExtendShortenLineGroup() void CmdTechDrawExtendShortenLineGroup::activated(int iMsg) { - // Base::Console().Message("CMD::ExtendShortenLineGroup - activated(%d)\n", iMsg); + // Base::Console().Message("CMD::ExtendShortenLineGroup - activated(%d)\n", iMsg); Gui::TaskView::TaskDialog* dlg = Gui::Control().activeDialog(); if (dlg != nullptr) { QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Task In Progress"), @@ -1772,7 +1772,7 @@ void CmdTechDrawExtensionAreaAnnotation::activated(int iMsg) std::static_pointer_cast(faceEdges[n]); if ((nextEdge->points.at(0)-facePoints.back()).Length() < 0.01) facePoints.push_back(nextEdge->points.at(1)); - else + else facePoints.push_back(nextEdge->points.at(0)); } facePoints.push_back(facePoints.front()); @@ -1789,10 +1789,10 @@ void CmdTechDrawExtensionAreaAnnotation::activated(int iMsg) } faceArea = abs(faceArea)/2.0; totalArea = totalArea + faceArea; - totalPoints = totalPoints + facePoints.size(); + totalPoints = totalPoints + facePoints.size(); } } - // if area calculation was successfull, wie start the command + // if area calculation was successful, start the command Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Calculate Face Area")); // at first we create the balloon std::string balloonName = _createBalloon(this, objFeat); @@ -1800,15 +1800,15 @@ void CmdTechDrawExtensionAreaAnnotation::activated(int iMsg) balloon = dynamic_cast(this->getDocument()->getObject(balloonName.c_str())); if (!balloon) throw Base::TypeError("CmdTechDrawNewBalloon - balloon not found\n"); - // the balloon has been created successfull - // we calculate needed variables + // the balloon has been created successfully + // calculate needed variables double scale = objFeat->getScale(); totalArea = totalArea*10*10; // Todo: get factor cm->mm if cm set std::stringstream balloonText; balloonText << " " << totalArea << " cm2 "; xCenter = (xCenter/totalPoints)/scale; yCenter = (yCenter/totalPoints)/scale; - // we set the attributes in the data tab's fields + // set the attributes in the data tab's fields balloon->SourceView.setValue(objFeat); balloon->BubbleShape.setValue("Rectangle"); balloon->EndType.setValue("None"); @@ -1820,14 +1820,14 @@ void CmdTechDrawExtensionAreaAnnotation::activated(int iMsg) balloon->ShapeScale.setValue(0.75); balloon->ScaleType.setValue("Page"); balloon->Text.setValue(balloonText.str()); - // we look for the ballons's view provider + // look for the ballons's view provider TechDraw::DrawPage* page = objFeat->findParentPage(); Gui::Document* guiDoc = Gui::Application::Instance->getDocument(page->getDocument()); auto viewProvider = static_cast(guiDoc->getViewProvider(balloon)); if (viewProvider) { - // view provider successfull found, - // we set the attributes in the view tab's fields + // view provider successfully found, + // set the attributes in the view tab's fields viewProvider->Fontsize.setValue(2.0); viewProvider->LineWidth.setValue(0.75); viewProvider->LineVisible.setValue(false); @@ -1868,7 +1868,7 @@ namespace TechDrawGui { std::string pageName = viewPage->getDrawPage()->getNameInDocument(); cmd->doCommand(cmd->Doc, "App.activeDocument().addObject('TechDraw::DrawViewBalloon','%s')", featName.c_str()); - cmd->doCommand(cmd->Doc, "App.activeDocument().%s.addView(App.activeDocument().%s)", + cmd->doCommand(cmd->Doc, "App.activeDocument().%s.addView(App.activeDocument().%s)", pageName.c_str(), featName.c_str()); return featName; } diff --git a/src/Tools/_TEMPLATEPY_/InitGui.py b/src/Tools/_TEMPLATEPY_/InitGui.py index 7eeb8dc3e3..20212e8a54 100644 --- a/src/Tools/_TEMPLATEPY_/InitGui.py +++ b/src/Tools/_TEMPLATEPY_/InitGui.py @@ -8,13 +8,13 @@ class _TEMPLATEPY_Workbench ( Workbench ): Icon = FreeCAD.getUserAppDataDir() + "Mod/_TEMPLATEPY_/Resources/icons/_TEMPLATEPY_Workbench.svg" MenuText = "_TEMPLATEPY_" ToolTip = "_TEMPLATEPY_ workbench" - + def Initialize(self): # load the module import _TEMPLATEPY_Gui self.appendToolbar('_TEMPLATEPY_',['_TEMPLATEPY__HelloWorld']) self.appendMenu('_TEMPLATEPY_',['_TEMPLATEPY__HelloWorld']) - + def GetClassName(self): return "Gui::PythonWorkbench" diff --git a/src/Tools/_TEMPLATE_/InitGui.py b/src/Tools/_TEMPLATE_/InitGui.py index c3df493b6b..d0a28f1ac0 100644 --- a/src/Tools/_TEMPLATE_/InitGui.py +++ b/src/Tools/_TEMPLATE_/InitGui.py @@ -1,14 +1,16 @@ # _TEMPLATE_ gui init module # (c) 2001 Juergen Riegel LGPL -class _TEMPLATE_Workbench ( Workbench ): - "_TEMPLATE_ workbench object" - MenuText = "_TEMPLATE_" - ToolTip = "_TEMPLATE_ workbench" - def Initialize(self): - # load the module - import _TEMPLATE_Gui - def GetClassName(self): - return "_TEMPLATE_Gui::Workbench" +class _TEMPLATE_Workbench (Workbench): + "_TEMPLATE_ workbench object" + MenuText = "_TEMPLATE_" + ToolTip = "_TEMPLATE_ workbench" + + def Initialize(self): + # load the module + import _TEMPLATE_Gui + + def GetClassName(self): + return "_TEMPLATE_Gui::Workbench" Gui.addWorkbench(_TEMPLATE_Workbench())