From 47e3162dcb42857f321829a58b63e53a5d3e66f5 Mon Sep 17 00:00:00 2001 From: Frank Martinez Date: Fri, 26 Sep 2025 09:29:30 -0500 Subject: [PATCH] [bindings] re-shape some keyword-only signatures --- src/App/DocumentObject.pyi | 3 +-- src/Base/Vector.pyi | 2 +- src/Gui/Command.pyi | 10 ++++++++-- src/Gui/ViewProvider.pyi | 5 ++--- src/Mod/Part/App/GeometrySurface.pyi | 5 ++--- src/Mod/Part/App/HLRBRep/HLRBRep_Algo.pyi | 1 - src/Mod/Part/App/HLRBRep/HLRBRep_PolyAlgo.pyi | 1 - src/Mod/Part/App/HLRBRep/HLRToShape.pyi | 2 +- src/Mod/Part/App/TopoShape.pyi | 13 +++++++++---- src/Mod/Part/App/TopoShapeFace.pyi | 10 ++++++++-- src/Mod/Part/App/TopoShapeWire.pyi | 11 ++++++++--- 11 files changed, 40 insertions(+), 23 deletions(-) diff --git a/src/App/DocumentObject.pyi b/src/App/DocumentObject.pyi index 917cbcdff4..d9700c2c70 100644 --- a/src/App/DocumentObject.pyi +++ b/src/App/DocumentObject.pyi @@ -67,7 +67,6 @@ class DocumentObject(ExtensionContainer): def addProperty( self, - *, type: str, name: str, group: str = "", @@ -159,8 +158,8 @@ class DocumentObject(ExtensionContainer): def getSubObject( self, - *, subname: Union[str, List[str], Tuple[str, ...]], + *, retType: int = 0, matrix: Matrix = None, transform: bool = True, diff --git a/src/Base/Vector.pyi b/src/Base/Vector.pyi index 0e6617e265..17b7cbd8a1 100644 --- a/src/Base/Vector.pyi +++ b/src/Base/Vector.pyi @@ -79,7 +79,7 @@ class Vector(PyObjectBase): # fmt: off @overload - def __init__(self, *, x: float = 0, y: float = 0, z: float = 0) -> None: ... + def __init__(self, x: float = 0, y: float = 0, z: float = 0) -> None: ... @overload def __init__(self, vector: "Vector") -> None: ... @overload diff --git a/src/Gui/Command.pyi b/src/Gui/Command.pyi index 9a7c1bc520..47f4aa387f 100644 --- a/src/Gui/Command.pyi +++ b/src/Gui/Command.pyi @@ -125,8 +125,14 @@ class Command(PyObjectBase): @staticmethod def createCustomCommand( - *, macroFile: str, menuText: str, toolTip: str, whatsThis: str, statusTip: str, pixmap: str, - shortcut: str + *, + macroFile: str, + menuText: str, + toolTip: str, + whatsThis: str, + statusTip: str, + pixmap: str, + shortcut: str, ) -> str: """ createCustomCommand(macroFile, menuText, toolTip, whatsThis, statusTip, pixmap, shortcut) -> str diff --git a/src/Gui/ViewProvider.pyi b/src/Gui/ViewProvider.pyi index 0612ba9568..dd11b0fdd8 100644 --- a/src/Gui/ViewProvider.pyi +++ b/src/Gui/ViewProvider.pyi @@ -22,7 +22,6 @@ class ViewProvider(ExtensionContainer): def addProperty( self, - *, type: str, name: str, group: str, @@ -122,7 +121,7 @@ class ViewProvider(ExtensionContainer): ... def canDropObject( - self, *, obj: Any = None, owner: Any = None, subname: str, elem: Optional[List[str]] = None + self, obj: Any = None, *, owner: Any = None, subname: str, elem: Optional[List[str]] = None ) -> bool: """ canDropObject(obj=None, owner=None, subname, elem=None) -> bool @@ -143,7 +142,7 @@ class ViewProvider(ExtensionContainer): ... def dropObject( - self, *, obj: Any, owner: Any = None, subname: str, elem: Optional[List[str]] = None + self, obj: Any, *, owner: Any = None, subname: str, elem: Optional[List[str]] = None ) -> str: """ dropObject(obj, owner=None, subname, elem=None) -> str diff --git a/src/Mod/Part/App/GeometrySurface.pyi b/src/Mod/Part/App/GeometrySurface.pyi index bb55b1c45e..c606a391fc 100644 --- a/src/Mod/Part/App/GeometrySurface.pyi +++ b/src/Mod/Part/App/GeometrySurface.pyi @@ -40,7 +40,7 @@ class GeometrySurface(Geometry): ... @constmethod - def toShell(self, *, Bounds: object, Segment: object) -> Any: + def toShell(self, Bounds: object, Segment: object) -> Any: """ Make a shell of the surface. """ @@ -109,7 +109,7 @@ class GeometrySurface(Geometry): ... @constmethod - def projectPoint(self, *, Point: Vector, Method: str = ...) -> Any: + def projectPoint(self, Point: Vector, Method: str = ...) -> Any: """ Computes the projection of a point on the surface @@ -247,7 +247,6 @@ class GeometrySurface(Geometry): @constmethod def toBSpline( self, - *, tolerance: float = 1e-7, continuity_u: str = "C1", continuity_v: str = "C1", diff --git a/src/Mod/Part/App/HLRBRep/HLRBRep_Algo.pyi b/src/Mod/Part/App/HLRBRep/HLRBRep_Algo.pyi index 8532f7b27f..d9c68b75c1 100644 --- a/src/Mod/Part/App/HLRBRep/HLRBRep_Algo.pyi +++ b/src/Mod/Part/App/HLRBRep/HLRBRep_Algo.pyi @@ -103,7 +103,6 @@ class HLRBRep_Algo(PyObjectBase): def setProjector( self, - *, Origin: tuple[float, float, float] = (0, 0, 0), ZDir: tuple[float, float, float] = (0, 0, 0), XDir: tuple[float, float, float] = (0, 0, 0), diff --git a/src/Mod/Part/App/HLRBRep/HLRBRep_PolyAlgo.pyi b/src/Mod/Part/App/HLRBRep/HLRBRep_PolyAlgo.pyi index 56a1f0b69a..0b53d837ac 100644 --- a/src/Mod/Part/App/HLRBRep/HLRBRep_PolyAlgo.pyi +++ b/src/Mod/Part/App/HLRBRep/HLRBRep_PolyAlgo.pyi @@ -110,7 +110,6 @@ class HLRBRep_PolyAlgo(PyObjectBase): def setProjector( self, - *, Origin: tuple[float, float, float] = (0.0, 0.0, 0.0), ZDir: tuple[float, float, float] = (0.0, 0.0, 0.0), XDir: tuple[float, float, float] = (0.0, 0.0, 0.0), diff --git a/src/Mod/Part/App/HLRBRep/HLRToShape.pyi b/src/Mod/Part/App/HLRBRep/HLRToShape.pyi index f1d401ec53..09271bc4e8 100644 --- a/src/Mod/Part/App/HLRBRep/HLRToShape.pyi +++ b/src/Mod/Part/App/HLRBRep/HLRToShape.pyi @@ -146,7 +146,7 @@ class HLRToShape(PyObjectBase): ... def compoundOfEdges( - self, Type: int, Visible: bool, In3D: bool, *, Shape: Optional[TopoShape] = None + self, Type: int, Visible: bool, In3D: bool, Shape: Optional[TopoShape] = None ) -> TopoShape: """ compoundOfEdges(Type: int, Visible: bool, In3D: bool, Shape=None) -> TopoShape diff --git a/src/Mod/Part/App/TopoShape.pyi b/src/Mod/Part/App/TopoShape.pyi index e4c469dea0..92e90945c3 100644 --- a/src/Mod/Part/App/TopoShape.pyi +++ b/src/Mod/Part/App/TopoShape.pyi @@ -7,7 +7,6 @@ from Base.Vector import Vector from Base.Matrix import Matrix from Base.BoundBox import BoundBox from App.ComplexGeoData import ComplexGeoData -from __future__ import annotations from typing import Final, List, Tuple, Union, overload @@ -471,7 +470,7 @@ class TopoShape(ComplexGeoData): @constmethod def transformed( - self, *, matrix: Matrix, copy: bool = False, checkScale: bool = False, op: str = None + self, matrix: Matrix, *, copy: bool = False, checkScale: bool = False, op: str = None ) -> TopoShape: """ Create a new transformed shape @@ -656,8 +655,14 @@ class TopoShape(ComplexGeoData): @constmethod def makeEvolved( - self, *, Profile: TopoShape, Join: int, AxeProf: bool, Solid: bool, ProfOnSpine: bool, - Tolerance: float + self, + Profile: TopoShape, + Join: int, + AxeProf: bool, + *, + Solid: bool, + ProfOnSpine: bool, + Tolerance: float, ) -> None: """ Profile along the spine diff --git a/src/Mod/Part/App/TopoShapeFace.pyi b/src/Mod/Part/App/TopoShapeFace.pyi index 7580cdcab3..66c4ac07e2 100644 --- a/src/Mod/Part/App/TopoShapeFace.pyi +++ b/src/Mod/Part/App/TopoShapeFace.pyi @@ -110,8 +110,14 @@ class TopoShapeFace(TopoShape): @constmethod def makeEvolved( - self, *, Profile: TopoShape, Join: int, AxeProf: bool, Solid: bool, ProfOnSpine: bool, - Tolerance: float + self, + Profile: TopoShape, + Join: int, + *, + AxeProf: bool, + Solid: bool, + ProfOnSpine: bool, + Tolerance: float, ) -> TopoShape: """ Profile along the spine diff --git a/src/Mod/Part/App/TopoShapeWire.pyi b/src/Mod/Part/App/TopoShapeWire.pyi index a7aeb7848b..aac8842ff7 100644 --- a/src/Mod/Part/App/TopoShapeWire.pyi +++ b/src/Mod/Part/App/TopoShapeWire.pyi @@ -140,8 +140,14 @@ class TopoShapeWire(TopoShape): @constmethod def makeEvolved( - self, *, Profile: TopoShape, Join: int, AxeProf: bool, Solid: bool, ProfOnSpine: bool, - Tolerance: float + self, + Profile: TopoShape, + Join: int, + *, + AxeProf: bool, + Solid: bool, + ProfOnSpine: bool, + Tolerance: float, ) -> TopoShape: """ Profile along the spine @@ -151,7 +157,6 @@ class TopoShapeWire(TopoShape): @constmethod def approximate( self, - *, Tol2d: float = None, Tol3d: float = 0.0001, MaxSegments: int = 10,