From 4cfda0c3a58e66e4672c719dc57d9d47b11ad593 Mon Sep 17 00:00:00 2001 From: "luz.paz" Date: Tue, 5 Feb 2019 20:24:25 -0500 Subject: [PATCH] Misc. typos Found via `codespell` --- src/App/CMakeLists.txt | 8 ++--- src/Gui/CallTips.cpp | 28 ++++++++--------- src/Gui/Command.h | 6 ++-- src/Gui/Selection.cpp | 2 +- src/Mod/Draft/DraftTools.py | 8 ++--- src/Mod/Fem/App/FemVTKTools.cpp | 8 ++--- .../Gui/TaskFemConstraintFluidBoundary.cpp | 6 ++-- src/Mod/Fem/TestFem.py | 3 +- src/Mod/Material/Material.py | 2 +- src/Mod/Mesh/App/Core/Simplify.h | 2 +- src/Mod/OpenSCAD/OpenSCADUtils.py | 6 ++-- src/Mod/Part/CompoundTools/Explode.py | 6 ++-- src/Mod/Path/PathTests/TestPathGeom.py | 2 +- src/Mod/Sketcher/Gui/CommandCreateGeo.cpp | 2 +- .../Surface/App/FeatureGeomFillSurface.cpp | 2 +- src/Tools/updatecrowdin.py | 30 +++++++++---------- 16 files changed, 59 insertions(+), 62 deletions(-) diff --git a/src/App/CMakeLists.txt b/src/App/CMakeLists.txt index 5c5decfe13..77f6ddf287 100644 --- a/src/App/CMakeLists.txt +++ b/src/App/CMakeLists.txt @@ -23,15 +23,15 @@ add_definitions(-DBOOST_${Boost_VERSION}) # ----------------------------------------------------------------------------- -#write relevant cmake variables to a file for later access with python. Exportet are all variables -#starting with BUILD. As the variable only exists if the user set it to ON a dict is useless, we -#use a python list for export. +#write relevant cmake variables to a file for later access with python. Exported are all variables +#starting with BUILD. As the variable only exists if the user set it to ON a dict is useless, we +#use a python list for export. set(_vars "const char CMakeVariables[] =\"cmake = [") set(_delim "") get_cmake_property(_variableNames VARIABLES) foreach (_variableName ${_variableNames}) if (${_variableName}) - STRING(REGEX MATCH "^[_]?[^_]*" _prefix "${_variableName}_") + STRING(REGEX MATCH "^[_]?[^_]*" _prefix "${_variableName}_") if(${_prefix} STREQUAL "BUILD") STRING(REPLACE "\\" "\\\\" _name ${_variableName}) set(_vars "${_vars}${_delim}\\n\"\n\"\\\"${_name}\\\"") diff --git a/src/Gui/CallTips.cpp b/src/Gui/CallTips.cpp index d62d8998ea..fd0c637231 100644 --- a/src/Gui/CallTips.cpp +++ b/src/Gui/CallTips.cpp @@ -85,7 +85,7 @@ CallTipsList::CallTipsList(QPlainTextEdit* parent) pal.setColor(QPalette::Inactive, QPalette::HighlightedText, pal.color(QPalette::Active, QPalette::HighlightedText)); parent->setPalette( pal ); - connect(this, SIGNAL(itemActivated(QListWidgetItem *)), + connect(this, SIGNAL(itemActivated(QListWidgetItem *)), this, SLOT(callTipItemActivated(QListWidgetItem *))); hideKeys.append(Qt::Key_Space); @@ -124,7 +124,7 @@ CallTipsList::~CallTipsList() } void CallTipsList::keyboardSearch(const QString& wordPrefix) -{ +{ // first search for the item that matches perfectly for (int i=0; itext(); @@ -189,7 +189,7 @@ QString CallTipsList::extractContext(const QString& line) const (ch == '.') || (ch == '_') || // dot or underscore (ch == ' ') || (ch == '\t')) // whitespace (between dot and text) index = pos; - else + else break; } @@ -251,13 +251,13 @@ QMap CallTipsList::extractTips(const QString& context) const // Checks whether the type is a subclass of PyObjectBase because to get the doc string // of a member we must get it by its type instead of its instance otherwise we get the - // wrong string, namely that of the type of the member. - // Note: 3rd party libraries may use their own type object classes so that we cannot + // wrong string, namely that of the type of the member. + // Note: 3rd party libraries may use their own type object classes so that we cannot // reliably use Py::Type. To be on the safe side we should use Py::Object to assign // the used type object to. //Py::Object type = obj.type(); Py::Object type(PyObject_Type(obj.ptr()), true); - Py::Object inst = obj; // the object instance + Py::Object inst = obj; // the object instance union PyType_Object typeobj = {&Base::PyObjectBase::Type}; union PyType_Object typedoc = {&App::DocumentObjectPy::Type}; union PyType_Object basetype = {&PyBaseObject_Type}; @@ -285,7 +285,7 @@ QMap CallTipsList::extractTips(const QString& context) const #endif else if (PyObject_IsInstance(obj.ptr(), basetype.o) == 1) { // New style class which can be a module, type, list, tuple, int, float, ... - // Make sure it's not a type objec + // Make sure it's not a type object union PyType_Object typetype = {&PyType_Type}; if (PyObject_IsInstance(obj.ptr(), typetype.o) != 1) { // this should be now a user-defined Python class @@ -397,7 +397,7 @@ void CallTipsList::extractTipsFromObject(Py::Object& obj, Py::List& list, QMapstyle()->pixelMetric(QStyle::PM_ScrollBarExtent); setGeometry(posX, posY+fontMetrics().height(), w, h); } - + setCurrentRow(0); show(); } @@ -589,7 +589,7 @@ void CallTipsList::hideEvent(QHideEvent* e) qApp->removeEventFilter(this); } -/** +/** * Get all incoming events of the text edit and redirect some of them, like key up and * down, mouse press events, ... to the widget itself. */ @@ -681,7 +681,7 @@ void CallTipsList::callTipItemActivated(QListWidgetItem *item) { hide(); if (!isItemSelected(item)) return; - + QString text = item->text(); QTextCursor cursor = textEdit->textCursor(); cursor.setPosition(this->cursorPos); @@ -769,4 +769,4 @@ QString CallTipsList::stripWhiteSpace(const QString& str) const return stripped; } -#include "moc_CallTips.cpp" +#include "moc_CallTips.cpp" diff --git a/src/Gui/Command.h b/src/Gui/Command.h index f9bd53f2fb..6139c8cd46 100644 --- a/src/Gui/Command.h +++ b/src/Gui/Command.h @@ -66,14 +66,14 @@ void CreateTestCommands(void); /** The CommandBase class - * This lightweigt class is the base class of all commands in FreeCAD. It represents the link between the FreeCAD + * This lightweight class is the base class of all commands in FreeCAD. It represents the link between the FreeCAD * command framework and the QAction world of Qt. * @author Werner Mayer */ -class GuiExport CommandBase +class GuiExport CommandBase { protected: - CommandBase(const char* sMenu, const char* sToolTip=0, const char* sWhat=0, + CommandBase(const char* sMenu, const char* sToolTip=0, const char* sWhat=0, const char* sStatus=0, const char* sPixmap=0, const char* sAccel=0); virtual ~CommandBase(); diff --git a/src/Gui/Selection.cpp b/src/Gui/Selection.cpp index d4c6e4d2c1..e6c8ebd0ad 100644 --- a/src/Gui/Selection.cpp +++ b/src/Gui/Selection.cpp @@ -371,7 +371,7 @@ std::vector SelectionSingleton::getSelectionEx(const char* pDoc if (It->pDoc == pcDoc) { // right type? if (It->pObject->getTypeId().isDerivedFrom(typeId)){ - // if the object has already an entry + // if the object already has an entry if (SortMap.find(It->pObject) != SortMap.end()){ // only add sub-element if (!It->SubName.empty()) { diff --git a/src/Mod/Draft/DraftTools.py b/src/Mod/Draft/DraftTools.py index 9fb4591aad..924ff751a4 100644 --- a/src/Mod/Draft/DraftTools.py +++ b/src/Mod/Draft/DraftTools.py @@ -77,7 +77,7 @@ MODALT = MODS[Draft.getParam("modalt",2)] def msg(text=None,mode=None): "prints the given message on the FreeCAD status bar" if FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Draft").GetBool("Verbose",True): - if not text: + if not text: FreeCAD.Console.PrintMessage("") else: if mode == 'warning': @@ -779,7 +779,7 @@ class Wire(Line): class BSpline(Line): - "a FreeCAD command for creating a b-spline" + "a FreeCAD command for creating a B-spline" def __init__(self): Line.__init__(self,wiremode=True) @@ -2900,7 +2900,7 @@ class Stretch(Modifier): def proceed(self): if self.call: - self.view.removeEventCallback("SoEvent",self.call) + self.view.removeEventCallback("SoEvent",self.call) supported = ["Rectangle","Wire","BSpline","BezCurve","Sketch"] self.sel = [] for obj in FreeCADGui.Selection.getSelection(): @@ -2910,7 +2910,7 @@ class Stretch(Modifier): if obj.Base: if Draft.getType(obj.Base) in supported: self.sel.append([obj.Base,obj.Placement]) - + elif Draft.getType(obj.Base) in ["Offset2D","Array"]: base = None if hasattr(obj.Base,"Source") and obj.Base.Source: diff --git a/src/Mod/Fem/App/FemVTKTools.cpp b/src/Mod/Fem/App/FemVTKTools.cpp index 99d43867de..8ee9aff132 100644 --- a/src/Mod/Fem/App/FemVTKTools.cpp +++ b/src/Mod/Fem/App/FemVTKTools.cpp @@ -453,7 +453,7 @@ void FemVTKTools::exportVTKMesh(const FemMesh* mesh, vtkSmartPointerX()*scale), double(node->Y()*scale), double(node->Z()*scale)}; points->InsertPoint(node->GetID()-1, coords); // memory is allocated by VTK points size for max node id, not for point count - // if the SMESH mesh has gaps in node numbering, points without any element assignement will be inserted in these point gaps too + // if the SMESH mesh has gaps in node numbering, points without any element assignment will be inserted in these point gaps too // this needs to be taken into account on node mapping when FreeCAD FEM results are exported to vtk } grid->SetPoints(points); @@ -780,7 +780,7 @@ void FemVTKTools::exportFreeCADResult(const App::DocumentObject* result, vtkSmar const Fem::FemResultObject* res = static_cast(result); const vtkIdType nPoints = grid->GetNumberOfPoints(); - // we need the coresponding mesh to get the correct id for the result data (when the freecad smesh mesh has gaps in the points + // we need the corresponding mesh to get the correct id for the result data (when the freecad smesh mesh has gaps in the points // vtk has more points. Vtk does not support point gaps, thus the gaps are filled with points. Then the mapping must be correct) App::DocumentObject* meshObj = res->Mesh.getValue(); if (!meshObj || !meshObj->isDerivedFrom(FemMeshObject::getClassTypeId())) { @@ -807,7 +807,7 @@ void FemVTKTools::exportFreeCADResult(const App::DocumentObject* result, vtkSmar data->SetNumberOfTuples(nPoints); data->SetName(it->c_str()); - //we need to set values for the unused points. + //we need to set values for the unused points. //TODO: ensure that the result bar does not include the used 0 if it is not part of the result (e.g. does the result bar show 0 as smallest value?) if (nPoints != field->getSize()) { double tuple[] = {0,0,0}; @@ -844,7 +844,7 @@ void FemVTKTools::exportFreeCADResult(const App::DocumentObject* result, vtkSmar data->SetNumberOfValues(nPoints); data->SetName(it->c_str()); - //we need to set values for the unused points. + //we need to set values for the unused points. //TODO: ensure that the result bar does not include the used 0 if it is not part of the result (e.g. does the result bar show 0 as smallest value?) if (nPoints != field->getSize()) { for (vtkIdType i=0; i fem = pcAnalysis->Group.getValues(); for (std::vector::iterator it = fem.begin(); it != fem.end(); ++it) { @@ -620,7 +620,7 @@ void TaskFemConstraintFluidBoundary::onSelectionChanged(const Gui::SelectionChan void TaskFemConstraintFluidBoundary::onBoundaryTypeChanged(void) { Fem::ConstraintFluidBoundary* pcConstraint = static_cast(ConstraintView->getObject()); - // temperarily change BoundaryType property, but command transaction should reset it back if you 'reject' late + // temporarily change BoundaryType property, but command transaction should reset it back if you 'reject' late pcConstraint->BoundaryType.setValue(ui->comboBoundaryType->currentIndex()); updateBoundaryTypeUI(); @@ -675,7 +675,7 @@ void TaskFemConstraintFluidBoundary::onButtonDirection(const bool pressed) { Gui::Selection().clearSelection(); /* minor bug: once Direction property(edge link) is cleared in UI, arrow direction is not updated. Direction property can not be easily setup in C++, see example at the end of this file `accept()` - redraw will only happen once taskpanel is closed, + redraw will only happen once taskpanel is closed, */ //pcConstraint->Direction.setValue(pressed); } diff --git a/src/Mod/Fem/TestFem.py b/src/Mod/Fem/TestFem.py index 5b46db7708..55b8418000 100644 --- a/src/Mod/Fem/TestFem.py +++ b/src/Mod/Fem/TestFem.py @@ -87,7 +87,7 @@ unittest.TextTestRunner().run(mytest) # open files from FEM test suite source code # be careful on updating these files, they consist the original results! -# TODO update files, becaus some of them have non existing FEM object classes +# TODO update files, because some of them have non-existing FEM object classes doc = FreeCAD.open(FreeCAD.ConfigGet("AppHomePath") + 'Mod/Fem/femtest/testfiles/ccx/cube.FCStd') doc = FreeCAD.open(FreeCAD.ConfigGet("AppHomePath") + 'Mod/Fem/femtest/testfiles/ccx/cube_frequency.FCStd') doc = FreeCAD.open(FreeCAD.ConfigGet("AppHomePath") + 'Mod/Fem/femtest/testfiles/ccx/cube_static.FCStd') @@ -114,4 +114,3 @@ doc = FreeCAD.open(FreeCAD.ConfigGet("AppHomePath") + 'data/examples/Fem.FCStd') doc = FreeCAD.open(FreeCAD.ConfigGet("AppHomePath") + 'data/examples/Fem2.FCStd') ''' - diff --git a/src/Mod/Material/Material.py b/src/Mod/Material/Material.py index 8dca1ea6ce..311ec69cfc 100644 --- a/src/Mod/Material/Material.py +++ b/src/Mod/Material/Material.py @@ -100,7 +100,7 @@ def getMaterialAttributeStructure(withSpaces=None): '''''' # material properties - # see the following resources in the FreeCAD wiki for more informations about the material specific properties: + # see the following resources in the FreeCAD wiki for more information about the material specific properties: # https://www.freecadweb.org/wiki/Material_data_model # https://www.freecadweb.org/wiki/Material diff --git a/src/Mod/Mesh/App/Core/Simplify.h b/src/Mod/Mesh/App/Core/Simplify.h index 02ebaaeef9..d2a929b466 100644 --- a/src/Mod/Mesh/App/Core/Simplify.h +++ b/src/Mod/Mesh/App/Core/Simplify.h @@ -106,7 +106,7 @@ private: // // target_count : target nr. of triangles // tolerance : tolerance for the quadratic errors -// aggressiveness : sharpness to increase the threashold. +// aggressiveness : sharpness to increase the threshold. // 5..8 are good numbers // more iterations yield higher quality // If the passed tolerance is > 0 then this will be used to check diff --git a/src/Mod/OpenSCAD/OpenSCADUtils.py b/src/Mod/OpenSCAD/OpenSCADUtils.py index b3b8f10ce0..0436512d77 100644 --- a/src/Mod/OpenSCAD/OpenSCADUtils.py +++ b/src/Mod/OpenSCAD/OpenSCADUtils.py @@ -418,7 +418,7 @@ def callopenscadmeshstring(scadstr): def meshopinline(opname,iterable1): """uses OpenSCAD to combine meshes - takes the name of the CGAL operation and an iterable (tuple,list) of + takes the name of the CGAL operation and an iterable (tuple,list) of FreeCAD Mesh objects includes all the mesh data in the SCAD file """ @@ -428,7 +428,7 @@ def meshopinline(opname,iterable1): def meshoptempfile(opname,iterable1): """uses OpenSCAD to combine meshes - takes the name of the CGAL operation and an iterable (tuple,list) of + takes the name of the CGAL operation and an iterable (tuple,list) of FreeCAD Mesh objects uses stl files to supply the mesh data """ @@ -554,7 +554,7 @@ def process3D_ObjectsViaOpenSCADShape(ObjList,Operation,maxmeshpoints=None): def process3D_ObjectsViaOpenSCAD(doc,ObjList,Operation): solid = process3D_ObjectsViaOpenSCADShape(ObjList,Operation) if solid is not None: - obj=doc.addObject('Part::Feature',Operation) #non parametric objec + obj=doc.addObject('Part::Feature',Operation) #non-parametric object obj.Shape=solid#.removeSplitter() if FreeCAD.GuiUp: for index in ObjList : diff --git a/src/Mod/Part/CompoundTools/Explode.py b/src/Mod/Part/CompoundTools/Explode.py index c0e51878e5..546e323583 100644 --- a/src/Mod/Part/CompoundTools/Explode.py +++ b/src/Mod/Part/CompoundTools/Explode.py @@ -1,7 +1,7 @@ -from .CompoundFilter import makeCompoundFilter +from .CompoundFilter import makeCompoundFilter def explodeCompound(compound_obj, b_group = None): - """explodeCompound(compound_obj, b_group = None): creates a bunch of compound filters, to extract every child of a compount into a separate object. + """explodeCompound(compound_obj, b_group = None): creates a bunch of compound filters, to extract every child of a compound into a separate object. group: if True, Group is always made. If False, group is never made. If None, group is made if there is more than one child. returns: (group_object, list_of_child_objects)""" sh = compound_obj.Shape @@ -10,7 +10,7 @@ def explodeCompound(compound_obj, b_group = None): b_group = n > 1 if b_group: group = compound_obj.Document.addObject('App::DocumentObjectGroup','GrExplode_'+compound_obj.Name) - group.Label = 'Exploded {obj.Label}'.format(obj = compound_obj) + group.Label = 'Exploded {obj.Label}'.format(obj = compound_obj) else: group = compound_obj.Document features_created = [] diff --git a/src/Mod/Path/PathTests/TestPathGeom.py b/src/Mod/Path/PathTests/TestPathGeom.py index bb175760b6..86b5550cc1 100644 --- a/src/Mod/Path/PathTests/TestPathGeom.py +++ b/src/Mod/Path/PathTests/TestPathGeom.py @@ -495,7 +495,7 @@ class TestPathGeom(PathTestBase): self.assertEdgeShapesMatch(edge, PathGeom.flipEdge(edge)) def test75(self): - '''Flip a b-spline''' + '''Flip a B-spline''' spline = Part.BSplineCurve() spline.interpolate([Vector(1,2,3), Vector(-3,0,7), Vector(-3,1,9), Vector(1, 3, 5)]) edge = Part.Edge(spline) diff --git a/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp b/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp index 977eb76f68..4d082a468c 100644 --- a/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp +++ b/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp @@ -4725,7 +4725,7 @@ public: // as the ones created by this tool are intended for the b-spline endpoints, and not for the poles, // so here we retrieve any autoconstraint on those poles' center and mangle it to the endpoint. if (ConstrMethod == 0) { - + for(auto & constr : static_cast(sketchgui->getObject())->Constraints.getValues()) { if(constr->First == FirstPoleGeoId && constr->FirstPos == Sketcher::mid) { constr->First = currentgeoid; diff --git a/src/Mod/Surface/App/FeatureGeomFillSurface.cpp b/src/Mod/Surface/App/FeatureGeomFillSurface.cpp index 733f34e5a9..28eedc3630 100644 --- a/src/Mod/Surface/App/FeatureGeomFillSurface.cpp +++ b/src/Mod/Surface/App/FeatureGeomFillSurface.cpp @@ -335,7 +335,7 @@ void GeomFillSurface::createBSplineSurface(TopoDS_Wire& aWire) curves.push_back(bspline); } else { - // try to convert it into a b-spline + // try to convert it into a B-spline BRepBuilderAPI_NurbsConvert mkNurbs(edge); TopoDS_Edge nurbs = TopoDS::Edge(mkNurbs.Shape()); // avoid copying diff --git a/src/Tools/updatecrowdin.py b/src/Tools/updatecrowdin.py index 93ca3f8f6f..da90646273 100755 --- a/src/Tools/updatecrowdin.py +++ b/src/Tools/updatecrowdin.py @@ -2,7 +2,7 @@ #*************************************************************************** #* * -#* Copyright (c) 2015 Yorik van Havre * +#* Copyright (c) 2015 Yorik van Havre * #* * #* This program is free software; you can redistribute it and/or modify * #* it under the terms of the GNU Library General Public License (LGPL) * @@ -32,14 +32,14 @@ the API key that gives access to the crowdin FreeCAD project. Usage: updatecrowdin.py command - + Available commands: status: prints a status of the translations update: updates crowdin the current version of .ts files found in the source code - build: builds a new downloadable package on crowdin with all trasnlated strings + build: builds a new downloadable package on crowdin with all translated strings download: downloads the latest build - + Example: ./updatecrowdin.py update @@ -84,7 +84,7 @@ files = [ ["Arch.ts", "/Mod/Arch/Resources/translations/Arch.ts"], # handler for the command responses class ResponseHandler( xml.sax.ContentHandler ): - + def __init__(self): self.current = "" self.data = "" @@ -120,14 +120,14 @@ class ResponseHandler( xml.sax.ContentHandler ): if __name__ == "__main__": - + # only one argument allowed arg = sys.argv[1:] if len(arg) != 1: print(__doc__) sys.exit() arg = arg[0] - + # getting API key stored in ~/.crowdin-freecad configfile = os.path.expanduser("~")+os.sep+".crowdin-freecad" if not os.path.exists(configfile): @@ -137,35 +137,35 @@ if __name__ == "__main__": url = "https://api.crowdin.com/api/project/freecad/" key = "?key="+f.read().strip() f.close() - + if arg == "status": c = pycurl.Curl() c.setopt(pycurl.URL, url+"status"+key+"&xml") b = StringIO.StringIO() - c.setopt(pycurl.WRITEFUNCTION, b.write) + c.setopt(pycurl.WRITEFUNCTION, b.write) c.perform() c.close() handler = ResponseHandler() xml.sax.parseString(b.getvalue(),handler) print(handler.data) - + elif arg == "build": print("Building (warning, this can be invoked only once per 30 minutes)...") c = pycurl.Curl() c.setopt(pycurl.URL, url+"export"+key) b = StringIO.StringIO() - c.setopt(pycurl.WRITEFUNCTION, b.write) + c.setopt(pycurl.WRITEFUNCTION, b.write) c.perform() c.close() handler = ResponseHandler() xml.sax.parseString(b.getvalue(),handler) print(handler.data) - + elif arg == "download": print("Downloading all.zip in current directory...") cmd = "wget -O freecad.zip "+url+"download/all.zip"+key os.system(cmd) - + elif arg == "update": basepath = os.path.dirname(os.path.abspath(".")) for f in files: @@ -175,7 +175,7 @@ if __name__ == "__main__": c.setopt(pycurl.URL, url+"update-file"+key) c.setopt(pycurl.HTTPPOST, fields) b = StringIO.StringIO() - c.setopt(pycurl.WRITEFUNCTION, b.write) + c.setopt(pycurl.WRITEFUNCTION, b.write) c.perform() c.close() handler = ResponseHandler() @@ -184,5 +184,3 @@ if __name__ == "__main__": else: print(__doc__) - -