diff --git a/src/App/ApplicationDirectories.pyi b/src/App/ApplicationDirectories.pyi index 11776c7009..01dd557124 100644 --- a/src/App/ApplicationDirectories.pyi +++ b/src/App/ApplicationDirectories.pyi @@ -13,7 +13,7 @@ class ApplicationDirectories(PyObjectBase): """ @staticmethod - def usingCurrentVersionConfig(path: str) -> bool: + def usingCurrentVersionConfig(path: str, /) -> bool: """ Determine if a given config path is for the current version of the program. @@ -23,7 +23,7 @@ class ApplicationDirectories(PyObjectBase): ... @staticmethod - def migrateAllPaths(paths: list[str]) -> None: + def migrateAllPaths(paths: list[str], /) -> None: """ Migrate a set of versionable configuration directories from the given paths to a new version. @@ -47,7 +47,7 @@ class ApplicationDirectories(PyObjectBase): ... @staticmethod - def versionStringForPath(major: int, minor: int) -> str: + def versionStringForPath(major: int, minor: int, /) -> str: """ Given a major and minor version number. @@ -62,7 +62,7 @@ class ApplicationDirectories(PyObjectBase): ... @staticmethod - def isVersionedPath(startingPath: str) -> bool: + def isVersionedPath(startingPath: str, /) -> bool: """ Determine if a given path is versioned. @@ -80,7 +80,7 @@ class ApplicationDirectories(PyObjectBase): ... @staticmethod - def mostRecentAvailableConfigVersion(startingPath: str) -> str: + def mostRecentAvailableConfigVersion(startingPath: str, /) -> str: """ Given a base path that is expected to contain versioned subdirectories, locate the directory name (*not* the path, only the final component, the version string itself) @@ -97,7 +97,7 @@ class ApplicationDirectories(PyObjectBase): ... @staticmethod - def mostRecentConfigFromBase(startingPath: str) -> str: + def mostRecentConfigFromBase(startingPath: str, /) -> str: """ Given a base path that is expected to contained versioned subdirectories, locate the directory corresponding to the most recent version of the software, up to and including @@ -113,7 +113,7 @@ class ApplicationDirectories(PyObjectBase): ... @staticmethod - def migrateConfig(oldPath: str, newPath: str) -> None: + def migrateConfig(oldPath: str, newPath: str, /) -> None: """ A utility method to copy all files and directories from oldPath to newPath, handling the case where newPath might itself be a subdirectory of oldPath (and *not* attempting that diff --git a/src/App/ComplexGeoData.pyi b/src/App/ComplexGeoData.pyi index d1407c2e3e..92282643ae 100644 --- a/src/App/ComplexGeoData.pyi +++ b/src/App/ComplexGeoData.pyi @@ -74,19 +74,19 @@ class ComplexGeoData(Persistence): """ ... - def applyTranslation(self, translation: Vector) -> None: + def applyTranslation(self, translation: Vector, /) -> None: """ Apply an additional translation to the placement """ ... - def applyRotation(self, rotation: Rotation) -> None: + def applyRotation(self, rotation: Rotation, /) -> None: """ Apply an additional rotation to the placement """ ... - def transformGeometry(self, transformation: Matrix) -> None: + def transformGeometry(self, transformation: Matrix, /) -> None: """ Apply a transformation to the underlying geometry """ @@ -117,21 +117,21 @@ class ComplexGeoData(Persistence): ... @constmethod - def getElementName(self, name: str, direction: int = 0) -> str: + def getElementName(self, name: str, direction: int = 0, /) -> str: """ Return a mapped element name or reverse. """ ... @constmethod - def getElementIndexedName(self, name: str) -> str | tuple[str, list[int]]: + def getElementIndexedName(self, name: str, /) -> str | tuple[str, list[int]]: """ Return the indexed element name. """ ... @constmethod - def getElementMappedName(self, name: str) -> str | tuple[str, list[int]]: + def getElementMappedName(self, name: str, /) -> str | tuple[str, list[int]]: """ Return the mapped element name """ diff --git a/src/App/Document.pyi b/src/App/Document.pyi index 109fbb7436..ddf0451495 100644 --- a/src/App/Document.pyi +++ b/src/App/Document.pyi @@ -89,19 +89,19 @@ class Document(PropertyContainer): """ ... - def saveAs(self, path: str) -> None: + def saveAs(self, path: str, /) -> None: """ Save the document under a new name to disk. """ ... - def saveCopy(self, path: str) -> None: + def saveCopy(self, path: str, /) -> None: """ Save a copy of the document under a new name to disk. """ ... - def load(self, path: str) -> None: + def load(self, path: str, /) -> None: """ Load the document from the given path. """ @@ -132,7 +132,7 @@ class Document(PropertyContainer): """ ... - def getUniqueObjectName(self, objName: str) -> str: + def getUniqueObjectName(self, objName: str, /) -> str: """ Return the same name, or the name made unique, for Example Box -> Box002 if there are conflicting name already in the document. @@ -145,13 +145,13 @@ class Document(PropertyContainer): """ ... - def mergeProject(self, path: str) -> None: + def mergeProject(self, path: str, /) -> None: """ Merges this document with another project file. """ ... - def exportGraphviz(self, path: str = None) -> str | None: + def exportGraphviz(self, path: str = None, /) -> str | None: """ Export the dependencies of the objects as graph. @@ -159,7 +159,7 @@ class Document(PropertyContainer): """ ... - def openTransaction(self, name: str) -> None: + def openTransaction(self, name: str, /) -> None: """ Open a new Undo/Redo transaction. @@ -185,7 +185,6 @@ class Document(PropertyContainer): def addObject( self, - *, type: str, name: str = None, objProxy: object = None, @@ -210,7 +209,6 @@ class Document(PropertyContainer): def addProperty( self, - *, type: str, name: str, group: str = "", @@ -219,7 +217,8 @@ class Document(PropertyContainer): read_only: bool = False, hidden: bool = False, locked: bool = False, - ) -> Document: + enum_vals: list[str] | None = None, + ) -> Document: """ Add a generic property. @@ -238,7 +237,7 @@ class Document(PropertyContainer): """ ... - def removeProperty(self, name: str) -> None: + def removeProperty(self, name: str, /) -> None: """ Remove a generic property. @@ -246,7 +245,7 @@ class Document(PropertyContainer): """ ... - def removeObject(self, name: str) -> None: + def removeObject(self, name: str, /) -> None: """ Remove an object from the document. """ @@ -271,7 +270,10 @@ class Document(PropertyContainer): ... def moveObject( - self, object: DocumentObject, with_dependencies: bool = False + self, + object: DocumentObject, + with_dependencies: bool = False, + /, ) -> DocumentObject: """ Transfers an object from another document to this document. @@ -283,7 +285,9 @@ class Document(PropertyContainer): ... def importLinks( - self, object: DocumentObject = None + self, + object: DocumentObject = None, + /, ) -> tuple[DocumentObject, ...]: """ Import any externally linked object given a list of objects in @@ -319,7 +323,7 @@ class Document(PropertyContainer): """ ... - def setClosable(self, closable: bool) -> None: + def setClosable(self, closable: bool, /) -> None: """ Set a flag that allows or forbids to close a document """ @@ -331,7 +335,7 @@ class Document(PropertyContainer): """ ... - def setAutoCreated(self, autoCreated: bool) -> None: + def setAutoCreated(self, autoCreated: bool, /) -> None: """ Set a flag that indicates if a document is autoCreated """ @@ -348,6 +352,7 @@ class Document(PropertyContainer): objs: Sequence[DocumentObject] = None, force: bool = False, check_cycle: bool = False, + /, ) -> int: """ Recompute the document and returns the amount of recomputed features. @@ -372,13 +377,13 @@ class Document(PropertyContainer): """ ... - def getObject(self, name: str) -> DocumentObject: + def getObject(self, name: str, /) -> DocumentObject: """ Return the object with the given name """ ... - def getObjectsByLabel(self, label: str) -> list[DocumentObject]: + def getObjectsByLabel(self, label: str, /) -> list[DocumentObject]: """ Return the objects with the given label name. @@ -388,7 +393,6 @@ class Document(PropertyContainer): def findObjects( self, - *, Type: str = None, Name: str = None, Label: str = None, @@ -410,6 +414,7 @@ class Document(PropertyContainer): obj: DocumentObject, options: int = 0, maxCount: int = 0, + /, ) -> tuple[DocumentObject, ...]: """ Return objects linked to 'obj' @@ -432,7 +437,7 @@ class Document(PropertyContainer): """ ... - def getDependentDocuments(self, sort: bool = True) -> list[DocumentObject]: + def getDependentDocuments(self, sort: bool = True, /) -> list[DocumentObject]: """ Returns a list of documents that this document directly or indirectly links to including itself. diff --git a/src/App/DocumentObject.pyi b/src/App/DocumentObject.pyi index 106ef5ebbc..917cbcdff4 100644 --- a/src/App/DocumentObject.pyi +++ b/src/App/DocumentObject.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import constmethod from Base.Matrix import Matrix from Document import Document @@ -79,7 +83,7 @@ class DocumentObject(ExtensionContainer): """ ... - def removeProperty(self, string: str) -> None: + def removeProperty(self, string: str, /) -> None: """ removeProperty(string) -- Remove a generic property. @@ -111,26 +115,26 @@ class DocumentObject(ExtensionContainer): """ ... - def setExpression(self, name: str, expression: str) -> None: + def setExpression(self, name: str, expression: str, /) -> None: """ Register an expression for a property """ ... - def clearExpression(self, name: str) -> None: + def clearExpression(self, name: str, /) -> None: """ Clear the expression for a property """ ... @classmethod - def evalExpression(cls, expression: str) -> Any: + def evalExpression(cls, expression: str, /) -> Any: """ Evaluate an expression """ ... - def recompute(self, recursive: bool = False) -> None: + def recompute(self, recursive: bool = False, /) -> None: """ recompute(recursive=False): Recomputes this object """ @@ -191,7 +195,7 @@ class DocumentObject(ExtensionContainer): """ ... - def getSubObjectList(self, subname: str) -> list: + def getSubObjectList(self, subname: str, /) -> list: """ getSubObjectList(subname) @@ -199,7 +203,7 @@ class DocumentObject(ExtensionContainer): """ ... - def getSubObjects(self, reason: int = 0) -> list: + def getSubObjects(self, reason: int = 0, /) -> list: """ getSubObjects(reason=0): Return subname reference of all sub-objects """ @@ -229,14 +233,14 @@ class DocumentObject(ExtensionContainer): """ ... - def setElementVisible(self, element: str, visible: bool) -> int: + def setElementVisible(self, element: str, visible: bool, /) -> int: """ setElementVisible(element,visible): Set the visibility of a child element Return -1 if element visibility is not supported, 0 if element not found, 1 if success """ ... - def isElementVisible(self, element: str) -> int: + def isElementVisible(self, element: str, /) -> int: """ isElementVisible(element): Check if a child element is visible Return -1 if element visibility is not supported or element not found, 0 if invisible, or else 1 @@ -283,7 +287,7 @@ class DocumentObject(ExtensionContainer): ... @constmethod - def resolve(self, subname: str) -> tuple: + def resolve(self, subname: str, /) -> tuple: """ resolve(subname) -- resolve the sub object @@ -296,7 +300,7 @@ class DocumentObject(ExtensionContainer): ... @constmethod - def resolveSubElement(self, subname: str, append: bool, type: int) -> tuple: + def resolveSubElement(self, subname: str, append: bool, type: int, /) -> tuple: """ resolveSubElement(subname,append,type) -- resolve both new and old style sub element @@ -308,14 +312,14 @@ class DocumentObject(ExtensionContainer): """ ... - def adjustRelativeLinks(self, parent: DocumentObject, recursive: bool = True) -> bool: + def adjustRelativeLinks(self, parent: DocumentObject, recursive: bool = True, /) -> bool: """ adjustRelativeLinks(parent,recursive=True) -- auto correct potential cyclic dependencies """ ... @constmethod - def getElementMapVersion(self, property_name: str) -> str: + def getElementMapVersion(self, property_name: str, /) -> str: """ getElementMapVersion(property_name): return element map version of a given geometry property """ diff --git a/src/App/DocumentObjectExtension.pyi b/src/App/DocumentObjectExtension.pyi index 0709e77844..651ef55bb9 100644 --- a/src/App/DocumentObjectExtension.pyi +++ b/src/App/DocumentObjectExtension.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Extension import Extension diff --git a/src/App/DocumentObjectGroup.pyi b/src/App/DocumentObjectGroup.pyi index 82529d9e14..2b9d92fe8e 100644 --- a/src/App/DocumentObjectGroup.pyi +++ b/src/App/DocumentObjectGroup.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from DocumentObject import DocumentObject diff --git a/src/App/Extension.pyi b/src/App/Extension.pyi index 0005862c31..282d53acca 100644 --- a/src/App/Extension.pyi +++ b/src/App/Extension.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Final, Any from Base.PyObjectBase import PyObjectBase diff --git a/src/App/ExtensionContainer.pyi b/src/App/ExtensionContainer.pyi index f71ebeb540..ecf688249f 100644 --- a/src/App/ExtensionContainer.pyi +++ b/src/App/ExtensionContainer.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from PropertyContainer import PropertyContainer @@ -13,14 +17,14 @@ class ExtensionContainer(PropertyContainer): Licence: LGPL """ - def addExtension(self, identifier: str) -> None: + def addExtension(self, identifier: str, /) -> None: """ Adds an extension to the object. Requires the string identifier for the python extension as argument """ ... @constmethod - def hasExtension(self, identifier: str) -> bool: + def hasExtension(self, identifier: str, /) -> bool: """ Returns if this object has the specified extension """ diff --git a/src/App/GeoFeature.pyi b/src/App/GeoFeature.pyi index d98cef96a4..0c96ddaa88 100644 --- a/src/App/GeoFeature.pyi +++ b/src/App/GeoFeature.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from DocumentObject import DocumentObject from Base import Placement from typing import Any, Final, Optional @@ -39,7 +43,7 @@ class GeoFeature(DocumentObject): ... @staticmethod - def getGlobalPlacementOf(targetObj: Any, rootObj: Any, subname: str) -> Placement: + def getGlobalPlacementOf(targetObj: Any, rootObj: Any, subname: str, /) -> Placement: """ getGlobalPlacementOf(targetObj, rootObj, subname) -> Base.Placement Selection example: obj = "part1" sub = "linkToPart2.LinkToBody.Pad.face1" diff --git a/src/App/GeoFeatureGroupExtension.pyi b/src/App/GeoFeatureGroupExtension.pyi index 50b5d657e3..756cac6efc 100644 --- a/src/App/GeoFeatureGroupExtension.pyi +++ b/src/App/GeoFeatureGroupExtension.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from GroupExtension import GroupExtension diff --git a/src/App/GroupExtension.pyi b/src/App/GroupExtension.pyi index d5d66a924b..e88a879ae2 100644 --- a/src/App/GroupExtension.pyi +++ b/src/App/GroupExtension.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from DocumentObjectExtension import DocumentObjectExtension from typing import Any, List @@ -13,37 +17,37 @@ class GroupExtension(DocumentObjectExtension): Licence: LGPL """ - def newObject(self, type: str, name: str) -> Any: + def newObject(self, type: str, name: str, /) -> Any: """ Create and add an object with given type and name to the group """ ... - def addObject(self, obj: Any) -> List[Any]: + def addObject(self, obj: Any, /) -> List[Any]: """ Add an object to the group. Returns all objects that have been added. """ ... - def addObjects(self, objects: List[Any]) -> List[Any]: + def addObjects(self, objects: List[Any], /) -> List[Any]: """ Adds multiple objects to the group. Expects a list and returns all objects that have been added. """ ... - def setObjects(self, objects: List[Any]) -> List[Any]: + def setObjects(self, objects: List[Any], /) -> List[Any]: """ Sets the objects of the group. Expects a list and returns all objects that are now in the group. """ ... - def removeObject(self, obj: Any) -> List[Any]: + def removeObject(self, obj: Any, /) -> List[Any]: """ Remove an object from the group and returns all objects that have been removed. """ ... - def removeObjects(self, objects: List[Any]) -> List[Any]: + def removeObjects(self, objects: List[Any], /) -> List[Any]: """ Remove multiple objects from the group. Expects a list and returns all objects that have been removed. """ @@ -55,20 +59,20 @@ class GroupExtension(DocumentObjectExtension): """ ... - def getObject(self, name: str) -> Any: + def getObject(self, name: str, /) -> Any: """ Return the object with the given name """ ... - def getObjectsOfType(self, typename: str) -> List[Any]: + def getObjectsOfType(self, typename: str, /) -> List[Any]: """ Returns all object in the group of given type @param typename The Freecad type identifier """ ... - def hasObject(self, obj: Any, recursive: bool = False) -> bool: + def hasObject(self, obj: Any, recursive: bool = False, /) -> bool: """ hasObject(obj, recursive=false) @@ -78,7 +82,7 @@ class GroupExtension(DocumentObjectExtension): """ ... - def allowObject(self, obj: Any) -> bool: + def allowObject(self, obj: Any, /) -> bool: """ Returns true if obj is allowed in the group extension. """ diff --git a/src/App/LinkBaseExtension.pyi b/src/App/LinkBaseExtension.pyi index 817f85e9e8..cb8a760194 100644 --- a/src/App/LinkBaseExtension.pyi +++ b/src/App/LinkBaseExtension.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from DocumentObjectExtension import DocumentObjectExtension from typing import Any, Final, List, Tuple, Optional, Union, overload @@ -41,31 +45,31 @@ class LinkBaseExtension(DocumentObjectExtension): """ ... - def getLinkExtProperty(self, name: str) -> Any: + def getLinkExtProperty(self, name: str, /) -> Any: """ getLinkExtProperty(name): return the property value by its predefined name """ ... - def getLinkExtPropertyName(self, name: str) -> str: + def getLinkExtPropertyName(self, name: str, /) -> str: """ getLinkExtPropertyName(name): lookup the property name by its predefined name """ ... @overload - def getLinkPropertyInfo(self) -> tuple: + def getLinkPropertyInfo(self, /) -> tuple: ... @overload - def getLinkPropertyInfo(self, index: int) -> tuple: + def getLinkPropertyInfo(self, index: int, /) -> tuple: ... @overload - def getLinkPropertyInfo(self, name: str) -> tuple: + def getLinkPropertyInfo(self, name: str, /) -> tuple: ... - def getLinkPropertyInfo(self, arg: Any = None) -> tuple: + def getLinkPropertyInfo(self, arg: Any = None, /) -> tuple: """ getLinkPropertyInfo(): return a tuple of (name,type,doc) for all supported properties. @@ -75,7 +79,7 @@ class LinkBaseExtension(DocumentObjectExtension): """ ... - def setLink(self, obj: Any, subName: Optional[str] = None, subElements: Optional[Union[str, Tuple[str, ...]]] = None) -> None: + def setLink(self, obj: Any, subName: Optional[str] = None, subElements: Optional[Union[str, Tuple[str, ...]]] = None, /) -> None: """ setLink(obj,subName=None,subElements=None): Set link object. @@ -92,7 +96,7 @@ class LinkBaseExtension(DocumentObjectExtension): """ ... - def cacheChildLabel(self, enable: bool = True) -> None: + def cacheChildLabel(self, enable: bool = True, /) -> None: """ cacheChildLabel(enable=True): enable/disable child label cache @@ -101,7 +105,7 @@ class LinkBaseExtension(DocumentObjectExtension): """ ... - def flattenSubname(self, subname: str) -> str: + def flattenSubname(self, subname: str, /) -> str: """ flattenSubname(subname) -> string @@ -109,7 +113,7 @@ class LinkBaseExtension(DocumentObjectExtension): """ ... - def expandSubname(self, subname: str) -> str: + def expandSubname(self, subname: str, /) -> str: """ expandSubname(subname) -> string diff --git a/src/App/Material.pyi b/src/App/Material.pyi index d62eb097aa..cb89414f46 100644 --- a/src/App/Material.pyi +++ b/src/App/Material.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, class_declarations from Base.PyObjectBase import PyObjectBase from typing import Any, overload @@ -25,7 +29,7 @@ class Material(PyObjectBase): def __init__(self, *args: Any, **kwargs: Any) -> None: ... - def set(self, string: str) -> None: + def set(self, string: str, /) -> None: """ Set(string) -- Set the material. diff --git a/src/App/MeasureManager.pyi b/src/App/MeasureManager.pyi index 6a7dd43b16..43c6d033bd 100644 --- a/src/App/MeasureManager.pyi +++ b/src/App/MeasureManager.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, no_args from Base.PyObjectBase import PyObjectBase from typing import List, Tuple, TypeAlias @@ -21,7 +25,7 @@ class MeasureManager(PyObjectBase): """ @staticmethod - def addMeasureType(id: str, label: str, measureType: MeasureType) -> None: + def addMeasureType(id: str, label: str, measureType: MeasureType, /) -> None: """ addMeasureType(id, label, measureType) -> None diff --git a/src/App/Metadata.pyi b/src/App/Metadata.pyi index 3fcd38198f..e09cf27193 100644 --- a/src/App/Metadata.pyi +++ b/src/App/Metadata.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, class_declarations from Base.PyObjectBase import PyObjectBase from typing import Any, List, Dict, overload, Optional @@ -217,7 +221,7 @@ class Metadata(PyObjectBase): """ ... - def getGenericMetadata(self, name: str) -> List[Any]: + def getGenericMetadata(self, name: str, /) -> List[Any]: """ getGenericMetadata(name) -> list @@ -228,7 +232,7 @@ class Metadata(PyObjectBase): """ ... - def addContentItem(self, content_type: str, metadata: "Metadata") -> None: + def addContentItem(self, content_type: str, metadata: "Metadata", /) -> None: """ addContentItem(content_type,metadata) @@ -236,7 +240,7 @@ class Metadata(PyObjectBase): """ ... - def removeContentItem(self, content_type: str, name: str) -> None: + def removeContentItem(self, content_type: str, name: str, /) -> None: """ removeContentItem(content_type,name) @@ -244,7 +248,7 @@ class Metadata(PyObjectBase): """ ... - def addMaintainer(self, name: str, email: str) -> None: + def addMaintainer(self, name: str, email: str, /) -> None: """ addMaintainer(name, email) @@ -252,7 +256,7 @@ class Metadata(PyObjectBase): """ ... - def removeMaintainer(self, name: str, email: str) -> None: + def removeMaintainer(self, name: str, email: str, /) -> None: """ removeMaintainer(name, email) @@ -260,7 +264,7 @@ class Metadata(PyObjectBase): """ ... - def addLicense(self, short_code: str, path: str) -> None: + def addLicense(self, short_code: str, path: str, /) -> None: """ addLicense(short_code,path) @@ -268,7 +272,7 @@ class Metadata(PyObjectBase): """ ... - def removeLicense(self, short_code: str) -> None: + def removeLicense(self, short_code: str, /) -> None: """ removeLicense(short_code) @@ -276,7 +280,7 @@ class Metadata(PyObjectBase): """ ... - def addUrl(self, url_type: str, url: str, branch: str) -> None: + def addUrl(self, url_type: str, url: str, branch: str, /) -> None: """ addUrl(url_type,url,branch) @@ -288,7 +292,7 @@ class Metadata(PyObjectBase): """ ... - def removeUrl(self, url_type: str, url: str) -> None: + def removeUrl(self, url_type: str, url: str, /) -> None: """ removeUrl(url_type,url) @@ -296,7 +300,7 @@ class Metadata(PyObjectBase): """ ... - def addAuthor(self, name: str, email: str) -> None: + def addAuthor(self, name: str, email: str, /) -> None: """ addAuthor(name, email) @@ -304,7 +308,7 @@ class Metadata(PyObjectBase): """ ... - def removeAuthor(self, name: str, email: str) -> None: + def removeAuthor(self, name: str, email: str, /) -> None: """ removeAuthor(name, email) @@ -312,7 +316,7 @@ class Metadata(PyObjectBase): """ ... - def addDepend(self, name: str, kind: str, optional: bool) -> None: + def addDepend(self, name: str, kind: str, optional: bool, /) -> None: """ addDepend(name, kind, optional) @@ -322,7 +326,7 @@ class Metadata(PyObjectBase): """ ... - def removeDepend(self, name: str, kind: str) -> None: + def removeDepend(self, name: str, kind: str, /) -> None: """ removeDepend(name, kind) @@ -332,7 +336,7 @@ class Metadata(PyObjectBase): """ ... - def addConflict(self, name: str, kind: str) -> None: + def addConflict(self, name: str, kind: str, /) -> None: """ addConflict(name, kind) @@ -340,7 +344,7 @@ class Metadata(PyObjectBase): """ ... - def removeConflict(self, name: str, kind: str) -> None: + def removeConflict(self, name: str, kind: str, /) -> None: """ removeConflict(name, kind) @@ -348,7 +352,7 @@ class Metadata(PyObjectBase): """ ... - def addReplace(self, name: str) -> None: + def addReplace(self, name: str, /) -> None: """ addReplace(name) @@ -356,7 +360,7 @@ class Metadata(PyObjectBase): """ ... - def removeReplace(self, name: str) -> None: + def removeReplace(self, name: str, /) -> None: """ removeReplace(name) @@ -364,7 +368,7 @@ class Metadata(PyObjectBase): """ ... - def addTag(self, tag: str) -> None: + def addTag(self, tag: str, /) -> None: """ addTag(tag) @@ -372,7 +376,7 @@ class Metadata(PyObjectBase): """ ... - def removeTag(self, tag: str) -> None: + def removeTag(self, tag: str, /) -> None: """ removeTag(tag) @@ -380,7 +384,7 @@ class Metadata(PyObjectBase): """ ... - def addFile(self, filename: str) -> None: + def addFile(self, filename: str, /) -> None: """ addFile(filename) @@ -388,7 +392,7 @@ class Metadata(PyObjectBase): """ ... - def removeFile(self, filename: str) -> None: + def removeFile(self, filename: str, /) -> None: """ removeFile(filename) @@ -396,7 +400,7 @@ class Metadata(PyObjectBase): """ ... - def write(self, filename: str) -> None: + def write(self, filename: str, /) -> None: """ write(filename) diff --git a/src/App/OriginGroupExtension.pyi b/src/App/OriginGroupExtension.pyi index 85c70fe831..499b2a1a65 100644 --- a/src/App/OriginGroupExtension.pyi +++ b/src/App/OriginGroupExtension.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from GeoFeatureGroupExtension import GeoFeatureGroupExtension diff --git a/src/App/Part.pyi b/src/App/Part.pyi index c0e0b9768c..4146df2c33 100644 --- a/src/App/Part.pyi +++ b/src/App/Part.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from GeoFeature import GeoFeature diff --git a/src/App/PropertyContainer.pyi b/src/App/PropertyContainer.pyi index 8226fc7e55..62e4fcef12 100644 --- a/src/App/PropertyContainer.pyi +++ b/src/App/PropertyContainer.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.Persistence import Persistence from typing import Any, Final, Union, List, Optional @@ -14,7 +18,7 @@ class PropertyContainer(Persistence): PropertiesList: Final[list] = [] """A list of all property names.""" - def getPropertyByName(self, name: str, checkOwner: int = 0) -> Any: + def getPropertyByName(self, name: str, checkOwner: int = 0, /) -> Any: """ getPropertyByName(name, checkOwner=0) -> object or Tuple @@ -30,7 +34,7 @@ class PropertyContainer(Persistence): """ ... - def getPropertyTouchList(self, name: str) -> tuple: + def getPropertyTouchList(self, name: str, /) -> tuple: """ getPropertyTouchList(name) -> tuple @@ -41,7 +45,7 @@ class PropertyContainer(Persistence): """ ... - def getTypeOfProperty(self, name: str) -> list: + def getTypeOfProperty(self, name: str, /) -> list: """ getTypeOfProperty(name) -> list @@ -53,7 +57,7 @@ class PropertyContainer(Persistence): """ ... - def getTypeIdOfProperty(self, name: str) -> str: + def getTypeIdOfProperty(self, name: str, /) -> str: """ getTypeIdOfProperty(name) -> str @@ -64,7 +68,7 @@ class PropertyContainer(Persistence): """ ... - def setEditorMode(self, name: str, type: Union[int, List[str]]) -> None: + def setEditorMode(self, name: str, type: Union[int, List[str]], /) -> None: """ setEditorMode(name, type) -> None @@ -79,7 +83,7 @@ class PropertyContainer(Persistence): """ ... - def getEditorMode(self, name: str) -> list: + def getEditorMode(self, name: str, /) -> list: """ getEditorMode(name) -> list @@ -95,7 +99,7 @@ class PropertyContainer(Persistence): """ ... - def getGroupOfProperty(self, name: str) -> str: + def getGroupOfProperty(self, name: str, /) -> str: """ getGroupOfProperty(name) -> str @@ -107,7 +111,7 @@ class PropertyContainer(Persistence): """ ... - def setGroupOfProperty(self, name: str, group: str) -> None: + def setGroupOfProperty(self, name: str, group: str, /) -> None: """ setGroupOfProperty(name, group) -> None @@ -121,8 +125,7 @@ class PropertyContainer(Persistence): ... def setPropertyStatus( - self, name: str, val: Union[int, str, List[Union[str, int]]] - ) -> None: + self, name: str, val: Union[int, str, List[Union[str, int]]], /) -> None: """ setPropertyStatus(name, val) -> None @@ -136,7 +139,7 @@ class PropertyContainer(Persistence): """ ... - def getPropertyStatus(self, name: str = "") -> list: + def getPropertyStatus(self, name: str = "", /) -> list: """ getPropertyStatus(name='') -> list @@ -147,7 +150,7 @@ class PropertyContainer(Persistence): """ ... - def getDocumentationOfProperty(self, name: str) -> str: + def getDocumentationOfProperty(self, name: str, /) -> str: """ getDocumentationOfProperty(name) -> str @@ -158,7 +161,7 @@ class PropertyContainer(Persistence): """ ... - def setDocumentationOfProperty(self, name: str, docstring: str) -> None: + def setDocumentationOfProperty(self, name: str, docstring: str, /) -> None: """ setDocumentationOfProperty(name, docstring) -> None @@ -171,7 +174,7 @@ class PropertyContainer(Persistence): """ ... - def getEnumerationsOfProperty(self, name: str) -> Optional[list]: + def getEnumerationsOfProperty(self, name: str, /) -> Optional[list]: """ getEnumerationsOfProperty(name) -> list or None @@ -198,7 +201,7 @@ class PropertyContainer(Persistence): """ ... - def restorePropertyContent(self, name: str, obj: object) -> None: + def restorePropertyContent(self, name: str, obj: object, /) -> None: """ restorePropertyContent(name, obj) -> None @@ -213,7 +216,7 @@ class PropertyContainer(Persistence): ... @constmethod - def renameProperty(self, oldName: str, newName: str) -> None: + def renameProperty(self, oldName: str, newName: str, /) -> None: """ renameProperty(oldName, newName) -> None diff --git a/src/App/StringHasher.pyi b/src/App/StringHasher.pyi index 708ad74311..569083176d 100644 --- a/src/App/StringHasher.pyi +++ b/src/App/StringHasher.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.BaseClass import BaseClass from typing import Any, Final, overload, Dict @@ -19,7 +23,7 @@ class StringHasher(BaseClass): def __init__(self, *args: Any, **kwargs: Any) -> None: ... - def getID(self, arg: Any, base64: bool = False) -> Any: + def getID(self, arg: Any, base64: bool = False, /) -> Any: """ getID(txt|id, base64=False) -> StringID @@ -34,13 +38,13 @@ class StringHasher(BaseClass): ... @overload - def getID(self, txt: str, base64: bool = False) -> Any: ... + def getID(self, txt: str, base64: bool = False, /) -> Any: ... @overload - def getID(self, id: int, base64: bool = False) -> Any: ... + def getID(self, id: int, base64: bool = False, /) -> Any: ... @constmethod - def isSame(self, other: "StringHasher") -> bool: + def isSame(self, other: "StringHasher", /) -> bool: """ Check if two hasher are the same """ diff --git a/src/App/StringID.pyi b/src/App/StringID.pyi index 4251cd0827..92d72d1a4c 100644 --- a/src/App/StringID.pyi +++ b/src/App/StringID.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod, class_declarations from Base.BaseClass import BaseClass from typing import Any, Final, List @@ -21,7 +25,7 @@ class StringID(BaseClass): """ @constmethod - def isSame(self, other: "StringID") -> bool: + def isSame(self, other: "StringID", /) -> bool: """ Check if two StringIDs are the same """ diff --git a/src/App/SuppressibleExtension.pyi b/src/App/SuppressibleExtension.pyi index 2e6fa01d58..872396d8bb 100644 --- a/src/App/SuppressibleExtension.pyi +++ b/src/App/SuppressibleExtension.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from DocumentObjectExtension import DocumentObjectExtension diff --git a/src/Base/Axis.pyi b/src/Base/Axis.pyi index 28d6e04220..7f0ea391d9 100644 --- a/src/Base/Axis.pyi +++ b/src/Base/Axis.pyi @@ -1,10 +1,11 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations from Metadata import export from PyObjectBase import PyObjectBase from Vector import Vector from Placement import Placement -from Axis import Axis from typing import overload @export( @@ -55,7 +56,7 @@ class Axis(PyObjectBase): """ ... - def move(self, vector: Vector) -> None: + def move(self, vector: Vector, /) -> None: """ move(vector) -> None @@ -66,7 +67,7 @@ class Axis(PyObjectBase): """ ... - def multiply(self, placement: Placement) -> Axis: + def multiply(self, placement: Placement, /) -> Axis: """ multiply(placement) -> Base.Axis diff --git a/src/Base/BaseClass.pyi b/src/Base/BaseClass.pyi index a21e3f53c2..0fd55ecef0 100644 --- a/src/Base/BaseClass.pyi +++ b/src/Base/BaseClass.pyi @@ -1,4 +1,6 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations from Metadata import constmethod from PyObjectBase import PyObjectBase @@ -19,7 +21,7 @@ class BaseClass(PyObjectBase): """Module in which this class is defined""" @constmethod - def isDerivedFrom(self, typeName: str) -> bool: + def isDerivedFrom(self, typeName: str, /) -> bool: """ Returns true if given type is a father """ diff --git a/src/Base/BoundBox.pyi b/src/Base/BoundBox.pyi index 26bed0dccf..68a5318c97 100644 --- a/src/Base/BoundBox.pyi +++ b/src/Base/BoundBox.pyi @@ -1,4 +1,6 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations from Metadata import export, constmethod from PyObjectBase import PyObjectBase @@ -134,11 +136,14 @@ class BoundBox(PyObjectBase): ... @overload - def add(self, minMax: Vector) -> None: ... + def add(self, minMax: Vector, /) -> None: ... + @overload - def add(self, minMax: Tuple[float, float, float]) -> None: ... + def add(self, minMax: Tuple[float, float, float], /) -> None: ... + @overload - def add(self, x: float, y: float, z: float) -> None: ... + def add(self, x: float, y: float, z: float, /) -> None: ... + def add(self, *args: Any, **kwargs: Any) -> None: """ add(minMax) -> None @@ -160,7 +165,7 @@ class BoundBox(PyObjectBase): ... @constmethod - def getPoint(self, index: int) -> Vector: + def getPoint(self, index: int, /) -> Vector: """ getPoint(index) -> Base.Vector @@ -172,7 +177,7 @@ class BoundBox(PyObjectBase): ... @constmethod - def getEdge(self, index: int) -> Tuple[Vector, ...]: + def getEdge(self, index: int, /) -> Tuple[Vector, ...]: """ getEdge(index) -> tuple of Base.Vector @@ -184,9 +189,9 @@ class BoundBox(PyObjectBase): ... @overload - def closestPoint(self, point: Vector) -> Vector: ... + def closestPoint(self, point: Vector, /) -> Vector: ... @overload - def closestPoint(self, x: float, y: float, z: float) -> Vector: ... + def closestPoint(self, x: float, y: float, z: float, /) -> Vector: ... @constmethod def closestPoint(self, *args: Any, **kwargs: Any) -> Vector: """ @@ -207,13 +212,13 @@ class BoundBox(PyObjectBase): ... @overload - def intersect(self, boundBox2: "BoundBox") -> bool: ... + def intersect(self, boundBox2: "BoundBox", /) -> bool: ... @overload def intersect( self, base: Union[Vector, Tuple[float, float, float]], dir: Union[Vector, Tuple[float, float, float]], - ) -> bool: ... + /,) -> bool: ... def intersect(self, *args: Any) -> bool: """ intersect(boundBox2) -> bool @@ -228,7 +233,7 @@ class BoundBox(PyObjectBase): """ ... - def intersected(self, boundBox2: "BoundBox") -> "BoundBox": + def intersected(self, boundBox2: "BoundBox", /) -> "BoundBox": """ intersected(boundBox2) -> Base.BoundBox @@ -238,7 +243,7 @@ class BoundBox(PyObjectBase): """ ... - def united(self, boundBox2: "BoundBox") -> "BoundBox": + def united(self, boundBox2: "BoundBox", /) -> "BoundBox": """ united(boundBox2) -> Base.BoundBox @@ -248,7 +253,7 @@ class BoundBox(PyObjectBase): """ ... - def enlarge(self, variation: float) -> None: + def enlarge(self, variation: float, /) -> None: """ enlarge(variation) -> None @@ -259,7 +264,7 @@ class BoundBox(PyObjectBase): """ ... - def getIntersectionPoint(self, base: Vector, dir: Vector, epsilon: float = 0.0001) -> Vector: + def getIntersectionPoint(self, base: Vector, dir: Vector, epsilon: float = 0.0001, /) -> Vector: """ getIntersectionPoint(base, dir, epsilon=0.0001) -> Base.Vector @@ -276,11 +281,11 @@ class BoundBox(PyObjectBase): ... @overload - def move(self, displacement: Vector) -> None: ... + def move(self, displacement: Vector, /) -> None: ... @overload - def move(self, displacement: Tuple[float, float, float]) -> None: ... + def move(self, displacement: Tuple[float, float, float], /) -> None: ... @overload - def move(self, x: float, y: float, z: float) -> None: ... + def move(self, x: float, y: float, z: float, /) -> None: ... def move(self, *args: Any, **kwargs: Any) -> None: """ move(displacement) -> None @@ -300,11 +305,11 @@ class BoundBox(PyObjectBase): ... @overload - def scale(self, factor: Vector) -> None: ... + def scale(self, factor: Vector, /) -> None: ... @overload - def scale(self, factor: Tuple[float, float, float]) -> None: ... + def scale(self, factor: Tuple[float, float, float], /) -> None: ... @overload - def scale(self, x: float, y: float, z: float) -> None: ... + def scale(self, x: float, y: float, z: float, /) -> None: ... def scale(self, *args: Any, **kwargs: Any) -> None: """ scale(factor) -> None @@ -323,7 +328,7 @@ class BoundBox(PyObjectBase): """ ... - def transformed(self, matrix: Matrix) -> "BoundBox": + def transformed(self, matrix: Matrix, /) -> "BoundBox": """ transformed(matrix) -> Base.BoundBox @@ -335,7 +340,7 @@ class BoundBox(PyObjectBase): """ ... - def isCutPlane(self, base: Vector, normal: Vector) -> bool: + def isCutPlane(self, base: Vector, normal: Vector, /) -> bool: """ isCutPlane(base, normal) -> bool @@ -348,11 +353,11 @@ class BoundBox(PyObjectBase): ... @overload - def isInside(self, object: Vector) -> bool: ... + def isInside(self, object: Vector, /) -> bool: ... @overload - def isInside(self, object: "BoundBox") -> bool: ... + def isInside(self, object: "BoundBox", /) -> bool: ... @overload - def isInside(self, x: float, y: float, z: float) -> bool: ... + def isInside(self, x: float, y: float, z: float, /) -> bool: ... def isInside(self, *args: Any) -> bool: """ isInside(object) -> bool diff --git a/src/Base/CoordinateSystem.pyi b/src/Base/CoordinateSystem.pyi index b47ee17c1b..e65f143940 100644 --- a/src/Base/CoordinateSystem.pyi +++ b/src/Base/CoordinateSystem.pyi @@ -1,4 +1,6 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations from Metadata import export, constmethod from PyObjectBase import PyObjectBase @@ -40,7 +42,7 @@ class CoordinateSystem(PyObjectBase): Position: Vector = None """Set or get position.""" - def setAxes(self, axis: Union[AxisPy, Vector], xDir: Vector) -> None: + def setAxes(self, axis: Union[AxisPy, Vector], xDir: Vector, /) -> None: """ setAxes(axis, xDir) -> None @@ -54,7 +56,7 @@ class CoordinateSystem(PyObjectBase): ... @constmethod - def displacement(self, coordSystem2: "CoordinateSystem") -> Placement: + def displacement(self, coordSystem2: "CoordinateSystem", /) -> Placement: """ displacement(coordSystem2) -> Base.Placement @@ -64,7 +66,7 @@ class CoordinateSystem(PyObjectBase): """ ... - def transformTo(self, vector: Vector) -> Vector: + def transformTo(self, vector: Vector, /) -> Vector: """ transformTo(vector) -> Base.Vector @@ -74,7 +76,7 @@ class CoordinateSystem(PyObjectBase): """ ... - def transform(self, trans: Union[Rotation, Placement]) -> None: + def transform(self, trans: Union[Rotation, Placement], /) -> None: """ transform(trans) -> None @@ -84,7 +86,7 @@ class CoordinateSystem(PyObjectBase): """ ... - def setPlacement(self, placement: Placement) -> None: + def setPlacement(self, placement: Placement, /) -> None: """ setPlacement(placement) -> None diff --git a/src/Base/Matrix.pyi b/src/Base/Matrix.pyi index c2148a4d3d..bd144f584d 100644 --- a/src/Base/Matrix.pyi +++ b/src/Base/Matrix.pyi @@ -1,4 +1,6 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations from Vector import Vector from Metadata import export, constmethod, class_declarations, no_args @@ -105,9 +107,9 @@ class Matrix(PyObjectBase): """The matrix elements.""" @overload - def move(self, vector: Vector) -> None: ... + def move(self, vector: Vector, /) -> None: ... @overload - def move(self, x: float, y: float, z: float) -> None: ... + def move(self, x: float, y: float, z: float, /) -> None: ... def move(self, *args) -> None: """ move(vector) -> None @@ -127,11 +129,11 @@ class Matrix(PyObjectBase): ... @overload - def scale(self, vector: Vector) -> None: ... + def scale(self, vector: Vector, /) -> None: ... @overload - def scale(self, x: float, y: float, z: float) -> None: ... + def scale(self, x: float, y: float, z: float, /) -> None: ... @overload - def scale(self, factor: float) -> None: ... + def scale(self, factor: float, /) -> None: ... def scale(self, *args) -> None: """ scale(vector) -> None @@ -153,7 +155,7 @@ class Matrix(PyObjectBase): ... @constmethod - def hasScale(self, tol: float = 0) -> ScaleType: + def hasScale(self, tol: float = 0, /) -> ScaleType: """ hasScale(tol=0) -> ScaleType @@ -204,7 +206,7 @@ class Matrix(PyObjectBase): ... @constmethod - def isUnity(self, tol: float = 0.0) -> bool: + def isUnity(self, tol: float = 0.0, /) -> bool: """ isUnity([tol=0.0]) -> bool @@ -212,7 +214,7 @@ class Matrix(PyObjectBase): """ ... - def transform(self, vector: Vector, matrix2: "Matrix") -> None: + def transform(self, vector: Vector, matrix2: "Matrix", /) -> None: """ transform(vector, matrix2) -> None @@ -228,7 +230,7 @@ class Matrix(PyObjectBase): ... @constmethod - def col(self, index: int) -> Vector: + def col(self, index: int, /) -> Vector: """ col(index) -> Base.Vector @@ -240,7 +242,7 @@ class Matrix(PyObjectBase): """ ... - def setCol(self, index: int, vector: Vector) -> None: + def setCol(self, index: int, vector: Vector, /) -> None: """ setCol(index, vector) -> None @@ -254,7 +256,7 @@ class Matrix(PyObjectBase): ... @constmethod - def row(self, index: int) -> Vector: + def row(self, index: int, /) -> Vector: """ row(index) -> Base.Vector @@ -266,7 +268,7 @@ class Matrix(PyObjectBase): """ ... - def setRow(self, index: int, vector: Vector) -> None: + def setRow(self, index: int, vector: Vector, /) -> None: """ setRow(index, vector) -> None @@ -289,7 +291,7 @@ class Matrix(PyObjectBase): """ ... - def setDiagonal(self, vector: Vector) -> None: + def setDiagonal(self, vector: Vector, /) -> None: """ setDiagonal(vector) -> None @@ -299,7 +301,7 @@ class Matrix(PyObjectBase): """ ... - def rotateX(self, angle: float) -> None: + def rotateX(self, angle: float, /) -> None: """ rotateX(angle) -> None @@ -310,7 +312,7 @@ class Matrix(PyObjectBase): """ ... - def rotateY(self, angle: float) -> None: + def rotateY(self, angle: float, /) -> None: """ rotateY(angle) -> None @@ -321,7 +323,7 @@ class Matrix(PyObjectBase): """ ... - def rotateZ(self, angle: float) -> None: + def rotateZ(self, angle: float, /) -> None: """ rotateZ(angle) -> None @@ -333,11 +335,11 @@ class Matrix(PyObjectBase): ... @overload - def multiply(self, matrix: "Matrix") -> "Matrix": ... + def multiply(self, matrix: "Matrix", /) -> "Matrix": ... @overload - def multiply(self, vector: Vector) -> Vector: ... + def multiply(self, vector: Vector, /) -> Vector: ... @constmethod - def multiply(self, obj: Union["Matrix", Vector]) -> Union["Matrix", Vector]: + def multiply(self, obj: Union["Matrix", Vector], /) -> Union["Matrix", Vector]: """ multiply(matrix) -> Base.Matrix multiply(vector) -> Base.Vector @@ -351,7 +353,7 @@ class Matrix(PyObjectBase): ... @constmethod - def multVec(self, vector: Vector) -> Vector: + def multVec(self, vector: Vector, /) -> Vector: """ multVec(vector) -> Base.Vector @@ -410,7 +412,7 @@ class Matrix(PyObjectBase): ... @constmethod - def isOrthogonal(self, tol: float = 1e-6) -> float: + def isOrthogonal(self, tol: float = 1e-6, /) -> float: """ isOrthogonal(tol=1e-6) -> float @@ -423,7 +425,7 @@ class Matrix(PyObjectBase): ... @constmethod - def submatrix(self, dim: int) -> "Matrix": + def submatrix(self, dim: int, /) -> "Matrix": """ submatrix(dim) -> Base.Matrix diff --git a/src/Base/Metadata.pyi b/src/Base/Metadata.pyi index ad29731383..627775c30a 100644 --- a/src/Base/Metadata.pyi +++ b/src/Base/Metadata.pyi @@ -1,4 +1,6 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations """ This file keeps auxiliary metadata to be used by the Python API stubs. diff --git a/src/Base/Persistence.pyi b/src/Base/Persistence.pyi index 3fccfa6131..25ba13ac72 100644 --- a/src/Base/Persistence.pyi +++ b/src/Base/Persistence.pyi @@ -1,4 +1,6 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations from Metadata import constmethod from BaseClass import BaseClass @@ -21,7 +23,7 @@ class Persistence(BaseClass): """Memory size of the object in bytes.""" @constmethod - def dumpContent(self, *, Compression: int = 3) -> bytearray: + def dumpContent(self, Compression: int = 3) -> bytearray: """ dumpContent(Compression=3) -> bytearray @@ -33,7 +35,7 @@ class Persistence(BaseClass): """ ... - def restoreContent(self, obj: object) -> None: + def restoreContent(self, obj: object, /) -> None: # TODO: Starting with Python 3.12, collections.abc.Buffer can be used for type hinting """ restoreContent(obj) -> None diff --git a/src/Base/Placement.pyi b/src/Base/Placement.pyi index 8c96843bc3..d45cd4873f 100644 --- a/src/Base/Placement.pyi +++ b/src/Base/Placement.pyi @@ -1,4 +1,6 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations from Metadata import export, constmethod, class_declarations from PyObjectBase import PyObjectBase @@ -92,7 +94,7 @@ class Placement(PyObjectBase): """ ... - def move(self, vector: Vector) -> None: + def move(self, vector: Vector, /) -> None: """ move(vector) -> None @@ -103,7 +105,7 @@ class Placement(PyObjectBase): """ ... - def translate(self, vector: Vector) -> None: + def translate(self, vector: Vector, /) -> None: """ translate(vector) -> None @@ -139,7 +141,7 @@ class Placement(PyObjectBase): ... @constmethod - def multiply(self, placement: "Placement") -> "Placement": + def multiply(self, placement: "Placement", /) -> "Placement": """ multiply(placement) -> Base.Placement @@ -152,7 +154,7 @@ class Placement(PyObjectBase): ... @constmethod - def multVec(self, vector: Vector) -> Vector: + def multVec(self, vector: Vector, /) -> Vector: """ multVec(vector) -> Base.Vector @@ -182,7 +184,7 @@ class Placement(PyObjectBase): ... @constmethod - def pow(self, t: float, shorten: bool = True) -> "Placement": + def pow(self, t: float, shorten: bool = True, /) -> "Placement": """ pow(t, shorten=True) -> Base.Placement @@ -198,7 +200,7 @@ class Placement(PyObjectBase): ... @constmethod - def sclerp(self, placement2: "Placement", t: float, shorten: bool = True) -> "Placement": + def sclerp(self, placement2: "Placement", t: float, shorten: bool = True, /) -> "Placement": """ sclerp(placement2, t, shorten=True) -> Base.Placement @@ -219,7 +221,7 @@ class Placement(PyObjectBase): ... @constmethod - def slerp(self, placement2: "Placement", t: float) -> "Placement": + def slerp(self, placement2: "Placement", t: float, /) -> "Placement": """ slerp(placement2, t) -> Base.Placement @@ -236,7 +238,7 @@ class Placement(PyObjectBase): ... @constmethod - def isIdentity(self, tol: float = 0.0) -> bool: + def isIdentity(self, tol: float = 0.0, /) -> bool: """ isIdentity([tol=0.0]) -> bool @@ -249,7 +251,7 @@ class Placement(PyObjectBase): ... @constmethod - def isSame(self, other: "Placement", tol: float = 0.0) -> bool: + def isSame(self, other: "Placement", tol: float = 0.0, /) -> bool: """ isSame(Base.Placement, [tol=0.0]) -> bool diff --git a/src/Base/Precision.pyi b/src/Base/Precision.pyi index 91aa9691e6..b3ef75334f 100644 --- a/src/Base/Precision.pyi +++ b/src/Base/Precision.pyi @@ -1,4 +1,6 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations from PyObjectBase import PyObjectBase diff --git a/src/Base/PyObjectBase.pyi b/src/Base/PyObjectBase.pyi index 55521be167..7094cf8e73 100644 --- a/src/Base/PyObjectBase.pyi +++ b/src/Base/PyObjectBase.pyi @@ -1,4 +1,6 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations class PyObjectBase: """ diff --git a/src/Base/Quantity.pyi b/src/Base/Quantity.pyi index 68440a15ca..8845cfad4b 100644 --- a/src/Base/Quantity.pyi +++ b/src/Base/Quantity.pyi @@ -1,4 +1,6 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations from Metadata import export, constmethod from PyObjectBase import PyObjectBase @@ -53,7 +55,7 @@ class Quantity(PyObjectBase): # fmt: on @constmethod - def toStr(self, decimals: int = ...) -> str: + def toStr(self, decimals: int = ..., /) -> str: """ toStr([decimals]) @@ -63,9 +65,9 @@ class Quantity(PyObjectBase): ... @overload - def toStr(self) -> str: ... + def toStr(self, /) -> str: ... @overload - def toStr(self, decimals: int) -> str: ... + def toStr(self, decimals: int, /) -> str: ... @constmethod def getUserPreferred(self) -> Tuple["Quantity", str]: """ @@ -74,13 +76,13 @@ class Quantity(PyObjectBase): ... @overload - def getValueAs(self, unit: str) -> float: ... + def getValueAs(self, unit: str, /) -> float: ... @overload - def getValueAs(self, translation: float, unit_signature: int) -> float: ... + def getValueAs(self, translation: float, unit_signature: int, /) -> float: ... @overload - def getValueAs(self, unit: UnitPy) -> float: ... + def getValueAs(self, unit: UnitPy, /) -> float: ... @overload - def getValueAs(self, quantity: "Quantity") -> float: ... + def getValueAs(self, quantity: "Quantity", /) -> float: ... @constmethod def getValueAs(self, *args) -> float: """ @@ -96,7 +98,7 @@ class Quantity(PyObjectBase): ... @constmethod - def __round__(self, ndigits: int = ...) -> Union[int, float]: + def __round__(self, ndigits: int = ..., /) -> Union[int, float]: """ Returns the Integral closest to x, rounding half toward even. When an argument is passed, work like built-in round(x, ndigits). @@ -104,6 +106,6 @@ class Quantity(PyObjectBase): ... @overload - def __round__(self) -> int: ... + def __round__(self, /) -> int: ... @overload - def __round__(self, ndigits: int) -> float: ... + def __round__(self, ndigits: int, /) -> float: ... diff --git a/src/Base/Rotation.pyi b/src/Base/Rotation.pyi index c87b03852a..aa6346cbde 100644 --- a/src/Base/Rotation.pyi +++ b/src/Base/Rotation.pyi @@ -1,4 +1,6 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations from Metadata import export, constmethod, class_declarations from PyObjectBase import PyObjectBase @@ -144,7 +146,7 @@ class Rotation(PyObjectBase): """ ... - def isSame(self, rotation: "Rotation", tol: float = 0) -> bool: + def isSame(self, rotation: "Rotation", tol: float = 0, /) -> bool: """ isSame(rotation, tol=0) -> bool @@ -158,7 +160,7 @@ class Rotation(PyObjectBase): ... @constmethod - def multiply(self, rotation: "Rotation") -> "Rotation": + def multiply(self, rotation: "Rotation", /) -> "Rotation": """ multiply(rotation) -> Base.Rotation @@ -170,7 +172,7 @@ class Rotation(PyObjectBase): ... @constmethod - def multVec(self, vector: Vector) -> Vector: + def multVec(self, vector: Vector, /) -> Vector: """ multVec(vector) -> Base.Vector @@ -182,7 +184,7 @@ class Rotation(PyObjectBase): ... @constmethod - def slerp(self, rotation2: "Rotation", t: float) -> "Rotation": + def slerp(self, rotation2: "Rotation", t: float, /) -> "Rotation": """ slerp(rotation2, t) -> Base.Rotation @@ -193,7 +195,7 @@ class Rotation(PyObjectBase): """ ... - def setYawPitchRoll(self, angle1: float, angle2: float, angle3: float) -> None: + def setYawPitchRoll(self, angle1: float, angle2: float, angle3: float, /) -> None: """ setYawPitchRoll(angle1, angle2, angle3) -> None @@ -218,7 +220,7 @@ class Rotation(PyObjectBase): """ ... - def setEulerAngles(self, seq: str, angle1: float, angle2: float, angle3: float) -> None: + def setEulerAngles(self, seq: str, angle1: float, angle2: float, angle3: float, /) -> None: """ setEulerAngles(seq, angle1, angle2, angle3) -> None @@ -234,7 +236,7 @@ class Rotation(PyObjectBase): ... @constmethod - def toEulerAngles(self, seq: str = "") -> List[float]: + def toEulerAngles(self, seq: str = "", /) -> List[float]: """ toEulerAngles(seq) -> list @@ -265,7 +267,7 @@ class Rotation(PyObjectBase): ... @constmethod - def isIdentity(self, tol: float = 0) -> bool: + def isIdentity(self, tol: float = 0, /) -> bool: """ isIdentity(tol=0) -> bool diff --git a/src/Base/Type.pyi b/src/Base/Type.pyi index 4947eb5880..bb888e1be6 100644 --- a/src/Base/Type.pyi +++ b/src/Base/Type.pyi @@ -1,4 +1,6 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations from Metadata import export, forward_declarations, constmethod from PyObjectBase import PyObjectBase @@ -35,7 +37,7 @@ class Type(PyObjectBase): """Module in which this class is defined.""" @staticmethod - def fromName(name: str) -> "Type": + def fromName(name: str, /) -> "Type": """ fromName(name) -> Base.BaseType @@ -46,7 +48,7 @@ class Type(PyObjectBase): ... @staticmethod - def fromKey(key: int) -> "Type": + def fromKey(key: int, /) -> "Type": """ fromKey(key) -> Base.BaseType @@ -75,7 +77,7 @@ class Type(PyObjectBase): ... @staticmethod - def getAllDerivedFrom(type: str) -> List[str]: + def getAllDerivedFrom(type: str, /) -> List[str]: """ getAllDerivedFrom(type) -> list @@ -104,7 +106,7 @@ class Type(PyObjectBase): ... @constmethod - def isDerivedFrom(self, type: str) -> bool: + def isDerivedFrom(self, type: str, /) -> bool: """ isDerivedFrom(type) -> bool @@ -132,7 +134,7 @@ class Type(PyObjectBase): ... @staticmethod - def createInstanceByName(name: str, load: bool = False) -> object: + def createInstanceByName(name: str, load: bool = False, /) -> object: """ createInstanceByName(name, load=False) -> object diff --git a/src/Base/Unit.pyi b/src/Base/Unit.pyi index 815d839dcd..876b713069 100644 --- a/src/Base/Unit.pyi +++ b/src/Base/Unit.pyi @@ -1,4 +1,6 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations from Metadata import export from PyObjectBase import PyObjectBase diff --git a/src/Base/Vector.pyi b/src/Base/Vector.pyi index 84946e7171..3cf1787082 100644 --- a/src/Base/Vector.pyi +++ b/src/Base/Vector.pyi @@ -1,4 +1,6 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations from Metadata import export, constmethod, sequence_protocol, class_declarations from PyObjectBase import PyObjectBase @@ -93,7 +95,7 @@ class Vector(PyObjectBase): ... @constmethod - def add(self, vector2: "Vector") -> "Vector": + def add(self, vector2: "Vector", /) -> "Vector": """ add(vector2) -> Base.Vector @@ -104,7 +106,7 @@ class Vector(PyObjectBase): ... @constmethod - def sub(self, vector2: "Vector") -> "Vector": + def sub(self, vector2: "Vector", /) -> "Vector": """ sub(vector2) -> Base.Vector @@ -123,7 +125,7 @@ class Vector(PyObjectBase): """ ... - def scale(self, x: float, y: float, z: float) -> "Vector": + def scale(self, x: float, y: float, z: float, /) -> "Vector": """ scale(x, y, z) -> Base.Vector @@ -138,7 +140,7 @@ class Vector(PyObjectBase): """ ... - def multiply(self, factor: float) -> "Vector": + def multiply(self, factor: float, /) -> "Vector": """ multiply(factor) -> Base.Vector @@ -150,7 +152,7 @@ class Vector(PyObjectBase): ... @constmethod - def dot(self, vector2: "Vector") -> float: + def dot(self, vector2: "Vector", /) -> float: """ dot(vector2) -> float @@ -161,7 +163,7 @@ class Vector(PyObjectBase): ... @constmethod - def cross(self, vector2: "Vector") -> "Vector": + def cross(self, vector2: "Vector", /) -> "Vector": """ cross(vector2) -> Base.Vector @@ -172,7 +174,7 @@ class Vector(PyObjectBase): ... @constmethod - def isOnLineSegment(self, vector1: "Vector", vector2: "Vector") -> bool: + def isOnLineSegment(self, vector1: "Vector", vector2: "Vector", /) -> bool: """ isOnLineSegment(vector1, vector2) -> bool @@ -184,7 +186,7 @@ class Vector(PyObjectBase): ... @constmethod - def getAngle(self, vector2: "Vector") -> float: + def getAngle(self, vector2: "Vector", /) -> float: """ getAngle(vector2) -> float @@ -203,7 +205,7 @@ class Vector(PyObjectBase): ... @constmethod - def isEqual(self, vector2: "Vector", tol: float = 0) -> bool: + def isEqual(self, vector2: "Vector", tol: float = 0, /) -> bool: """ isEqual(vector2, tol=0) -> bool @@ -216,7 +218,7 @@ class Vector(PyObjectBase): ... @constmethod - def isParallel(self, vector2: "Vector", tol: float = 0) -> bool: + def isParallel(self, vector2: "Vector", tol: float = 0, /) -> bool: """ isParallel(vector2, tol=0) -> bool @@ -229,7 +231,7 @@ class Vector(PyObjectBase): ... @constmethod - def isNormal(self, vector2: "Vector", tol: float = 0) -> bool: + def isNormal(self, vector2: "Vector", tol: float = 0, /) -> bool: """ isNormal(vector2, tol=0) -> bool @@ -241,7 +243,7 @@ class Vector(PyObjectBase): """ ... - def projectToLine(self, point: "Vector", dir: "Vector") -> "Vector": + def projectToLine(self, point: "Vector", dir: "Vector", /) -> "Vector": """ projectToLine(point, dir) -> Base.Vector @@ -257,7 +259,7 @@ class Vector(PyObjectBase): """ ... - def projectToPlane(self, base: "Vector", normal: "Vector") -> "Vector": + def projectToPlane(self, base: "Vector", normal: "Vector", /) -> "Vector": """ projectToPlane(base, normal) -> Base.Vector @@ -270,7 +272,7 @@ class Vector(PyObjectBase): ... @constmethod - def distanceToPoint(self, point2: "Vector") -> float: + def distanceToPoint(self, point2: "Vector", /) -> float: """ distanceToPoint(point2) -> float @@ -281,7 +283,7 @@ class Vector(PyObjectBase): ... @constmethod - def distanceToLine(self, base: "Vector", dir: "Vector") -> float: + def distanceToLine(self, base: "Vector", dir: "Vector", /) -> float: """ distanceToLine(base, dir) -> float @@ -295,7 +297,7 @@ class Vector(PyObjectBase): ... @constmethod - def distanceToLineSegment(self, point1: "Vector", point2: "Vector") -> "Vector": + def distanceToLineSegment(self, point1: "Vector", point2: "Vector", /) -> "Vector": """ distanceToLineSegment(point1, point2) -> Base.Vector @@ -309,7 +311,7 @@ class Vector(PyObjectBase): ... @constmethod - def distanceToPlane(self, base: "Vector", normal: "Vector") -> float: + def distanceToPlane(self, base: "Vector", normal: "Vector", /) -> float: """ distanceToPlane(base, normal) -> float diff --git a/src/Gui/AxisOrigin.pyi b/src/Gui/AxisOrigin.pyi index 0f8d75a50b..045e9bd276 100644 --- a/src/Gui/AxisOrigin.pyi +++ b/src/Gui/AxisOrigin.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.BaseClass import BaseClass from typing import Any, Final, Tuple, Dict @@ -17,7 +21,7 @@ class AxisOrigin(BaseClass): """ @constmethod - def getElementPicked(self, pickedPoint: Any) -> str: + def getElementPicked(self, pickedPoint: Any, /) -> str: """ getElementPicked(pickedPoint) -> str @@ -28,7 +32,7 @@ class AxisOrigin(BaseClass): ... @constmethod - def getDetailPath(self, subname: str, path: Any) -> Any: + def getDetailPath(self, subname: str, path: Any, /) -> Any: """ getDetailPath(subname, path) -> coin.SoDetail or None diff --git a/src/Gui/Command.pyi b/src/Gui/Command.pyi index 33e6d0788e..bb05492962 100644 --- a/src/Gui/Command.pyi +++ b/src/Gui/Command.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import constmethod from Base.PyObjectBase import PyObjectBase from typing import Any, Dict, List, Optional @@ -11,7 +15,7 @@ class Command(PyObjectBase): """ @staticmethod - def get(name: str) -> Optional["Command"]: + def get(name: str, /) -> Optional["Command"]: """ get(name) -> Gui.Command or None @@ -41,7 +45,7 @@ class Command(PyObjectBase): ... @staticmethod - def listByShortcut(string: str, useRegExp: bool = False) -> List[str]: + def listByShortcut(string: str, useRegExp: bool = False, /) -> List[str]: """ listByShortcut(string, useRegExp=False) -> list of str @@ -56,7 +60,7 @@ class Command(PyObjectBase): """ ... - def run(self, item: int = 0) -> None: + def run(self, item: int = 0, /) -> None: """ run(item=0) -> None @@ -84,7 +88,7 @@ class Command(PyObjectBase): """ ... - def setShortcut(self, string: str) -> bool: + def setShortcut(self, string: str, /) -> bool: """ setShortcut(string) -> bool @@ -153,7 +157,7 @@ class Command(PyObjectBase): ... @staticmethod - def removeCustomCommand(name: str) -> bool: + def removeCustomCommand(name: str, /) -> bool: """ removeCustomCommand(name) -> bool @@ -169,7 +173,7 @@ class Command(PyObjectBase): ... @staticmethod - def findCustomCommand(name: str) -> Optional[str]: + def findCustomCommand(name: str, /) -> Optional[str]: """ findCustomCommand(name) -> str or None diff --git a/src/Gui/Document.pyi b/src/Gui/Document.pyi index e1dc745789..375ee67a70 100644 --- a/src/Gui/Document.pyi +++ b/src/Gui/Document.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import constmethod from Base.Persistence import Persistence from Base.Matrix import Matrix @@ -11,7 +15,7 @@ class Document(Persistence): Licence: LGPL """ - def show(self, objName: str) -> None: + def show(self, objName: str, /) -> None: """ show(objName) -> None @@ -22,7 +26,7 @@ class Document(Persistence): """ ... - def hide(self, objName: str) -> None: + def hide(self, objName: str, /) -> None: """ hide(objName) -> None @@ -33,7 +37,7 @@ class Document(Persistence): """ ... - def setPos(self, objName: str, matrix: Matrix) -> None: + def setPos(self, objName: str, matrix: Matrix, /) -> None: """ setPos(objName, matrix) -> None @@ -47,7 +51,7 @@ class Document(Persistence): """ ... - def setEdit(self, obj: Any, mod: int = 0, subName: Optional[str] = None) -> bool: + def setEdit(self, obj: Any, mod: int = 0, subName: Optional[str] = None, /) -> bool: """ setEdit(obj, mod=0, subName) -> bool @@ -78,7 +82,7 @@ class Document(Persistence): """ ... - def addAnnotation(self, annoName: str, fileName: str, modName: str) -> None: + def addAnnotation(self, annoName: str, fileName: str, modName: str, /) -> None: """ addAnnotation(annoName, fileName, modName) -> None @@ -101,7 +105,7 @@ class Document(Persistence): """ ... - def getObject(self, objName: str) -> Optional[Any]: + def getObject(self, objName: str, /) -> Optional[Any]: """ getObject(objName) -> object or None @@ -128,7 +132,7 @@ class Document(Persistence): """ ... - def createView(self, type: str) -> Optional[Any]: + def createView(self, type: str, /) -> Optional[Any]: """ createView(type) -> object or None @@ -140,7 +144,7 @@ class Document(Persistence): ... @constmethod - def mdiViewsOfType(self, type: str) -> List[Any]: + def mdiViewsOfType(self, type: str, /) -> List[Any]: """ mdiViewsOfType(type) -> list of MDIView @@ -167,7 +171,7 @@ class Document(Persistence): """ ... - def sendMsgToViews(self, msg: str) -> None: + def sendMsgToViews(self, msg: str, /) -> None: """ sendMsgToViews(msg) -> None @@ -177,7 +181,7 @@ class Document(Persistence): """ ... - def mergeProject(self, fileName: str) -> None: + def mergeProject(self, fileName: str, /) -> None: """ mergeProject(fileName) -> None @@ -188,7 +192,8 @@ class Document(Persistence): """ ... - def toggleTreeItem(self, obj: Any, mod: int = 0, subName: Optional[str] = None) -> None: + def toggleTreeItem( + self, obj: Any, mod: int = 0, subName: Optional[str] = None, /) -> None: """ toggleTreeItem(obj, mod=0, subName) -> None @@ -203,7 +208,7 @@ class Document(Persistence): """ ... - def scrollToTreeItem(self, obj: Any) -> None: + def scrollToTreeItem(self, obj: Any, /) -> None: """ scrollToTreeItem(obj) -> None @@ -213,7 +218,7 @@ class Document(Persistence): """ ... - def toggleInSceneGraph(self, obj: Any) -> None: + def toggleInSceneGraph(self, obj: Any, /) -> None: """ toggleInSceneGraph(obj) -> None diff --git a/src/Gui/LinkView.pyi b/src/Gui/LinkView.pyi index 4faa578074..c6197ad87f 100644 --- a/src/Gui/LinkView.pyi +++ b/src/Gui/LinkView.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.BaseClass import BaseClass from typing import Any, Final, List, Dict, Tuple, overload @@ -21,7 +25,7 @@ class LinkView(BaseClass): """ ... - def setMaterial(self, material: Any) -> None: + def setMaterial(self, material: Any, /) -> None: """ setMaterial(Material): set the override material of the entire linked object @@ -38,14 +42,18 @@ class LinkView(BaseClass): ... @overload - def setMaterial(self, material: None) -> None: ... + def setMaterial(self, material: None, /) -> None: ... + @overload - def setMaterial(self, material: Any) -> None: ... + def setMaterial(self, material: Any, /) -> None: ... + @overload - def setMaterial(self, material: List[Any]) -> None: ... + def setMaterial(self, material: List[Any], /) -> None: ... + @overload - def setMaterial(self, material: Dict[int, Any]) -> None: ... - def setType(self, type: int, sublink: bool = True) -> None: + def setMaterial(self, material: Dict[int, Any], /) -> None: ... + + def setType(self, type: int, sublink: bool = True, /) -> None: """ setType(type, sublink=True): set the link type. @@ -61,10 +69,12 @@ class LinkView(BaseClass): ... @overload - def setType(self, type: int) -> None: ... + def setType(self, type: int, /) -> None: ... + @overload - def setType(self, type: int, sublink: bool) -> None: ... - def setTransform(self, matrix: Any) -> None: + def setType(self, type: int, sublink: bool, /) -> None: ... + + def setTransform(self, matrix: Any, /) -> None: """ setTransform(matrix): set transformation of the linked object @@ -77,12 +87,16 @@ class LinkView(BaseClass): ... @overload - def setTransform(self, matrix: Any) -> None: ... + def setTransform(self, matrix: Any, /) -> None: ... + @overload - def setTransform(self, matrix: List[Any]) -> None: ... + def setTransform(self, matrix: List[Any], /) -> None: ... + @overload - def setTransform(self, matrix: Dict[int, Any]) -> None: ... - def setChildren(self, children: List[Any], vis: List[Any] = [], type: int = 0) -> None: + def setTransform(self, matrix: Dict[int, Any], /) -> None: ... + + def setChildren( + self, children: List[Any], vis: List[Any] = [], type: int = 0, /) -> None: """ setChildren([obj...],vis=[],type=0) Group a list of children objects. Note, this mode of operation is incompatible @@ -98,7 +112,7 @@ class LinkView(BaseClass): """ ... - def setLink(self, obj: Any, subname: Any = None) -> None: + def setLink(self, obj: Any, subname: Any = None, /) -> None: """ setLink(object): Set the link @@ -116,12 +130,15 @@ class LinkView(BaseClass): ... @overload - def setLink(self, obj: Any) -> None: ... + def setLink(self, obj: Any, /) -> None: ... + @overload - def setLink(self, obj: Any, subname: str) -> None: ... + def setLink(self, obj: Any, subname: str, /) -> None: ... + @overload - def setLink(self, obj: Any, subname: List[str]) -> None: ... - def getDetailPath(self, element: Any) -> Tuple[Any, Any]: + def setLink(self, obj: Any, subname: List[str], /) -> None: ... + + def getDetailPath(self, element: Any, /) -> Tuple[Any, Any]: """ getDetailPath(element): get the 3d path an detail of an element. @@ -129,13 +146,13 @@ class LinkView(BaseClass): """ ... - def getElementPicked(self, pickPoint: Any) -> Any: + def getElementPicked(self, pickPoint: Any, /) -> Any: """ getElementPicked(pickPoint): get the element under a 3d pick point. """ ... - def getBoundBox(self, vobj: Any = None) -> Any: + def getBoundBox(self, vobj: Any = None, /) -> Any: """ getBoundBox(vobj=None): get the bounding box. """ diff --git a/src/Gui/PythonWorkbench.pyi b/src/Gui/PythonWorkbench.pyi index e3ba7ea844..d182eadb42 100644 --- a/src/Gui/PythonWorkbench.pyi +++ b/src/Gui/PythonWorkbench.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from Workbench import Workbench from warnings import deprecated diff --git a/src/Gui/Selection/SelectionObject.pyi b/src/Gui/Selection/SelectionObject.pyi index 676cc5f1f0..22ee6683c5 100644 --- a/src/Gui/Selection/SelectionObject.pyi +++ b/src/Gui/Selection/SelectionObject.pyi @@ -25,7 +25,7 @@ class SelectionObject(BaseClass): """ ... - def isObjectTypeOf(self, type: Any) -> bool: + def isObjectTypeOf(self, type: Any, /) -> bool: """ Test for a certain father class. isObjectTypeOf(type) -> Bool diff --git a/src/Gui/ViewProvider.pyi b/src/Gui/ViewProvider.pyi index 300beb369e..4041f73050 100644 --- a/src/Gui/ViewProvider.pyi +++ b/src/Gui/ViewProvider.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import constmethod from Base.BoundBox import BoundBox from App.ExtensionContainer import ExtensionContainer @@ -50,7 +54,7 @@ class ViewProvider(ExtensionContainer): """ ... - def removeProperty(self, name: str) -> bool: + def removeProperty(self, name: str, /) -> bool: """ removeProperty(name) -> bool @@ -94,7 +98,7 @@ class ViewProvider(ExtensionContainer): """ ... - def canDragObject(self, obj: Any = None) -> bool: + def canDragObject(self, obj: Any = None, /) -> bool: """ canDragObject(obj=None) -> bool @@ -106,7 +110,7 @@ class ViewProvider(ExtensionContainer): """ ... - def dragObject(self, obj: Any) -> None: + def dragObject(self, obj: Any, /) -> None: """ dragObject(obj) -> None @@ -158,7 +162,7 @@ class ViewProvider(ExtensionContainer): """ ... - def canDragAndDropObject(self, obj: Any) -> bool: + def canDragAndDropObject(self, obj: Any, /) -> bool: """ canDragAndDropObject(obj) -> bool @@ -170,7 +174,7 @@ class ViewProvider(ExtensionContainer): """ ... - def replaceObject(self, oldObj: Any, newObj: Any) -> int: + def replaceObject(self, oldObj: Any, newObj: Any, /) -> int: """ replaceObject(oldObj, newObj) -> int @@ -192,7 +196,7 @@ class ViewProvider(ExtensionContainer): """ ... - def addDisplayMode(self, obj: Any, mode: str) -> None: + def addDisplayMode(self, obj: Any, mode: str, /) -> None: """ addDisplayMode(obj, mode) -> None @@ -221,7 +225,7 @@ class ViewProvider(ExtensionContainer): """ ... - def setTransformation(self, trans: Any) -> None: + def setTransformation(self, trans: Any, /) -> None: """ setTransformation(trans) -> None @@ -249,7 +253,7 @@ class ViewProvider(ExtensionContainer): """ ... - def partialRender(self, sub: Any = None, clear: bool = False) -> int: + def partialRender(self, sub: Any = None, clear: bool = False, /) -> int: """ partialRender(sub=None, clear=False) -> int @@ -262,7 +266,7 @@ class ViewProvider(ExtensionContainer): """ ... - def getElementColors(self, elementName: Optional[str] = None) -> dict: + def getElementColors(self, elementName: Optional[str] = None, /) -> dict: """ getElementColors(elementName) -> dict @@ -274,7 +278,7 @@ class ViewProvider(ExtensionContainer): """ ... - def setElementColors(self, colors: dict) -> None: + def setElementColors(self, colors: dict, /) -> None: """ setElementColors(colors) -> None @@ -286,7 +290,7 @@ class ViewProvider(ExtensionContainer): ... @constmethod - def getElementPicked(self, pickPoint: Any) -> str: + def getElementPicked(self, pickPoint: Any, /) -> str: """ getElementPicked(pickPoint) -> str @@ -297,7 +301,7 @@ class ViewProvider(ExtensionContainer): ... @constmethod - def getDetailPath(self, subelement: str, path: Any, append: bool = True) -> Any: + def getDetailPath(self, subelement: str, path: Any, append: bool = True, /) -> Any: """ getDetailPath(subelement, path, append=True) -> coin.SoDetail or None @@ -323,8 +327,7 @@ class ViewProvider(ExtensionContainer): ... def getBoundingBox( - self, subName: Optional[str] = None, transform: bool = True, view: Any = None - ) -> BoundBox: + self, subName: Optional[str] = None, transform: bool = True, view: Any = None, /) -> BoundBox: """ getBoundingBox(subName, transform=True, view) -> Base.BoundBox diff --git a/src/Gui/ViewProviderDocumentObject.pyi b/src/Gui/ViewProviderDocumentObject.pyi index 83bb882370..b9c32daab5 100644 --- a/src/Gui/ViewProviderDocumentObject.pyi +++ b/src/Gui/ViewProviderDocumentObject.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from ViewProvider import ViewProvider from typing import Any, Final diff --git a/src/Gui/ViewProviderExtension.pyi b/src/Gui/ViewProviderExtension.pyi index eb5800c6e8..f0e7c53f17 100644 --- a/src/Gui/ViewProviderExtension.pyi +++ b/src/Gui/ViewProviderExtension.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import constmethod from App.Extension import Extension diff --git a/src/Gui/ViewProviderGeometryObject.pyi b/src/Gui/ViewProviderGeometryObject.pyi index 14ee732de4..8e909879b3 100644 --- a/src/Gui/ViewProviderGeometryObject.pyi +++ b/src/Gui/ViewProviderGeometryObject.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import no_args from ViewProviderDocumentObject import ViewProviderDocumentObject diff --git a/src/Gui/ViewProviderLink.pyi b/src/Gui/ViewProviderLink.pyi index 2e75516a03..97d2971e59 100644 --- a/src/Gui/ViewProviderLink.pyi +++ b/src/Gui/ViewProviderLink.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from ViewProviderDocumentObject import ViewProviderDocumentObject from typing import Any, Final diff --git a/src/Gui/Workbench.pyi b/src/Gui/Workbench.pyi index 3688761e93..2bff9d2b59 100644 --- a/src/Gui/Workbench.pyi +++ b/src/Gui/Workbench.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from Base.BaseClass import BaseClass from typing import Any, List, Dict diff --git a/src/Mod/Assembly/App/AssemblyLink.pyi b/src/Mod/Assembly/App/AssemblyLink.pyi index e5305bef46..c5e8bf9d4c 100644 --- a/src/Mod/Assembly/App/AssemblyLink.pyi +++ b/src/Mod/Assembly/App/AssemblyLink.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Final from Base.Metadata import export diff --git a/src/Mod/Assembly/App/AssemblyObject.pyi b/src/Mod/Assembly/App/AssemblyObject.pyi index 016d749bf4..4c1526c131 100644 --- a/src/Mod/Assembly/App/AssemblyObject.pyi +++ b/src/Mod/Assembly/App/AssemblyObject.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any, Final from Base.Metadata import constmethod, export diff --git a/src/Mod/Assembly/App/BomGroup.pyi b/src/Mod/Assembly/App/BomGroup.pyi index 7157bc70ad..12c69672fa 100644 --- a/src/Mod/Assembly/App/BomGroup.pyi +++ b/src/Mod/Assembly/App/BomGroup.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from App.DocumentObjectGroup import DocumentObjectGroup diff --git a/src/Mod/Assembly/App/BomObject.pyi b/src/Mod/Assembly/App/BomObject.pyi index 9e6df7de1b..bdb3d684ef 100644 --- a/src/Mod/Assembly/App/BomObject.pyi +++ b/src/Mod/Assembly/App/BomObject.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from Spreadsheet.Sheet import Sheet diff --git a/src/Mod/Assembly/App/JointGroup.pyi b/src/Mod/Assembly/App/JointGroup.pyi index 1a23e0f5c5..6c452712ab 100644 --- a/src/Mod/Assembly/App/JointGroup.pyi +++ b/src/Mod/Assembly/App/JointGroup.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from App.DocumentObjectGroup import DocumentObjectGroup diff --git a/src/Mod/Assembly/App/SimulationGroup.pyi b/src/Mod/Assembly/App/SimulationGroup.pyi index bcd589cd8c..f4cef9043b 100644 --- a/src/Mod/Assembly/App/SimulationGroup.pyi +++ b/src/Mod/Assembly/App/SimulationGroup.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from App.DocumentObjectGroup import DocumentObjectGroup diff --git a/src/Mod/Assembly/App/ViewGroup.pyi b/src/Mod/Assembly/App/ViewGroup.pyi index c5d3ad26e3..8092311fd0 100644 --- a/src/Mod/Assembly/App/ViewGroup.pyi +++ b/src/Mod/Assembly/App/ViewGroup.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from App.DocumentObjectGroup import DocumentObjectGroup diff --git a/src/Mod/Assembly/Gui/ViewProviderAssembly.pyi b/src/Mod/Assembly/Gui/ViewProviderAssembly.pyi index 11ccd4ba1d..a4518edb3e 100644 --- a/src/Mod/Assembly/Gui/ViewProviderAssembly.pyi +++ b/src/Mod/Assembly/Gui/ViewProviderAssembly.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any from Base.Metadata import export diff --git a/src/Mod/CAM/App/Command.pyi b/src/Mod/CAM/App/Command.pyi index 6667069d8a..e9c1323b46 100644 --- a/src/Mod/CAM/App/Command.pyi +++ b/src/Mod/CAM/App/Command.pyi @@ -24,11 +24,11 @@ class Command(Persistence): """toGCode(): returns a GCode representation of the command""" ... - def setFromGCode(self, gcode: str) -> None: + def setFromGCode(self, gcode: str, /) -> None: """setFromGCode(): sets the path from the contents of the given GCode string""" ... - def transform(self, placement: Placement) -> "CommandPy": + def transform(self, placement: Placement, /) -> "CommandPy": """transform(Placement): returns a copy of this command transformed by the given placement""" ... Name: str diff --git a/src/Mod/CAM/PathSimulator/App/PathSim.pyi b/src/Mod/CAM/PathSimulator/App/PathSim.pyi index 257f54ed03..322f9f31f8 100644 --- a/src/Mod/CAM/PathSimulator/App/PathSim.pyi +++ b/src/Mod/CAM/PathSimulator/App/PathSim.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any, Final from Base.BaseClass import BaseClass diff --git a/src/Mod/CAM/PathSimulator/AppGL/CAMSim.pyi b/src/Mod/CAM/PathSimulator/AppGL/CAMSim.pyi index 5b565b3fac..c5189a1ceb 100644 --- a/src/Mod/CAM/PathSimulator/AppGL/CAMSim.pyi +++ b/src/Mod/CAM/PathSimulator/AppGL/CAMSim.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any from Base.BaseClass import BaseClass diff --git a/src/Mod/Fem/App/FemMesh.pyi b/src/Mod/Fem/App/FemMesh.pyi index c48dec78c6..20c6f05dfd 100644 --- a/src/Mod/Fem/App/FemMesh.pyi +++ b/src/Mod/Fem/App/FemMesh.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any, Final from Base.Metadata import constmethod, export diff --git a/src/Mod/Fem/App/FemPostBranchFilter.pyi b/src/Mod/Fem/App/FemPostBranchFilter.pyi index ece7da0df6..7fae9c27bf 100644 --- a/src/Mod/Fem/App/FemPostBranchFilter.pyi +++ b/src/Mod/Fem/App/FemPostBranchFilter.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any from Base.Metadata import export diff --git a/src/Mod/Fem/App/FemPostFilter.pyi b/src/Mod/Fem/App/FemPostFilter.pyi index aa11328dcd..52db00dc52 100644 --- a/src/Mod/Fem/App/FemPostFilter.pyi +++ b/src/Mod/Fem/App/FemPostFilter.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any from Base.Metadata import export diff --git a/src/Mod/Fem/App/FemPostObject.pyi b/src/Mod/Fem/App/FemPostObject.pyi index 7f40fd4e04..11f4bb1766 100644 --- a/src/Mod/Fem/App/FemPostObject.pyi +++ b/src/Mod/Fem/App/FemPostObject.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any from Base.Metadata import export diff --git a/src/Mod/Fem/App/FemPostPipeline.pyi b/src/Mod/Fem/App/FemPostPipeline.pyi index 9541c17c3b..d22535364d 100644 --- a/src/Mod/Fem/App/FemPostPipeline.pyi +++ b/src/Mod/Fem/App/FemPostPipeline.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any from Base.Metadata import export diff --git a/src/Mod/Fem/Gui/ViewProviderFemConstraint.pyi b/src/Mod/Fem/Gui/ViewProviderFemConstraint.pyi index 25bbf21b09..d64ba3d0e3 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemConstraint.pyi +++ b/src/Mod/Fem/Gui/ViewProviderFemConstraint.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any, Final from Base.Metadata import export diff --git a/src/Mod/Fem/Gui/ViewProviderFemMesh.pyi b/src/Mod/Fem/Gui/ViewProviderFemMesh.pyi index 12d32a201b..3ca4703201 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemMesh.pyi +++ b/src/Mod/Fem/Gui/ViewProviderFemMesh.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any, Final from Base.Metadata import export diff --git a/src/Mod/Fem/Gui/ViewProviderFemPostFilter.pyi b/src/Mod/Fem/Gui/ViewProviderFemPostFilter.pyi index 31df8d37cc..1f24bd16de 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemPostFilter.pyi +++ b/src/Mod/Fem/Gui/ViewProviderFemPostFilter.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any from Base.Metadata import export diff --git a/src/Mod/Fem/Gui/ViewProviderFemPostPipeline.pyi b/src/Mod/Fem/Gui/ViewProviderFemPostPipeline.pyi index 5b839711aa..437ec02dff 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemPostPipeline.pyi +++ b/src/Mod/Fem/Gui/ViewProviderFemPostPipeline.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any from Base.Metadata import export diff --git a/src/Mod/Import/App/StepShape.pyi b/src/Mod/Import/App/StepShape.pyi index d72609d138..247216a716 100644 --- a/src/Mod/Import/App/StepShape.pyi +++ b/src/Mod/Import/App/StepShape.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any from Base.Metadata import export diff --git a/src/Mod/Material/App/Array2D.pyi b/src/Mod/Material/App/Array2D.pyi index 7325e84490..5b089570c3 100644 --- a/src/Mod/Material/App/Array2D.pyi +++ b/src/Mod/Material/App/Array2D.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from Base.BaseClass import BaseClass from Base.Metadata import constmethod @@ -33,20 +37,20 @@ class Array2D(BaseClass): """The number of columns in the array.""" @constmethod - def getRow(self, value: Any) -> Any: + def getRow(self, value: Any, /) -> Any: """ Get the row given the first column value """ ... @constmethod - def getValue(self, row: int, column: int) -> Any: + def getValue(self, row: int, column: int, /) -> Any: """ Get the value at the given row and column """ ... - def setValue(self, row: int, column: int, value: Any): + def setValue(self, row: int, column: int, value: Any, /): """ Set the value at the given row and column """ diff --git a/src/Mod/Material/App/Array3D.pyi b/src/Mod/Material/App/Array3D.pyi index 9a0d6cc5c1..9ad00b2461 100644 --- a/src/Mod/Material/App/Array3D.pyi +++ b/src/Mod/Material/App/Array3D.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.BaseClass import BaseClass from typing import Any, Final, List @@ -52,19 +56,19 @@ class Array3D(BaseClass): """ ... - def setDepthValue(self, value: Any): + def setDepthValue(self, value: Any, /): """ Set the column value at the given depth """ ... - def setValue(self, depth: int, row: int, column: int, value: Any): + def setValue(self, depth: int, row: int, column: int, value: Any, /): """ Set the value at the given depth, row, and column """ ... - def setRows(self, depth: int, value: int): + def setRows(self, depth: int, value: int, /): """ Set the number of rows at the given depth """ diff --git a/src/Mod/Material/App/Material.pyi b/src/Mod/Material/App/Material.pyi index 7a95608df9..47c8b84b72 100644 --- a/src/Mod/Material/App/Material.pyi +++ b/src/Mod/Material/App/Material.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, no_args, sequence_protocol from Base.BaseClass import BaseClass from typing import Final, Dict diff --git a/src/Mod/Material/App/MaterialFilter.pyi b/src/Mod/Material/App/MaterialFilter.pyi index f131306a4c..513f89e9af 100644 --- a/src/Mod/Material/App/MaterialFilter.pyi +++ b/src/Mod/Material/App/MaterialFilter.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.BaseClass import BaseClass from typing import List diff --git a/src/Mod/Material/App/MaterialFilterOptions.pyi b/src/Mod/Material/App/MaterialFilterOptions.pyi index d3b6a5bd8e..d3c8938c2d 100644 --- a/src/Mod/Material/App/MaterialFilterOptions.pyi +++ b/src/Mod/Material/App/MaterialFilterOptions.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from Base.BaseClass import BaseClass diff --git a/src/Mod/Material/App/MaterialLibrary.pyi b/src/Mod/Material/App/MaterialLibrary.pyi index badd65e69e..80690567bc 100644 --- a/src/Mod/Material/App/MaterialLibrary.pyi +++ b/src/Mod/Material/App/MaterialLibrary.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.BaseClass import BaseClass from typing import Final diff --git a/src/Mod/Material/App/MaterialManager.pyi b/src/Mod/Material/App/MaterialManager.pyi index 493725bc01..1fb65fb286 100644 --- a/src/Mod/Material/App/MaterialManager.pyi +++ b/src/Mod/Material/App/MaterialManager.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.BaseClass import BaseClass from typing import Final, List, Dict, overload diff --git a/src/Mod/Material/App/MaterialProperty.pyi b/src/Mod/Material/App/MaterialProperty.pyi index c5c827d484..999d716904 100644 --- a/src/Mod/Material/App/MaterialProperty.pyi +++ b/src/Mod/Material/App/MaterialProperty.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from ModelProperty import ModelProperty from typing import Final diff --git a/src/Mod/Material/App/Model.pyi b/src/Mod/Material/App/Model.pyi index f004c64eb6..51f765a1ac 100644 --- a/src/Mod/Material/App/Model.pyi +++ b/src/Mod/Material/App/Model.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.BaseClass import BaseClass from typing import Final, List, Dict, overload diff --git a/src/Mod/Material/App/ModelManager.pyi b/src/Mod/Material/App/ModelManager.pyi index e7e28f3435..3d2ba4119e 100644 --- a/src/Mod/Material/App/ModelManager.pyi +++ b/src/Mod/Material/App/ModelManager.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.BaseClass import BaseClass from typing import Final, List, Dict diff --git a/src/Mod/Material/App/ModelProperty.pyi b/src/Mod/Material/App/ModelProperty.pyi index 370f6f3422..c745ab0763 100644 --- a/src/Mod/Material/App/ModelProperty.pyi +++ b/src/Mod/Material/App/ModelProperty.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.BaseClass import BaseClass from typing import Final diff --git a/src/Mod/Material/App/UUIDs.pyi b/src/Mod/Material/App/UUIDs.pyi index 2fd83a6f39..629b2f2add 100644 --- a/src/Mod/Material/App/UUIDs.pyi +++ b/src/Mod/Material/App/UUIDs.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.BaseClass import BaseClass from typing import Final diff --git a/src/Mod/Material/Gui/MaterialTreeWidget.pyi b/src/Mod/Material/Gui/MaterialTreeWidget.pyi index e2acb43211..00452b52e4 100644 --- a/src/Mod/Material/Gui/MaterialTreeWidget.pyi +++ b/src/Mod/Material/Gui/MaterialTreeWidget.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Metadata import export, constmethod, forward_declarations, class_declarations, sequence_protocol from Base.BaseClass import BaseClass from typing import Final, overload diff --git a/src/Mod/Measure/App/MeasureBase.pyi b/src/Mod/Measure/App/MeasureBase.pyi index 24d6c6f527..18c562aeb0 100644 --- a/src/Mod/Measure/App/MeasureBase.pyi +++ b/src/Mod/Measure/App/MeasureBase.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from App.DocumentObject import DocumentObject diff --git a/src/Mod/Measure/App/Measurement.pyi b/src/Mod/Measure/App/Measurement.pyi index 8034ebffb7..d5657ee8d1 100644 --- a/src/Mod/Measure/App/Measurement.pyi +++ b/src/Mod/Measure/App/Measurement.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any from Base.BaseClass import BaseClass diff --git a/src/Mod/Measure/Gui/QuickMeasure.pyi b/src/Mod/Measure/Gui/QuickMeasure.pyi index d265bbea34..d274f81185 100644 --- a/src/Mod/Measure/Gui/QuickMeasure.pyi +++ b/src/Mod/Measure/Gui/QuickMeasure.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from Base.PyObjectBase import PyObjectBase diff --git a/src/Mod/Mesh/App/Edge.pyi b/src/Mod/Mesh/App/Edge.pyi index 548234e5c8..016cdfef86 100644 --- a/src/Mod/Mesh/App/Edge.pyi +++ b/src/Mod/Mesh/App/Edge.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Final from Base.Metadata import export diff --git a/src/Mod/Mesh/App/Facet.pyi b/src/Mod/Mesh/App/Facet.pyi index 01eab62741..1dcdf1eb84 100644 --- a/src/Mod/Mesh/App/Facet.pyi +++ b/src/Mod/Mesh/App/Facet.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any, Final from Base.Metadata import export diff --git a/src/Mod/Mesh/App/Mesh.pyi b/src/Mod/Mesh/App/Mesh.pyi index 7a6b65cf4e..64765f1a28 100644 --- a/src/Mod/Mesh/App/Mesh.pyi +++ b/src/Mod/Mesh/App/Mesh.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any, Final from Base.Metadata import constmethod, export diff --git a/src/Mod/Mesh/App/MeshFeature.pyi b/src/Mod/Mesh/App/MeshFeature.pyi index 6f795a5230..ad2ada3cca 100644 --- a/src/Mod/Mesh/App/MeshFeature.pyi +++ b/src/Mod/Mesh/App/MeshFeature.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any from Base.Metadata import export diff --git a/src/Mod/Mesh/App/MeshPoint.pyi b/src/Mod/Mesh/App/MeshPoint.pyi index eed777ebd0..a47bb396e6 100644 --- a/src/Mod/Mesh/App/MeshPoint.pyi +++ b/src/Mod/Mesh/App/MeshPoint.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any, Final from Base.Metadata import export diff --git a/src/Mod/Mesh/Gui/ViewProviderMesh.pyi b/src/Mod/Mesh/Gui/ViewProviderMesh.pyi index 2120989a25..8d73f82620 100644 --- a/src/Mod/Mesh/Gui/ViewProviderMesh.pyi +++ b/src/Mod/Mesh/Gui/ViewProviderMesh.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any from Gui.ViewProviderGeometryObject import ViewProviderGeometryObject from Base.Metadata import export diff --git a/src/Mod/Part/App/Arc.pyi b/src/Mod/Part/App/Arc.pyi index 340e2f6329..706256a880 100644 --- a/src/Mod/Part/App/Arc.pyi +++ b/src/Mod/Part/App/Arc.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from TrimmedCurve import TrimmedCurve from Geometry import Geom_Circle, Geom_Ellipse diff --git a/src/Mod/Part/App/ArcOfCircle.pyi b/src/Mod/Part/App/ArcOfCircle.pyi index a1ad2bff4a..f09a700774 100644 --- a/src/Mod/Part/App/ArcOfCircle.pyi +++ b/src/Mod/Part/App/ArcOfCircle.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from ArcOfConic import ArcOfConic from typing import Final diff --git a/src/Mod/Part/App/ArcOfConic.pyi b/src/Mod/Part/App/ArcOfConic.pyi index 8c46f2aa34..0270897665 100644 --- a/src/Mod/Part/App/ArcOfConic.pyi +++ b/src/Mod/Part/App/ArcOfConic.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from Base.Vector import Vector from TrimmedCurve import TrimmedCurve diff --git a/src/Mod/Part/App/ArcOfEllipse.pyi b/src/Mod/Part/App/ArcOfEllipse.pyi index f111c0ba69..dbb72e5288 100644 --- a/src/Mod/Part/App/ArcOfEllipse.pyi +++ b/src/Mod/Part/App/ArcOfEllipse.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from ArcOfConic import ArcOfConic from typing import Final diff --git a/src/Mod/Part/App/ArcOfHyperbola.pyi b/src/Mod/Part/App/ArcOfHyperbola.pyi index 15ef3eee52..18ec6d17fc 100644 --- a/src/Mod/Part/App/ArcOfHyperbola.pyi +++ b/src/Mod/Part/App/ArcOfHyperbola.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from Part.ArcOfConic import ArcOfConic from typing import Final diff --git a/src/Mod/Part/App/ArcOfParabola.pyi b/src/Mod/Part/App/ArcOfParabola.pyi index 886cb96fa9..0845154bcb 100644 --- a/src/Mod/Part/App/ArcOfParabola.pyi +++ b/src/Mod/Part/App/ArcOfParabola.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from ArcOfConic import ArcOfConic from typing import Final diff --git a/src/Mod/Part/App/AttachEngine.pyi b/src/Mod/Part/App/AttachEngine.pyi index 637431f483..5adecc2284 100644 --- a/src/Mod/Part/App/AttachEngine.pyi +++ b/src/Mod/Part/App/AttachEngine.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.BaseClass import BaseClass from Base.Placement import Placement @@ -46,31 +50,31 @@ class AttachEngine(BaseClass): CompleteRefTypeList: Final[list] = [] """List of all reference shape types recognized by AttachEngine.""" - def getModeInfo(self, mode: str) -> dict: + def getModeInfo(self, mode: str, /) -> dict: """ getModeInfo(mode): returns supported reference combinations, user-friendly name, and so on. """ ... - def getRefTypeOfShape(self, shape: str) -> str: + def getRefTypeOfShape(self, shape: str, /) -> str: """ getRefTypeOfShape(shape): returns shape type as interpreted by AttachEngine. Returns a string. """ ... - def isFittingRefType(self, type_shape: str, type_needed: str) -> bool: + def isFittingRefType(self, type_shape: str, type_needed: str, /) -> bool: """ isFittingRefType(type_shape, type_needed): tests if shape type, specified by type_shape (string), fits a type required by attachment mode type_needed (string). e.g. 'Circle' fits a requirement of 'Edge', and 'Curve' doesn't fit if a 'Circle' is required. """ ... - def downgradeRefType(self, type: str) -> str: + def downgradeRefType(self, type: str, /) -> str: """ downgradeRefType(type): returns next more general type. E.g. downgradeType('Circle') yields 'Curve'. """ ... - def getRefTypeInfo(self, type: str) -> dict: + def getRefTypeInfo(self, type: str, /) -> dict: """ getRefTypeInfo(type): returns information (dict) on shape type. Keys:'UserFriendlyName', 'TypeIndex', 'Rank'. Rank is the number of times reftype can be downgraded, before it becomes 'Any'. """ @@ -84,7 +88,7 @@ class AttachEngine(BaseClass): ... @constmethod - def calculateAttachedPlacement(self, orig_placement: Placement) -> Optional[Placement]: + def calculateAttachedPlacement(self, orig_placement: Placement, /) -> Optional[Placement]: """ calculateAttachedPlacement(orig_placement): returns result of attachment, based on current Mode, References, etc. AttachmentOffset is included. @@ -130,13 +134,13 @@ class AttachEngine(BaseClass): """ ... - def readParametersFromFeature(self, document_object: DocumentObject) -> None: + def readParametersFromFeature(self, document_object: DocumentObject, /) -> None: """ readParametersFromFeature(document_object): sets AttachEngine parameters (References, Mode, etc.) by reading out properties of AttachableObject-derived feature. """ ... - def writeParametersToFeature(self, document_object: DocumentObject) -> None: + def writeParametersToFeature(self, document_object: DocumentObject, /) -> None: """ writeParametersToFeature(document_object): updates properties of AttachableObject-derived feature with current AttachEngine parameters diff --git a/src/Mod/Part/App/AttachExtension.pyi b/src/Mod/Part/App/AttachExtension.pyi index 37160ef4cd..5b26a38d88 100644 --- a/src/Mod/Part/App/AttachExtension.pyi +++ b/src/Mod/Part/App/AttachExtension.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from App.DocumentObjectExtension import DocumentObjectExtension from typing import Any, Final @@ -29,7 +33,7 @@ class AttachExtension(DocumentObjectExtension): """ ... - def changeAttacherType(self, typename: str) -> None: + def changeAttacherType(self, typename: str, /) -> None: """ changeAttacherType(typename) -> None diff --git a/src/Mod/Part/App/BRepFeat/MakePrism.pyi b/src/Mod/Part/App/BRepFeat/MakePrism.pyi index 1484996a59..92ce616001 100644 --- a/src/Mod/Part/App/BRepFeat/MakePrism.pyi +++ b/src/Mod/Part/App/BRepFeat/MakePrism.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.PyObjectBase import PyObjectBase from typing import List diff --git a/src/Mod/Part/App/BRepOffsetAPI_MakeFilling.pyi b/src/Mod/Part/App/BRepOffsetAPI_MakeFilling.pyi index a6bae6597c..12d173a816 100644 --- a/src/Mod/Part/App/BRepOffsetAPI_MakeFilling.pyi +++ b/src/Mod/Part/App/BRepOffsetAPI_MakeFilling.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.PyObjectBase import PyObjectBase from Part.App.Point import Point @@ -50,7 +54,7 @@ class BRepOffsetAPI_MakeFilling(PyObjectBase): """ ... - def loadInitSurface(self, face: TopoShapeFace) -> None: + def loadInitSurface(self, face: TopoShapeFace, /) -> None: """ loadInitSurface(face) Loads the initial surface. @@ -93,10 +97,14 @@ class BRepOffsetAPI_MakeFilling(PyObjectBase): ... @overload - def G0Error(self) -> float: ... + def G0Error(self, /) -> float: + ... + @overload - def G0Error(self, arg: int) -> float: ... - def G0Error(self, arg: int = 0) -> float: + def G0Error(self, arg: int, /) -> float: + ... + + def G0Error(self, arg: int = 0, /) -> float: """ G0Error([int]) Returns the maximum distance between the result and the constraints. @@ -104,10 +112,14 @@ class BRepOffsetAPI_MakeFilling(PyObjectBase): ... @overload - def G1Error(self) -> float: ... + def G1Error(self, /) -> float: + ... + @overload - def G1Error(self, arg: int) -> float: ... - def G1Error(self, arg: int = 0) -> float: + def G1Error(self, arg: int, /) -> float: + ... + + def G1Error(self, arg: int = 0, /) -> float: """ G1Error([int]) Returns the maximum angle between the result and the constraints. @@ -115,10 +127,14 @@ class BRepOffsetAPI_MakeFilling(PyObjectBase): ... @overload - def G2Error(self) -> float: ... + def G2Error(self, /) -> float: + ... + @overload - def G2Error(self, arg: int) -> float: ... - def G2Error(self, arg: int = 0) -> float: + def G2Error(self, arg: int, /) -> float: + ... + + def G2Error(self, arg: int = 0, /) -> float: """ G2Error([int]) Returns the greatest difference in curvature between the result and the constraints. diff --git a/src/Mod/Part/App/BRepOffsetAPI_MakePipeShell.pyi b/src/Mod/Part/App/BRepOffsetAPI_MakePipeShell.pyi index 192bb89d38..c2f00505b2 100644 --- a/src/Mod/Part/App/BRepOffsetAPI_MakePipeShell.pyi +++ b/src/Mod/Part/App/BRepOffsetAPI_MakePipeShell.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.PyObjectBase import PyObjectBase from Base.Vector import Vector @@ -20,7 +24,7 @@ class BRepOffsetAPI_MakePipeShell(PyObjectBase): Licence: LGPL """ - def setFrenetMode(self, mode: bool) -> None: + def setFrenetMode(self, mode: bool, /) -> None: """ setFrenetMode(True|False) Sets a Frenet or a CorrectedFrenet trihedron to perform the sweeping. @@ -29,7 +33,7 @@ class BRepOffsetAPI_MakePipeShell(PyObjectBase): """ ... - def setTrihedronMode(self, point: Vector, direction: Vector) -> None: + def setTrihedronMode(self, point: Vector, direction: Vector, /) -> None: """ setTrihedronMode(point,direction) Sets a fixed trihedron to perform the sweeping. @@ -37,7 +41,7 @@ class BRepOffsetAPI_MakePipeShell(PyObjectBase): """ ... - def setBiNormalMode(self, direction: Vector) -> None: + def setBiNormalMode(self, direction: Vector, /) -> None: """ setBiNormalMode(direction) Sets a fixed BiNormal direction to perform the sweeping. @@ -45,7 +49,7 @@ class BRepOffsetAPI_MakePipeShell(PyObjectBase): """ ... - def setSpineSupport(self, shape: TopoShape) -> None: + def setSpineSupport(self, shape: TopoShape, /) -> None: """ setSpineSupport(shape) Sets support to the spine to define the BiNormal of the trihedron, like the normal to the surfaces. @@ -53,9 +57,7 @@ class BRepOffsetAPI_MakePipeShell(PyObjectBase): """ ... - def setAuxiliarySpine( - self, wire: TopoShape, CurvilinearEquivalence: bool, TypeOfContact: int - ) -> None: + def setAuxiliarySpine(self, wire: TopoShape, CurvilinearEquivalence: bool, TypeOfContact: int, /) -> None: """ setAuxiliarySpine(wire, CurvilinearEquivalence, TypeOfContact) Sets an auxiliary spine to define the Normal. @@ -96,7 +98,7 @@ class BRepOffsetAPI_MakePipeShell(PyObjectBase): """ ... - def remove(self, Profile: TopoShape) -> None: + def remove(self, Profile: TopoShape, /) -> None: """ remove(shape Profile) Removes the section Profile from this framework. @@ -124,7 +126,7 @@ class BRepOffsetAPI_MakePipeShell(PyObjectBase): """ ... - def setTolerance(self, tol3d: float, boundTol: float, tolAngular: float) -> None: + def setTolerance(self, tol3d: float, boundTol: float, tolAngular: float, /) -> None: """ setTolerance( tol3d, boundTol, tolAngular) Tol3d = 3D tolerance @@ -133,7 +135,7 @@ class BRepOffsetAPI_MakePipeShell(PyObjectBase): """ ... - def setTransitionMode(self, mode: int) -> None: + def setTransitionMode(self, mode: int, /) -> None: """ 0: BRepBuilderAPI_Transformed 1: BRepBuilderAPI_RightCorner @@ -169,35 +171,35 @@ class BRepOffsetAPI_MakePipeShell(PyObjectBase): """ ... - def generated(self, S: TopoShape) -> list[TopoShape]: + def generated(self, S: TopoShape, /) -> list[TopoShape]: """ generated(shape S) Returns a list of new shapes generated from the shape S by the shell-generating algorithm. """ ... - def setMaxDegree(self, degree: int) -> None: + def setMaxDegree(self, degree: int, /) -> None: """ setMaxDegree(int degree) Define the maximum V degree of resulting surface. """ ... - def setMaxSegments(self, num: int) -> None: + def setMaxSegments(self, num: int, /) -> None: """ setMaxSegments(int num) Define the maximum number of spans in V-direction on resulting surface. """ ... - def setForceApproxC1(self, flag: bool) -> None: + def setForceApproxC1(self, flag: bool, /) -> None: """ setForceApproxC1(bool) Set the flag that indicates attempt to approximate a C1-continuous surface if a swept surface proved to be C0. """ ... - def simulate(self, nbsec: int) -> None: + def simulate(self, nbsec: int, /) -> None: """ simulate(int nbsec) Simulates the resulting shape by calculating the given number of cross-sections. diff --git a/src/Mod/Part/App/BSplineCurve.pyi b/src/Mod/Part/App/BSplineCurve.pyi index 9f09f6d12d..f6c152a9a0 100644 --- a/src/Mod/Part/App/BSplineCurve.pyi +++ b/src/Mod/Part/App/BSplineCurve.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.Vector import Vector from BoundedCurve import BoundedCurve @@ -89,7 +93,7 @@ class BSplineCurve(BoundedCurve): """ ... - def increaseDegree(self, Degree: int = ...) -> None: + def increaseDegree(self, Degree: int = ..., /) -> None: """ increase(Int=Degree) Increases the degree of this B-Spline curve to Degree. @@ -100,9 +104,11 @@ class BSplineCurve(BoundedCurve): ... @overload - def increaseMultiplicity(self, index: int, mult: int) -> None: ... + def increaseMultiplicity(self, index: int, mult: int, /) -> None: ... + @overload - def increaseMultiplicity(self, start: int, end: int, mult: int) -> None: ... + def increaseMultiplicity(self, start: int, end: int, mult: int, /) -> None: ... + def increaseMultiplicity(self, *args, **kwargs) -> None: """ increaseMultiplicity(int index, int mult) @@ -116,7 +122,7 @@ class BSplineCurve(BoundedCurve): """ ... - def incrementMultiplicity(self, start: int, end: int, mult: int) -> None: + def incrementMultiplicity(self, start: int, end: int, mult: int, /) -> None: """ incrementMultiplicity(int start, int end, int mult) @@ -126,7 +132,7 @@ class BSplineCurve(BoundedCurve): """ ... - def insertKnot(self, u: float, mult: int = 1, tol: float = 0.0) -> None: + def insertKnot(self, u: float, mult: int = 1, tol: float = 0.0, /) -> None: """ insertKnot(u, mult = 1, tol = 0.0) @@ -141,7 +147,7 @@ class BSplineCurve(BoundedCurve): list_of_ints: List[int], tol: float = 0.0, bool_add: bool = True, - ) -> None: + /,) -> None: """ insertKnots(list_of_floats, list_of_ints, tol = 0.0, bool_add = True) @@ -161,7 +167,7 @@ class BSplineCurve(BoundedCurve): """ ... - def removeKnot(self, Index: int, M: int, tol: float) -> bool: + def removeKnot(self, Index: int, M: int, tol: float, /) -> bool: """ removeKnot(Index, M, tol) @@ -180,7 +186,7 @@ class BSplineCurve(BoundedCurve): """ ... - def segment(self, u1: float, u2: float) -> None: + def segment(self, u1: float, u2: float, /) -> None: """ segment(u1,u2) @@ -188,20 +194,20 @@ class BSplineCurve(BoundedCurve): """ ... - def setKnot(self, knot: float, index: int) -> None: + def setKnot(self, knot: float, index: int, /) -> None: """ Set a knot of the B-Spline curve. """ ... @constmethod - def getKnot(self, index: int) -> float: + def getKnot(self, index: int, /) -> float: """ Get a knot of the B-Spline curve. """ ... - def setKnots(self, knots: List[float]) -> None: + def setKnots(self, knots: List[float], /) -> None: """ Set knots of the B-Spline curve. """ @@ -214,7 +220,7 @@ class BSplineCurve(BoundedCurve): """ ... - def setPole(self, P: Vector, Index: int) -> None: + def setPole(self, P: Vector, Index: int, /) -> None: """ Modifies this B-Spline curve by assigning P to the pole of index Index in the poles table. @@ -222,7 +228,7 @@ class BSplineCurve(BoundedCurve): ... @constmethod - def getPole(self, Index: int) -> Vector: + def getPole(self, Index: int, /) -> Vector: """ Get a pole of the B-Spline curve. """ @@ -235,14 +241,14 @@ class BSplineCurve(BoundedCurve): """ ... - def setWeight(self, weight: float, index: int) -> None: + def setWeight(self, weight: float, index: int, /) -> None: """ Set a weight of the B-Spline curve. """ ... @constmethod - def getWeight(self, index: int) -> float: + def getWeight(self, index: int, /) -> float: """ Get a weight of the B-Spline curve. """ @@ -263,7 +269,7 @@ class BSplineCurve(BoundedCurve): ... @constmethod - def getResolution(self, Tolerance3D: float) -> float: + def getResolution(self, Tolerance3D: float, /) -> float: """ Computes for this B-Spline curve the parametric tolerance (UTolerance) for a given 3D tolerance (Tolerance3D). @@ -273,7 +279,8 @@ class BSplineCurve(BoundedCurve): """ ... - def movePoint(self, U: float, P: Vector, Index1: int, Index2: int) -> tuple[int, int]: + def movePoint( + self, U: float, P: Vector, Index1: int, Index2: int, /) -> tuple[int, int]: """ movePoint(U, P, Index1, Index2) @@ -299,7 +306,7 @@ class BSplineCurve(BoundedCurve): """ ... - def setOrigin(self, Index: int) -> None: + def setOrigin(self, Index: int, /) -> None: """ Assigns the knot of index Index in the knots table as the origin of this periodic B-Spline curve. As a consequence, @@ -308,7 +315,7 @@ class BSplineCurve(BoundedCurve): ... @constmethod - def getMultiplicity(self, index: int) -> int: + def getMultiplicity(self, index: int, /) -> int: """ Returns the multiplicity of the knot of index from the knots table of this B-Spline curve. @@ -434,7 +441,7 @@ class BSplineCurve(BoundedCurve): periodic: bool = False, degree: int = 3, interpolate: bool = False, - ) -> None: + /,) -> None: """ Builds a B-Spline by a list of poles. arguments: poles (sequence of Base.Vector), [periodic (default is False), degree (default is 3), interpolate (default is False)] @@ -504,20 +511,21 @@ class BSplineCurve(BoundedCurve): ... @constmethod - def toBiArcs(self, tolerance: float) -> List["Arc"]: + def toBiArcs(self, tolerance: float, /) -> List["Arc"]: """ Build a list of arcs and lines to approximate the B-spline. toBiArcs(tolerance) -> list. """ ... - def join(self, other: "BSplineCurve") -> None: + def join(self, other: "BSplineCurve", /) -> None: """ Build a new spline by joining this and a second spline. """ ... - def makeC1Continuous(self, tol: float = 1e-6, ang_tol: float = 1e-7) -> "BSplineCurve": + def makeC1Continuous( + self, tol: float = 1e-6, ang_tol: float = 1e-7, /) -> "BSplineCurve": """ makeC1Continuous(tol = 1e-6, ang_tol = 1e-7) Reduces as far as possible the multiplicities of the knots of this BSpline @@ -529,7 +537,7 @@ class BSplineCurve(BoundedCurve): """ ... - def scaleKnotsToBounds(self, u0: float = 0.0, u1: float = 1.0) -> None: + def scaleKnotsToBounds(self, u0: float = 0.0, u1: float = 1.0, /) -> None: """ Scales the knots list to fit the specified bounds. The shape of the curve is not modified. diff --git a/src/Mod/Part/App/BSplineSurface.pyi b/src/Mod/Part/App/BSplineSurface.pyi index e9e9f0fbc7..e725ea32bc 100644 --- a/src/Mod/Part/App/BSplineSurface.pyi +++ b/src/Mod/Part/App/BSplineSurface.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from GeometrySurface import GeometrySurface from typing import Final, List, Any @@ -181,7 +185,7 @@ class BSplineSurface(GeometrySurface): dX: float = ..., Y0: float = ..., dY: float = ..., - ) -> None: + /,) -> None: """ increase(Int=UDegree, int=VDegree) Increases the degrees of this B-Spline surface to UDegree and VDegree @@ -218,31 +222,31 @@ class BSplineSurface(GeometrySurface): """ ... - def insertUKnot(self, U: float, Index: int, Tolerance: float) -> None: + def insertUKnot(self, U: float, Index: int, Tolerance: float, /) -> None: """ insertUKnote(float U, int Index, float Tolerance) - Insert or override a knot """ ... - def insertUKnots(self, U: List[float], Mult: List[float], Tolerance: float) -> None: + def insertUKnots(self, U: List[float], Mult: List[float], Tolerance: float, /) -> None: """ insertUKnote(List of float U, List of float Mult, float Tolerance) - Inserts knots. """ ... - def insertVKnot(self, V: float, Index: int, Tolerance: float) -> None: + def insertVKnot(self, V: float, Index: int, Tolerance: float, /) -> None: """ insertUKnote(float V, int Index, float Tolerance) - Insert or override a knot. """ ... - def insertVKnots(self, V: List[float], Mult: List[float], Tolerance: float) -> None: + def insertVKnots(self, V: List[float], Mult: List[float], Tolerance: float, /) -> None: """ insertUKnote(List of float V, List of float Mult, float Tolerance) - Inserts knots. """ ... - def removeUKnot(self, M: int, Index: int, Tolerance: float) -> bool: + def removeUKnot(self, M: int, Index: int, Tolerance: float, /) -> bool: """ Reduces to M the multiplicity of the knot of index Index in the given parametric direction. If M is 0, the knot is removed. @@ -260,7 +264,7 @@ class BSplineSurface(GeometrySurface): """ ... - def removeVKnot(self, M: int, Index: int, Tolerance: float) -> bool: + def removeVKnot(self, M: int, Index: int, Tolerance: float, /) -> bool: """ Reduces to M the multiplicity of the knot of index Index in the given parametric direction. If M is 0, the knot is removed. @@ -278,7 +282,7 @@ class BSplineSurface(GeometrySurface): """ ... - def segment(self, U1: float, U2: float, V1: float, V2: float) -> None: + def segment(self, U1: float, U2: float, V1: float, V2: float, /) -> None: """ Modifies this B-Spline surface by segmenting it between U1 and U2 in the u parametric direction and between V1 and V2 in the v parametric direction. @@ -292,7 +296,7 @@ class BSplineSurface(GeometrySurface): """ ... - def setUKnot(self, K: float, UIndex: int, M: int = ...) -> None: + def setUKnot(self, K: float, UIndex: int, M: int = ..., /) -> None: """ Modifies this B-Spline surface by assigning the value K to the knot of index UIndex of the knots table corresponding to the u parametric direction. @@ -304,7 +308,7 @@ class BSplineSurface(GeometrySurface): """ ... - def setVKnot(self, K: float, VIndex: int, M: int = ...) -> None: + def setVKnot(self, K: float, VIndex: int, M: int = ..., /) -> None: """ Modifies this B-Spline surface by assigning the value K to the knot of index VIndex of the knots table corresponding to the v parametric direction. @@ -317,7 +321,7 @@ class BSplineSurface(GeometrySurface): ... @constmethod - def getUKnot(self, UIndex: int) -> Any: + def getUKnot(self, UIndex: int, /) -> Any: """ Returns, for this B-Spline surface, in the u parametric direction the knot of index UIndex of the knots table. @@ -325,21 +329,21 @@ class BSplineSurface(GeometrySurface): ... @constmethod - def getVKnot(self, VIndex: int) -> Any: + def getVKnot(self, VIndex: int, /) -> Any: """ Returns, for this B-Spline surface, in the v parametric direction the knot of index VIndex of the knots table. """ ... - def setUKnots(self, knots: List[Any]) -> None: + def setUKnots(self, knots: List[Any], /) -> None: """ Changes all knots of this B-Spline surface in the u parametric direction. The multiplicity of the knots is not modified. """ ... - def setVKnots(self, knots: List[Any]) -> None: + def setVKnots(self, knots: List[Any], /) -> None: """ Changes all knots of this B-Spline surface in the v parametric direction. The multiplicity of the knots is not modified. @@ -362,7 +366,7 @@ class BSplineSurface(GeometrySurface): """ ... - def setPole(self, P: Any, UIndex: int, VIndex: int, Weight: float = ...) -> None: + def setPole(self, P: Any, UIndex: int, VIndex: int, Weight: float = ..., /) -> None: """ Modifies this B-Spline surface by assigning P to the pole of index (UIndex, VIndex) in the poles table. @@ -374,7 +378,8 @@ class BSplineSurface(GeometrySurface): """ ... - def setPoleCol(self, VIndex: int, values: List[Any], CPoleWeights: List[float]) -> None: + def setPoleCol( + self, VIndex: int, values: List[Any], CPoleWeights: List[float], /) -> None: """ Modifies this B-Spline surface by assigning values to all or part of the column of poles of index VIndex, of this B-Spline surface. @@ -384,7 +389,8 @@ class BSplineSurface(GeometrySurface): """ ... - def setPoleRow(self, UIndex: int, values: List[Any], CPoleWeights: List[float]) -> None: + def setPoleRow( + self, UIndex: int, values: List[Any], CPoleWeights: List[float], /) -> None: """ Modifies this B-Spline surface by assigning values to all or part of the row of poles of index UIndex, of this B-Spline surface. @@ -395,7 +401,7 @@ class BSplineSurface(GeometrySurface): ... @constmethod - def getPole(self, UIndex: int, VIndex: int) -> Any: + def getPole(self, UIndex: int, VIndex: int, /) -> Any: """ Returns the pole of index (UIndex,VIndex) of this B-Spline surface. """ @@ -408,7 +414,7 @@ class BSplineSurface(GeometrySurface): """ ... - def setWeight(self, Weight: float, UIndex: int, VIndex: int) -> None: + def setWeight(self, Weight: float, UIndex: int, VIndex: int, /) -> None: """ Modifies this B-Spline surface by assigning the value Weight to the weight of the pole of index (UIndex, VIndex) in the poles tables of this B-Spline @@ -418,7 +424,7 @@ class BSplineSurface(GeometrySurface): """ ... - def setWeightCol(self, VIndex: int, CPoleWeights: List[float]) -> None: + def setWeightCol(self, VIndex: int, CPoleWeights: List[float], /) -> None: """ Modifies this B-Spline surface by assigning values to all or part of the weights of the column of poles of index VIndex of this B-Spline surface. @@ -430,7 +436,7 @@ class BSplineSurface(GeometrySurface): """ ... - def setWeightRow(self, UIndex: int, CPoleWeights: List[float]) -> None: + def setWeightRow(self, UIndex: int, CPoleWeights: List[float], /) -> None: """ Modifies this B-Spline surface by assigning values to all or part of the weights of the row of poles of index UIndex of this B-Spline surface. @@ -443,7 +449,7 @@ class BSplineSurface(GeometrySurface): ... @constmethod - def getWeight(self, UIndex: int, VIndex: int) -> float: + def getWeight(self, UIndex: int, VIndex: int, /) -> float: """ Return the weight of the pole of index (UIndex,VIndex) in the poles table for this B-Spline surface. @@ -465,7 +471,7 @@ class BSplineSurface(GeometrySurface): ... @constmethod - def getResolution(self, Tolerance3D: float) -> Any: + def getResolution(self, Tolerance3D: float, /) -> Any: """ Computes two tolerance values for this B-Spline surface, based on the given tolerance in 3D space Tolerance3D. The tolerances computed are: @@ -489,7 +495,7 @@ class BSplineSurface(GeometrySurface): UIndex2: int = ..., VIndex1: int = ..., VIndex2: int = ..., - ) -> Any: + /,) -> Any: """ Moves the point of parameters (U, V) of this B-Spline surface to P. UIndex1, UIndex2, VIndex1 and VIndex2 are the indexes in the poles @@ -538,7 +544,7 @@ class BSplineSurface(GeometrySurface): """ ... - def setUPeriodic(self, I1: int, I2: int) -> None: + def setUPeriodic(self, I1: int, I2: int, /) -> None: """ Modifies this surface to be periodic in the u parametric direction. To become periodic in a given parametric direction a surface must @@ -556,7 +562,7 @@ class BSplineSurface(GeometrySurface): """ ... - def setVPeriodic(self, I1: int, I2: int) -> None: + def setVPeriodic(self, I1: int, I2: int, /) -> None: """ Modifies this surface to be periodic in the v parametric direction. To become periodic in a given parametric direction a surface must @@ -574,7 +580,7 @@ class BSplineSurface(GeometrySurface): """ ... - def setUOrigin(self, Index: int) -> None: + def setUOrigin(self, Index: int, /) -> None: """ Assigns the knot of index Index in the knots table in the u parametric direction to be the origin of @@ -583,7 +589,7 @@ class BSplineSurface(GeometrySurface): """ ... - def setVOrigin(self, Index: int) -> None: + def setVOrigin(self, Index: int, /) -> None: """ Assigns the knot of index Index in the knots table in the v parametric direction to be the origin of @@ -593,7 +599,7 @@ class BSplineSurface(GeometrySurface): ... @constmethod - def getUMultiplicity(self, UIndex: int) -> Any: + def getUMultiplicity(self, UIndex: int, /) -> Any: """ Returns, for this B-Spline surface, the multiplicity of the knot of index UIndex in the u parametric direction. @@ -601,7 +607,7 @@ class BSplineSurface(GeometrySurface): ... @constmethod - def getVMultiplicity(self, VIndex: int) -> Any: + def getVMultiplicity(self, VIndex: int, /) -> Any: """ Returns, for this B-Spline surface, the multiplicity of the knot of index VIndex in the v parametric direction. @@ -689,7 +695,7 @@ class BSplineSurface(GeometrySurface): dX: float = ..., Y0: float = ..., dY: float = ..., - ) -> None: + /,) -> None: """ interpolate(points) interpolate(zpoints, X0, dX, Y0, dY) @@ -726,13 +732,13 @@ class BSplineSurface(GeometrySurface): """ ... - def buildFromNSections(self, control_curves: Any) -> None: + def buildFromNSections(self, control_curves: Any, /) -> None: """ Builds a B-Spline from a list of control curves """ ... - def scaleKnotsToBounds(self, u0: float, u1: float, v0: float, v1: float) -> None: + def scaleKnotsToBounds(self, u0: float, u1: float, v0: float, v1: float, /) -> None: """ Scales the U and V knots lists to fit the specified bounds. The shape of the surface is not modified. diff --git a/src/Mod/Part/App/BezierCurve.pyi b/src/Mod/Part/App/BezierCurve.pyi index 2542a3cba0..2565b9d5ba 100644 --- a/src/Mod/Part/App/BezierCurve.pyi +++ b/src/Mod/Part/App/BezierCurve.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.Vector import Vector from BoundedCurve import BoundedCurve @@ -73,26 +77,26 @@ class BezierCurve(BoundedCurve): """ ... - def increase(self, Int: int = ...) -> None: + def increase(self, Int: int = ..., /) -> None: """ Increases the degree of this Bezier curve to Degree. As a result, the poles and weights tables are modified. """ ... - def insertPoleAfter(self, index: int) -> None: + def insertPoleAfter(self, index: int, /) -> None: """ Inserts after the pole of index. """ ... - def insertPoleBefore(self, index: int) -> None: + def insertPoleBefore(self, index: int, /) -> None: """ Inserts before the pole of index. """ ... - def removePole(self, Index: int) -> None: + def removePole(self, Index: int, /) -> None: """ Removes the pole of index Index from the table of poles of this Bezier curve. If this Bezier curve is rational, it can become non-rational. @@ -105,14 +109,14 @@ class BezierCurve(BoundedCurve): """ ... - def setPole(self, pole: Vector) -> None: + def setPole(self, pole: Vector, /) -> None: """ Set a pole of the Bezier curve. """ ... @constmethod - def getPole(self, index: int) -> Vector: + def getPole(self, index: int, /) -> Vector: """ Get a pole of the Bezier curve. """ @@ -125,7 +129,7 @@ class BezierCurve(BoundedCurve): """ ... - def setPoles(self, poles: List[Vector]) -> None: + def setPoles(self, poles: List[Vector], /) -> None: """ Set the poles of the Bezier curve. @@ -133,14 +137,14 @@ class BezierCurve(BoundedCurve): """ ... - def setWeight(self, id: int, weight: float) -> None: + def setWeight(self, id: int, weight: float, /) -> None: """ (id, weight) Set a weight of the Bezier curve. """ ... @constmethod - def getWeight(self, id: int) -> float: + def getWeight(self, id: int, /) -> float: """ Get a weight of the Bezier curve. """ @@ -154,7 +158,7 @@ class BezierCurve(BoundedCurve): ... @constmethod - def getResolution(self, Tolerance3D: float) -> float: + def getResolution(self, Tolerance3D: float, /) -> float: """ Computes for this Bezier curve the parametric tolerance (UTolerance) for a given 3D tolerance (Tolerance3D). @@ -164,7 +168,8 @@ class BezierCurve(BoundedCurve): """ ... - def interpolate(self, constraints: List[List], parameters: List[float] = ...) -> None: + def interpolate( + self, constraints: List[List], parameters: List[float] = ..., /) -> None: """ Interpolates a list of constraints. Each constraint is a list of a point and some optional derivatives diff --git a/src/Mod/Part/App/BezierSurface.pyi b/src/Mod/Part/App/BezierSurface.pyi index 7d19718587..9a40288eff 100644 --- a/src/Mod/Part/App/BezierSurface.pyi +++ b/src/Mod/Part/App/BezierSurface.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import ( export, constmethod, @@ -106,7 +110,7 @@ class BezierSurface(GeometrySurface): """ ... - def increase(self, DegreeU: int, DegreeV: int) -> None: + def increase(self, DegreeU: int, DegreeV: int, /) -> None: """ increase(DegreeU: int, DegreeV: int) Increases the degree of this Bezier surface in the two @@ -114,7 +118,7 @@ class BezierSurface(GeometrySurface): """ ... - def insertPoleColAfter(self, index: int) -> None: + def insertPoleColAfter(self, index: int, /) -> None: """ Inserts into the table of poles of this surface, after the column of poles of index. @@ -125,7 +129,7 @@ class BezierSurface(GeometrySurface): """ ... - def insertPoleRowAfter(self, index: int) -> None: + def insertPoleRowAfter(self, index: int, /) -> None: """ Inserts into the table of poles of this surface, after the row of poles of index. @@ -136,7 +140,7 @@ class BezierSurface(GeometrySurface): """ ... - def insertPoleColBefore(self, index: int) -> None: + def insertPoleColBefore(self, index: int, /) -> None: """ Inserts into the table of poles of this surface, before the column of poles of index. @@ -147,7 +151,7 @@ class BezierSurface(GeometrySurface): """ ... - def insertPoleRowBefore(self, index: int) -> None: + def insertPoleRowBefore(self, index: int, /) -> None: """ Inserts into the table of poles of this surface, before the row of poles of index. @@ -158,7 +162,7 @@ class BezierSurface(GeometrySurface): """ ... - def removePoleCol(self, VIndex: int) -> None: + def removePoleCol(self, VIndex: int, /) -> None: """ removePoleRow(VIndex: int) Removes the column of poles of index VIndex from the table of @@ -167,7 +171,7 @@ class BezierSurface(GeometrySurface): """ ... - def removePoleRow(self, UIndex: int) -> None: + def removePoleRow(self, UIndex: int, /) -> None: """ removePoleRow(UIndex: int) Removes the row of poles of index UIndex from the table of @@ -176,7 +180,7 @@ class BezierSurface(GeometrySurface): """ ... - def segment(self, U1: float, U2: float, V1: float, V2: float) -> None: + def segment(self, U1: float, U2: float, V1: float, V2: float, /) -> None: """ segment(U1: double, U2: double, V1: double, V2: double) Modifies this Bezier surface by segmenting it between U1 and U2 @@ -200,26 +204,26 @@ class BezierSurface(GeometrySurface): """ ... - def setPole(self, pole: Any) -> None: + def setPole(self, pole: Any, /) -> None: """ Set a pole of the Bezier surface. """ ... - def setPoleCol(self, poles: Any) -> None: + def setPoleCol(self, poles: Any, /) -> None: """ Set the column of poles of the Bezier surface. """ ... - def setPoleRow(self, poles: Any) -> None: + def setPoleRow(self, poles: Any, /) -> None: """ Set the row of poles of the Bezier surface. """ ... @constmethod - def getPole(self, UIndex: int, VIndex: int) -> Any: + def getPole(self, UIndex: int, VIndex: int, /) -> Any: """ Get a pole of index (UIndex, VIndex) of the Bezier surface. """ @@ -232,21 +236,21 @@ class BezierSurface(GeometrySurface): """ ... - def setWeight(self, UIndex: int, VIndex: int, weight: float) -> None: + def setWeight(self, UIndex: int, VIndex: int, weight: float, /) -> None: """ Set the weight of pole of the index (UIndex, VIndex) for the Bezier surface. """ ... - def setWeightCol(self, VIndex: int, weights: Any) -> None: + def setWeightCol(self, VIndex: int, weights: Any, /) -> None: """ Set the weights of the poles in the column of poles of index VIndex of the Bezier surface. """ ... - def setWeightRow(self, UIndex: int, weights: Any) -> None: + def setWeightRow(self, UIndex: int, weights: Any, /) -> None: """ Set the weights of the poles in the row of poles of index UIndex of the Bezier surface. @@ -254,7 +258,7 @@ class BezierSurface(GeometrySurface): ... @constmethod - def getWeight(self, UIndex: int, VIndex: int) -> float: + def getWeight(self, UIndex: int, VIndex: int, /) -> float: """ Get a weight of the pole of index (UIndex, VIndex) of the Bezier surface. @@ -269,7 +273,7 @@ class BezierSurface(GeometrySurface): ... @constmethod - def getResolution(self, Tolerance3D: float) -> Tuple[float, float]: + def getResolution(self, Tolerance3D: float, /) -> Tuple[float, float]: """ Computes two tolerance values for this Bezier surface, based on the given tolerance in 3D space Tolerance3D. The tolerances computed are: diff --git a/src/Mod/Part/App/BodyBase.pyi b/src/Mod/Part/App/BodyBase.pyi index d4da3c618e..ce59058998 100644 --- a/src/Mod/Part/App/BodyBase.pyi +++ b/src/Mod/Part/App/BodyBase.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from PartFeature import PartFeature diff --git a/src/Mod/Part/App/BoundedCurve.pyi b/src/Mod/Part/App/BoundedCurve.pyi index a4235a85e1..65241d21fb 100644 --- a/src/Mod/Part/App/BoundedCurve.pyi +++ b/src/Mod/Part/App/BoundedCurve.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from GeometryCurve import GeometryCurve from typing import Any, Final diff --git a/src/Mod/Part/App/ChFi2d/ChFi2d_AnaFilletAlgo.pyi b/src/Mod/Part/App/ChFi2d/ChFi2d_AnaFilletAlgo.pyi index 1b891d20c2..9b4594c092 100644 --- a/src/Mod/Part/App/ChFi2d/ChFi2d_AnaFilletAlgo.pyi +++ b/src/Mod/Part/App/ChFi2d/ChFi2d_AnaFilletAlgo.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Metadata import export, constmethod from Base.PyObjectBase import PyObjectBase from typing import Tuple @@ -23,7 +27,7 @@ class AnaFilletAlgo(PyObjectBase): """ ... - def perform(self, radius: float) -> bool: + def perform(self, radius: float, /) -> bool: """ perform(radius) -> bool diff --git a/src/Mod/Part/App/ChFi2d/ChFi2d_ChamferAPI.pyi b/src/Mod/Part/App/ChFi2d/ChFi2d_ChamferAPI.pyi index 88c891b63b..8b9f3faddc 100644 --- a/src/Mod/Part/App/ChFi2d/ChFi2d_ChamferAPI.pyi +++ b/src/Mod/Part/App/ChFi2d/ChFi2d_ChamferAPI.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from typing import Tuple, overload @@ -25,7 +29,7 @@ class ChFi2d_ChamferAPI(PyObjectBase): """ ... - def perform(self, radius: float) -> bool: + def perform(self, radius: float, /) -> bool: """ perform(radius) -> bool @@ -33,7 +37,7 @@ class ChFi2d_ChamferAPI(PyObjectBase): """ ... - def result(self, point: object, solution: int = -1) -> Tuple[object, object, object]: + def result(self, point: object, solution: int = -1, /) -> Tuple[object, object, object]: """ result(point, solution=-1) diff --git a/src/Mod/Part/App/ChFi2d/ChFi2d_FilletAPI.pyi b/src/Mod/Part/App/ChFi2d/ChFi2d_FilletAPI.pyi index a4e053d863..ec029446d2 100644 --- a/src/Mod/Part/App/ChFi2d/ChFi2d_FilletAPI.pyi +++ b/src/Mod/Part/App/ChFi2d/ChFi2d_FilletAPI.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.PyObjectBase import PyObjectBase from typing import overload @@ -26,7 +30,7 @@ class ChFi2d_FilletAPI(PyObjectBase): """ ... - def perform(self, radius: float) -> bool: + def perform(self, radius: float, /) -> bool: """ perform(radius) -> bool @@ -40,9 +44,7 @@ class ChFi2d_FilletAPI(PyObjectBase): """ ... - def result( - self, point: Point, solution: int = -1 - ) -> tuple[TopoShapeEdge, TopoShapeEdge, TopoShapeEdge]: + def result(self, point: Point, solution: int = -1, /) -> tuple[TopoShapeEdge, TopoShapeEdge, TopoShapeEdge]: """ result(point, solution=-1) diff --git a/src/Mod/Part/App/ChFi2d/ChFi2d_FilletAlgo.pyi b/src/Mod/Part/App/ChFi2d/ChFi2d_FilletAlgo.pyi index 81d5535910..ae916ddc38 100644 --- a/src/Mod/Part/App/ChFi2d/ChFi2d_FilletAlgo.pyi +++ b/src/Mod/Part/App/ChFi2d/ChFi2d_FilletAlgo.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Metadata import export, constmethod from Base.PyObjectBase import PyObjectBase from Base.Vector import Vector @@ -26,7 +30,7 @@ class FilletAlgo(PyObjectBase): """ ... - def perform(self, radius: float) -> bool: + def perform(self, radius: float, /) -> bool: """ perform(radius) -> bool @@ -40,7 +44,7 @@ class FilletAlgo(PyObjectBase): """ ... - def result(self, point: Vector, solution: int = -1) -> tuple[object, object, object]: + def result(self, point: Vector, solution: int = -1, /) -> tuple[object, object, object]: """ result(point, solution=-1) diff --git a/src/Mod/Part/App/Circle.pyi b/src/Mod/Part/App/Circle.pyi index 1a3e9d0286..32a001b9b2 100644 --- a/src/Mod/Part/App/Circle.pyi +++ b/src/Mod/Part/App/Circle.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from Base.Vector import Vector from Conic import Conic diff --git a/src/Mod/Part/App/Cone.pyi b/src/Mod/Part/App/Cone.pyi index 4e7138d3b3..632d34cc82 100644 --- a/src/Mod/Part/App/Cone.pyi +++ b/src/Mod/Part/App/Cone.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from Base.Vector import Vector from Base.Axis import Axis as AxisPy diff --git a/src/Mod/Part/App/Conic.pyi b/src/Mod/Part/App/Conic.pyi index 3d82016533..dd56278eb4 100644 --- a/src/Mod/Part/App/Conic.pyi +++ b/src/Mod/Part/App/Conic.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from GeometryCurve import GeometryCurve from typing import Final diff --git a/src/Mod/Part/App/Cylinder.pyi b/src/Mod/Part/App/Cylinder.pyi index 5eff313747..9116ac1c44 100644 --- a/src/Mod/Part/App/Cylinder.pyi +++ b/src/Mod/Part/App/Cylinder.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from Base.Vector import Vector from Circle import Circle diff --git a/src/Mod/Part/App/Ellipse.pyi b/src/Mod/Part/App/Ellipse.pyi index 8ede6845f8..716fb8e054 100644 --- a/src/Mod/Part/App/Ellipse.pyi +++ b/src/Mod/Part/App/Ellipse.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from Base.Vector import Vector from Conic import Conic diff --git a/src/Mod/Part/App/Geom2d/ArcOfCircle2d.pyi b/src/Mod/Part/App/Geom2d/ArcOfCircle2d.pyi index d75e932b93..7aa4947c8e 100644 --- a/src/Mod/Part/App/Geom2d/ArcOfCircle2d.pyi +++ b/src/Mod/Part/App/Geom2d/ArcOfCircle2d.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Metadata import export, constmethod from typing import Final, overload from Part.Geom2d import ArcOfConic2d diff --git a/src/Mod/Part/App/Geom2d/ArcOfConic2d.pyi b/src/Mod/Part/App/Geom2d/ArcOfConic2d.pyi index a937287f37..d2533cdc18 100644 --- a/src/Mod/Part/App/Geom2d/ArcOfConic2d.pyi +++ b/src/Mod/Part/App/Geom2d/ArcOfConic2d.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod, overload from typing import Final from Part.Geom2d import Curve2d diff --git a/src/Mod/Part/App/Geom2d/ArcOfEllipse2d.pyi b/src/Mod/Part/App/Geom2d/ArcOfEllipse2d.pyi index 1c4b12f80d..05a04a355e 100644 --- a/src/Mod/Part/App/Geom2d/ArcOfEllipse2d.pyi +++ b/src/Mod/Part/App/Geom2d/ArcOfEllipse2d.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Metadata import export, constmethod from typing import Final, overload from Part import ArcOfConic2d diff --git a/src/Mod/Part/App/Geom2d/ArcOfHyperbola2d.pyi b/src/Mod/Part/App/Geom2d/ArcOfHyperbola2d.pyi index b85a9e0723..e108eca788 100644 --- a/src/Mod/Part/App/Geom2d/ArcOfHyperbola2d.pyi +++ b/src/Mod/Part/App/Geom2d/ArcOfHyperbola2d.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod, overload from typing import Final from Part.Geom2d import ArcOfConic2d diff --git a/src/Mod/Part/App/Geom2d/ArcOfParabola2d.pyi b/src/Mod/Part/App/Geom2d/ArcOfParabola2d.pyi index 286597a55a..1499f0921e 100644 --- a/src/Mod/Part/App/Geom2d/ArcOfParabola2d.pyi +++ b/src/Mod/Part/App/Geom2d/ArcOfParabola2d.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Metadata import export, constmethod, overload from typing import Final from Part.Geom2d import ArcOfConic2d diff --git a/src/Mod/Part/App/Geom2d/BSplineCurve2d.pyi b/src/Mod/Part/App/Geom2d/BSplineCurve2d.pyi index c25668c688..04a319f792 100644 --- a/src/Mod/Part/App/Geom2d/BSplineCurve2d.pyi +++ b/src/Mod/Part/App/Geom2d/BSplineCurve2d.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from typing import Final, overload from Part.Curve2d import Curve2d @@ -71,7 +75,7 @@ class BSplineCurve2d(Curve2d): """ ... - def increaseDegree(self, Degree: int) -> None: + def increaseDegree(self, Degree: int, /) -> None: """ increaseDegree(Int=Degree) @@ -83,9 +87,13 @@ class BSplineCurve2d(Curve2d): ... @overload - def increaseMultiplicity(self, index: int, mult: int) -> None: ... + def increaseMultiplicity(self, index: int, mult: int, /) -> None: + ... + @overload - def increaseMultiplicity(self, start: int, end: int, mult: int) -> None: ... + def increaseMultiplicity(self, start: int, end: int, mult: int, /) -> None: + ... + def increaseMultiplicity(self, *args, **kwargs) -> None: """ increaseMultiplicity(int index, int mult) @@ -99,7 +107,7 @@ class BSplineCurve2d(Curve2d): """ ... - def incrementMultiplicity(self, start: int, end: int, mult: int) -> None: + def incrementMultiplicity(self, start: int, end: int, mult: int, /) -> None: """ incrementMultiplicity(int start, int end, int mult) Raises multiplicity of knots by mult. @@ -108,7 +116,7 @@ class BSplineCurve2d(Curve2d): """ ... - def insertKnot(self, u: float, mult: int = 1, tol: float = 0.0) -> None: + def insertKnot(self, u: float, mult: int = 1, tol: float = 0.0, /) -> None: """ insertKnot(u, mult = 1, tol = 0.0) @@ -116,13 +124,7 @@ class BSplineCurve2d(Curve2d): """ ... - def insertKnots( - self, - list_of_floats: list[float], - list_of_ints: list[int], - tol: float = 0.0, - bool_add: bool = True, - ) -> None: + def insertKnots(self, list_of_floats: list[float], list_of_ints: list[int], tol: float = 0.0, bool_add: bool = True, /) -> None: """ insertKnots(list_of_floats, list_of_ints, tol = 0.0, bool_add = True) @@ -142,7 +144,7 @@ class BSplineCurve2d(Curve2d): """ ... - def removeKnot(self, Index: int, M: int, tol: float) -> None: + def removeKnot(self, Index: int, M: int, tol: float, /) -> None: """ removeKnot(Index, M, tol) @@ -161,26 +163,26 @@ class BSplineCurve2d(Curve2d): """ ... - def segment(self, u1: float, u2: float) -> None: + def segment(self, u1: float, u2: float, /) -> None: """ segment(u1,u2) Modifies this B-Spline curve by segmenting it. """ ... - def setKnot(self, value: float) -> None: + def setKnot(self, value: float, /) -> None: """ Set a knot of the B-Spline curve. """ ... - def getKnot(self, index: int) -> float: + def getKnot(self, index: int, /) -> float: """ Get a knot of the B-Spline curve. """ ... - def setKnots(self, knots: list[float]) -> None: + def setKnots(self, knots: list[float], /) -> None: """ Set knots of the B-Spline curve. """ @@ -192,13 +194,13 @@ class BSplineCurve2d(Curve2d): """ ... - def setPole(self, P: Vector, Index: int) -> None: + def setPole(self, P: Vector, Index: int, /) -> None: """ Modifies this B-Spline curve by assigning P to the pole of index Index in the poles table. """ ... - def getPole(self, Index: int) -> Vector: + def getPole(self, Index: int, /) -> Vector: """ Get a pole of the B-Spline curve. """ @@ -210,13 +212,13 @@ class BSplineCurve2d(Curve2d): """ ... - def setWeight(self, weight: float, Index: int) -> None: + def setWeight(self, weight: float, Index: int, /) -> None: """ Set a weight of the B-Spline curve. """ ... - def getWeight(self, Index: int) -> float: + def getWeight(self, Index: int, /) -> float: """ Get a weight of the B-Spline curve. """ @@ -244,7 +246,7 @@ class BSplineCurve2d(Curve2d): """ ... - def movePoint(self, U: float, P: Vector, Index1: int, Index2: int) -> tuple[int, int]: + def movePoint(self, U: float, P: Vector, Index1: int, Index2: int, /) -> tuple[int, int]: """ movePoint(U, P, Index1, Index2) @@ -270,14 +272,14 @@ class BSplineCurve2d(Curve2d): """ ... - def setOrigin(self, Index: int) -> None: + def setOrigin(self, Index: int, /) -> None: """ Assigns the knot of index Index in the knots table as the origin of this periodic B-Spline curve. As a consequence, the knots and poles tables are modified. """ ... - def getMultiplicity(self, index: int) -> int: + def getMultiplicity(self, index: int, /) -> int: """ Returns the multiplicity of the knot of index from the knots table of this B-Spline curve. """ @@ -363,7 +365,7 @@ class BSplineCurve2d(Curve2d): """ ... - def buildFromPoles(self, poles: list[Vector]) -> None: + def buildFromPoles(self, poles: list[Vector], /) -> None: """ Builds a B-Spline by a list of poles. """ @@ -424,20 +426,20 @@ class BSplineCurve2d(Curve2d): """ ... - def toBiArcs(self, tolerance: float) -> list: + def toBiArcs(self, tolerance: float, /) -> list: """ toBiArcs(tolerance) -> list. Build a list of arcs and lines to approximate the B-spline. """ ... - def join(self, other: "BSplineCurve2d") -> "BSplineCurve2d": + def join(self, other: "BSplineCurve2d", /) -> "BSplineCurve2d": """ Build a new spline by joining this and a second spline. """ ... - def makeC1Continuous(self, tol: float = 1e-6, ang_tol: float = 1e-7) -> "BSplineCurve2d": + def makeC1Continuous(self, tol: float = 1e-6, ang_tol: float = 1e-7, /) -> "BSplineCurve2d": """ makeC1Continuous(tol = 1e-6, ang_tol = 1e-7) diff --git a/src/Mod/Part/App/Geom2d/BezierCurve2d.pyi b/src/Mod/Part/App/Geom2d/BezierCurve2d.pyi index 684044a2eb..8896ec6f00 100644 --- a/src/Mod/Part/App/Geom2d/BezierCurve2d.pyi +++ b/src/Mod/Part/App/Geom2d/BezierCurve2d.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Part.Curve2d import Curve2d from typing import Final, List @@ -54,7 +58,7 @@ class BezierCurve2d(Curve2d): """ ... - def increase(self, Degree: int) -> None: + def increase(self, Degree: int, /) -> None: """ increase(Int=Degree) Increases the degree of this Bezier curve to Degree. @@ -62,19 +66,19 @@ class BezierCurve2d(Curve2d): """ ... - def insertPoleAfter(self, index: int) -> None: + def insertPoleAfter(self, index: int, /) -> None: """ Inserts after the pole of index. """ ... - def insertPoleBefore(self, index: int) -> None: + def insertPoleBefore(self, index: int, /) -> None: """ Inserts before the pole of index. """ ... - def removePole(self, index: int) -> None: + def removePole(self, index: int, /) -> None: """ Removes the pole of index Index from the table of poles of this Bezier curve. If this Bezier curve is rational, it can become non-rational. @@ -87,13 +91,13 @@ class BezierCurve2d(Curve2d): """ ... - def setPole(self, index: int, pole: object) -> None: + def setPole(self, index: int, pole: object, /) -> None: """ Set a pole of the Bezier curve. """ ... - def getPole(self, index: int) -> object: + def getPole(self, index: int, /) -> object: """ Get a pole of the Bezier curve. """ @@ -105,19 +109,19 @@ class BezierCurve2d(Curve2d): """ ... - def setPoles(self, poles: List[object]) -> None: + def setPoles(self, poles: List[object], /) -> None: """ Set the poles of the Bezier curve. """ ... - def setWeight(self, index: int, weight: float) -> None: + def setWeight(self, index: int, weight: float, /) -> None: """ Set a weight of the Bezier curve. """ ... - def getWeight(self, index: int) -> float: + def getWeight(self, index: int, /) -> float: """ Get a weight of the Bezier curve. """ @@ -130,7 +134,7 @@ class BezierCurve2d(Curve2d): ... @constmethod - def getResolution(self, Tolerance3D: float) -> float: + def getResolution(self, Tolerance3D: float, /) -> float: """ Computes for this Bezier curve the parametric tolerance (UTolerance) for a given 3D tolerance (Tolerance3D). diff --git a/src/Mod/Part/App/Geom2d/Circle2d.pyi b/src/Mod/Part/App/Geom2d/Circle2d.pyi index 28fb16297a..4ebea3e42d 100644 --- a/src/Mod/Part/App/Geom2d/Circle2d.pyi +++ b/src/Mod/Part/App/Geom2d/Circle2d.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Metadata import export, constmethod from typing import Final, overload, Tuple from Part.Geom2d import Conic2d diff --git a/src/Mod/Part/App/Geom2d/Conic2d.pyi b/src/Mod/Part/App/Geom2d/Conic2d.pyi index 2c725bd4aa..978f9ff1d4 100644 --- a/src/Mod/Part/App/Geom2d/Conic2d.pyi +++ b/src/Mod/Part/App/Geom2d/Conic2d.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from typing import Final from Part.Geom2d import Curve2d diff --git a/src/Mod/Part/App/Geom2d/Curve2d.pyi b/src/Mod/Part/App/Geom2d/Curve2d.pyi index a43d1a8f24..11a46cd0d5 100644 --- a/src/Mod/Part/App/Geom2d/Curve2d.pyi +++ b/src/Mod/Part/App/Geom2d/Curve2d.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.Vector import Vector from Part.App.Geom2d.Geometry2d import Geometry2d @@ -103,13 +107,21 @@ class Curve2d(Geometry2d): ... @overload - def length(self) -> float: ... + def length(self, /) -> float: + ... + @overload - def length(self, uMin: float) -> float: ... + def length(self, uMin: float, /) -> float: + ... + @overload - def length(self, uMin: float, uMax: float) -> float: ... + def length(self, uMin: float, uMax: float, /) -> float: + ... + @overload - def length(self, uMin: float, uMax: float, Tol: float) -> float: ... + def length(self, uMin: float, uMax: float, Tol: float, /) -> float: + ... + def length(self, *args: float) -> float: """ Computes the length of a curve @@ -118,9 +130,13 @@ class Curve2d(Geometry2d): ... @overload - def parameterAtDistance(self, abscissa: float) -> float: ... + def parameterAtDistance(self, abscissa: float, /) -> float: + ... + @overload - def parameterAtDistance(self, abscissa: float, startingParameter: float) -> float: ... + def parameterAtDistance(self, abscissa: float, startingParameter: float, /) -> float: + ... + def parameterAtDistance(self, *args: float) -> float: """ Returns the parameter on the curve of a point at @@ -129,19 +145,19 @@ class Curve2d(Geometry2d): """ ... - def value(self, u: float) -> Vector: + def value(self, u: float, /) -> Vector: """ Computes the point of parameter u on this curve """ ... - def tangent(self, u: float) -> Vector: + def tangent(self, u: float, /) -> Vector: """ Computes the tangent of parameter u on this curve """ ... - def parameter(self, point: Vector) -> float: + def parameter(self, point: Vector, /) -> float: """ Returns the parameter on the curve of the nearest orthogonal projection of the point. @@ -149,37 +165,41 @@ class Curve2d(Geometry2d): ... @constmethod - def normal(self, pos: float) -> Vector: + def normal(self, pos: float, /) -> Vector: """ Vector = normal(pos) - Get the normal vector at the given parameter [First|Last] if defined. """ ... @constmethod - def curvature(self, pos: float) -> float: + def curvature(self, pos: float, /) -> float: """ Float = curvature(pos) - Get the curvature at the given parameter [First|Last] if defined. """ ... @constmethod - def centerOfCurvature(self, pos: float) -> Vector: + def centerOfCurvature(self, pos: float, /) -> Vector: """ Vector = centerOfCurvature(float pos) - Get the center of curvature at the given parameter [First|Last] if defined. """ ... @constmethod - def intersectCC(self, other: "Curve2d") -> List[Vector]: + def intersectCC(self, other: "Curve2d", /) -> List[Vector]: """ Returns all intersection points between this curve and the given curve. """ ... @overload - def toBSpline(self) -> BSplineCurve: ... + def toBSpline(self, /) -> BSplineCurve: + ... + @overload - def toBSpline(self, First: float, Last: float) -> BSplineCurve: ... + def toBSpline(self, First: float, Last: float, /) -> BSplineCurve: + ... + def toBSpline(self, *args: float) -> BSplineCurve: """ Converts a curve of any type (only part from First to Last) @@ -187,9 +207,7 @@ class Curve2d(Geometry2d): """ ... - def approximateBSpline( - self, Tolerance: float, MaxSegments: int, MaxDegree: int, Order: str = "C2" - ) -> BSplineCurve: + def approximateBSpline(self, Tolerance: float, MaxSegments: int, MaxDegree: int, Order: str = "C2", /) -> BSplineCurve: """ Approximates a curve of any type to a B-Spline curve approximateBSpline(Tolerance, MaxSegments, MaxDegree, [Order='C2']) -> B-Spline curve diff --git a/src/Mod/Part/App/Geom2d/Ellipse2d.pyi b/src/Mod/Part/App/Geom2d/Ellipse2d.pyi index 9170c5a3bd..1035e4aecc 100644 --- a/src/Mod/Part/App/Geom2d/Ellipse2d.pyi +++ b/src/Mod/Part/App/Geom2d/Ellipse2d.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Final, overload from Base.Metadata import export, constmethod from Part.Conic2d import Conic2d diff --git a/src/Mod/Part/App/Geom2d/Geometry2d.pyi b/src/Mod/Part/App/Geom2d/Geometry2d.pyi index 3998aaf2fe..ca61d6d4b8 100644 --- a/src/Mod/Part/App/Geom2d/Geometry2d.pyi +++ b/src/Mod/Part/App/Geom2d/Geometry2d.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.PyObjectBase import PyObjectBase from typing import overload diff --git a/src/Mod/Part/App/Geom2d/Hyperbola2d.pyi b/src/Mod/Part/App/Geom2d/Hyperbola2d.pyi index a6200783d4..d45cb3ff41 100644 --- a/src/Mod/Part/App/Geom2d/Hyperbola2d.pyi +++ b/src/Mod/Part/App/Geom2d/Hyperbola2d.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from Part.Conic2d import Conic2d from typing import Final, overload diff --git a/src/Mod/Part/App/Geom2d/Line2d.pyi b/src/Mod/Part/App/Geom2d/Line2d.pyi index 11ef90d158..236e158d5a 100644 --- a/src/Mod/Part/App/Geom2d/Line2d.pyi +++ b/src/Mod/Part/App/Geom2d/Line2d.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Part.Geom2d.Curve2d import Curve2d from typing import overload diff --git a/src/Mod/Part/App/Geom2d/Line2dSegment.pyi b/src/Mod/Part/App/Geom2d/Line2dSegment.pyi index 5efde42b56..1c8af07de7 100644 --- a/src/Mod/Part/App/Geom2d/Line2dSegment.pyi +++ b/src/Mod/Part/App/Geom2d/Line2dSegment.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from typing import Final, overload from Part.Geom2d import Curve2d diff --git a/src/Mod/Part/App/Geom2d/OffsetCurve2d.pyi b/src/Mod/Part/App/Geom2d/OffsetCurve2d.pyi index c08abfe716..46c114cff5 100644 --- a/src/Mod/Part/App/Geom2d/OffsetCurve2d.pyi +++ b/src/Mod/Part/App/Geom2d/OffsetCurve2d.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Metadata import export from typing import Final from Part.Geom2d import Curve2d diff --git a/src/Mod/Part/App/Geom2d/Parabola2d.pyi b/src/Mod/Part/App/Geom2d/Parabola2d.pyi index e74e12f617..2bb801c7a6 100644 --- a/src/Mod/Part/App/Geom2d/Parabola2d.pyi +++ b/src/Mod/Part/App/Geom2d/Parabola2d.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Part.App.Geom2d.Conic2d import Conic2d from typing import Final diff --git a/src/Mod/Part/App/GeomPlate/BuildPlateSurface.pyi b/src/Mod/Part/App/GeomPlate/BuildPlateSurface.pyi index bd2bd6b097..06bf0eb202 100644 --- a/src/Mod/Part/App/GeomPlate/BuildPlateSurface.pyi +++ b/src/Mod/Part/App/GeomPlate/BuildPlateSurface.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.PyObjectBase import PyObjectBase from typing import List diff --git a/src/Mod/Part/App/GeomPlate/CurveConstraint.pyi b/src/Mod/Part/App/GeomPlate/CurveConstraint.pyi index afc98326f6..4f3975999a 100644 --- a/src/Mod/Part/App/GeomPlate/CurveConstraint.pyi +++ b/src/Mod/Part/App/GeomPlate/CurveConstraint.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.PyObjectBase import PyObjectBase from typing import Final, overload diff --git a/src/Mod/Part/App/GeomPlate/PointConstraint.pyi b/src/Mod/Part/App/GeomPlate/PointConstraint.pyi index b2a8c218fc..8e4bcabf12 100644 --- a/src/Mod/Part/App/GeomPlate/PointConstraint.pyi +++ b/src/Mod/Part/App/GeomPlate/PointConstraint.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.PyObjectBase import PyObjectBase from typing import Final, overload @@ -18,7 +22,7 @@ class PointConstraint(PyObjectBase): Licence: LGPL """ - def setOrder(self, order: str) -> None: + def setOrder(self, order: str, /) -> None: """ Allows you to set the order of continuity required for the constraints: G0, G1, and G2, controlled @@ -32,7 +36,7 @@ class PointConstraint(PyObjectBase): """ ... - def G0Criterion(self, U: float) -> float: + def G0Criterion(self, U: float, /) -> float: """ Returns the G0 criterion at the parametric point U on the curve. This is the greatest distance allowed between @@ -40,7 +44,7 @@ class PointConstraint(PyObjectBase): """ ... - def G1Criterion(self, U: float) -> float: + def G1Criterion(self, U: float, /) -> float: """ Returns the G1 criterion at the parametric point U on the curve. This is the greatest angle allowed between @@ -49,7 +53,7 @@ class PointConstraint(PyObjectBase): """ ... - def G2Criterion(self, U: float) -> float: + def G2Criterion(self, U: float, /) -> float: """ Returns the G2 criterion at the parametric point U on the curve. This is the greatest difference in curvature @@ -58,7 +62,7 @@ class PointConstraint(PyObjectBase): """ ... - def setG0Criterion(self, value: float) -> None: + def setG0Criterion(self, value: float, /) -> None: """ Allows you to set the G0 criterion. This is the law defining the greatest distance allowed between the @@ -68,7 +72,7 @@ class PointConstraint(PyObjectBase): """ ... - def setG1Criterion(self, value: float) -> None: + def setG1Criterion(self, value: float, /) -> None: """ Allows you to set the G1 criterion. This is the law defining the greatest angle allowed between the @@ -78,7 +82,7 @@ class PointConstraint(PyObjectBase): """ ... - def setG2Criterion(self, value: float) -> None: + def setG2Criterion(self, value: float, /) -> None: """ Allows you to set the G2 criterion. This is the law defining the greatest difference in curvature allowed between the @@ -94,7 +98,7 @@ class PointConstraint(PyObjectBase): """ ... - def setPnt2dOnSurf(self, p: "gp_Pnt2d") -> None: + def setPnt2dOnSurf(self, p: "gp_Pnt2d", /) -> None: """ Allows you to set a 2D point on the surface. It takes a gp_Pnt2d as an argument, representing the 2D point to be associated with the surface. """ diff --git a/src/Mod/Part/App/Geometry.pyi b/src/Mod/Part/App/Geometry.pyi index 8b51ce5bcf..afa1653c7a 100644 --- a/src/Mod/Part/App/Geometry.pyi +++ b/src/Mod/Part/App/Geometry.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.Persistence import Persistence from App.Extension import Extension @@ -21,31 +25,31 @@ class Geometry(Persistence): Tag: Final[str] """Gives the tag of the geometry as string.""" - def mirror(self, geometry: "Geometry") -> None: + def mirror(self, geometry: "Geometry", /) -> None: """ Performs the symmetrical transformation of this geometric object """ ... - def rotate(self, angle: float, axis: Vector) -> None: + def rotate(self, angle: float, axis: Vector, /) -> None: """ Rotates this geometric object at angle Ang (in radians) about axis """ ... - def scale(self, center: Vector, factor: float) -> None: + def scale(self, center: Vector, factor: float, /) -> None: """ Applies a scaling transformation on this geometric object with a center and scaling factor """ ... - def transform(self, transformation: Matrix) -> None: + def transform(self, transformation: Matrix, /) -> None: """ Applies a transformation to this geometric object """ ... - def translate(self, vector: Vector) -> None: + def translate(self, vector: Vector, /) -> None: """ Translates this geometric object """ @@ -66,7 +70,7 @@ class Geometry(Persistence): ... @constmethod - def isSame(self, geom: "Geometry", tol: float, angulartol: float) -> bool: + def isSame(self, geom: "Geometry", tol: float, angulartol: float, /) -> bool: """ isSame(geom, tol, angulartol) -> boolean @@ -75,46 +79,46 @@ class Geometry(Persistence): ... @constmethod - def hasExtensionOfType(self, type_name: str) -> bool: + def hasExtensionOfType(self, type_name: str, /) -> bool: """ Returns a boolean indicating whether a geometry extension of the type indicated as a string exists. """ ... @constmethod - def hasExtensionOfName(self, name: str) -> bool: + def hasExtensionOfName(self, name: str, /) -> bool: """ Returns a boolean indicating whether a geometry extension with the name indicated as a string exists. """ ... @constmethod - def getExtensionOfType(self, type_name: str) -> Optional[Extension]: + def getExtensionOfType(self, type_name: str, /) -> Optional[Extension]: """ Gets the first geometry extension of the type indicated by the string. """ ... @constmethod - def getExtensionOfName(self, name: str) -> Optional[Extension]: + def getExtensionOfName(self, name: str, /) -> Optional[Extension]: """ Gets the first geometry extension of the name indicated by the string. """ ... - def setExtension(self, extension: Extension) -> None: + def setExtension(self, extension: Extension, /) -> None: """ Sets a geometry extension of the indicated type. """ ... - def deleteExtensionOfType(self, type_name: str) -> None: + def deleteExtensionOfType(self, type_name: str, /) -> None: """ Deletes all extensions of the indicated type. """ ... - def deleteExtensionOfName(self, name: str) -> None: + def deleteExtensionOfName(self, name: str, /) -> None: """ Deletes all extensions of the indicated name. """ diff --git a/src/Mod/Part/App/GeometryBoolExtension.pyi b/src/Mod/Part/App/GeometryBoolExtension.pyi index 1c550c6cf3..73ca3faa46 100644 --- a/src/Mod/Part/App/GeometryBoolExtension.pyi +++ b/src/Mod/Part/App/GeometryBoolExtension.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from GeometryExtension import GeometryExtension diff --git a/src/Mod/Part/App/GeometryCurve.pyi b/src/Mod/Part/App/GeometryCurve.pyi index bf68f44611..3dcba1a8ff 100644 --- a/src/Mod/Part/App/GeometryCurve.pyi +++ b/src/Mod/Part/App/GeometryCurve.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.Vector import Vector from Base.Rotation import Rotation as RotationPy @@ -146,35 +150,35 @@ class GeometryCurve(Geometry): ... @constmethod - def getD0(self, parameter: float) -> Vector: + def getD0(self, parameter: float, /) -> Vector: """ Returns the point of given parameter """ ... @constmethod - def getD1(self, parameter: float) -> Vector: + def getD1(self, parameter: float, /) -> Vector: """ Returns the point and first derivative of given parameter """ ... @constmethod - def getD2(self, parameter: float) -> Vector: + def getD2(self, parameter: float, /) -> Vector: """ Returns the point, first and second derivatives """ ... @constmethod - def getD3(self, parameter: float) -> Vector: + def getD3(self, parameter: float, /) -> Vector: """ Returns the point, first, second and third derivatives """ ... @constmethod - def getDN(self, n: int, parameter: float) -> Vector: + def getDN(self, n: int, parameter: float, /) -> Vector: """ Returns the n-th derivative """ @@ -186,7 +190,7 @@ class GeometryCurve(Geometry): uMin: Optional[float] = None, uMax: Optional[float] = None, Tol: Optional[float] = None, - ) -> float: + /,) -> float: """ Computes the length of a curve length([uMin, uMax, Tol]) -> float @@ -198,7 +202,7 @@ class GeometryCurve(Geometry): self, abscissa: Optional[float] = None, startingParameter: Optional[float] = None, - ) -> float: + /,) -> float: """ Returns the parameter on the curve of a point at the given distance from a starting parameter. parameterAtDistance([abscissa, startingParameter]) -> float @@ -206,49 +210,49 @@ class GeometryCurve(Geometry): ... @constmethod - def value(self, u: float) -> Vector: + def value(self, u: float, /) -> Vector: """ Computes the point of parameter u on this curve """ ... @constmethod - def tangent(self, u: float) -> Vector: + def tangent(self, u: float, /) -> Vector: """ Computes the tangent of parameter u on this curve """ ... @constmethod - def makeRuledSurface(self, otherCurve: "GeometryCurve") -> object: + def makeRuledSurface(self, otherCurve: "GeometryCurve", /) -> object: """ Make a ruled surface of this and the given curves """ ... @constmethod - def intersect2d(self, otherCurve: "GeometryCurve") -> List[Vector]: + def intersect2d(self, otherCurve: "GeometryCurve", /) -> List[Vector]: """ Get intersection points with another curve lying on a plane. """ ... @constmethod - def continuityWith(self, otherCurve: "GeometryCurve") -> str: + def continuityWith(self, otherCurve: "GeometryCurve", /) -> str: """ Computes the continuity of two curves """ ... @constmethod - def parameter(self, point: Vector) -> float: + def parameter(self, point: Vector, /) -> float: """ Returns the parameter on the curve of the nearest orthogonal projection of the point. """ ... @constmethod - def normal(self, pos: float) -> Vector: + def normal(self, pos: float, /) -> Vector: """ Vector = normal(pos) - Get the normal vector at the given parameter [First|Last] if defined """ @@ -318,21 +322,21 @@ class GeometryCurve(Geometry): ... @constmethod - def curvature(self, pos: float) -> float: + def curvature(self, pos: float, /) -> float: """ Float = curvature(pos) - Get the curvature at the given parameter [First|Last] if defined """ ... @constmethod - def centerOfCurvature(self, pos: float) -> Vector: + def centerOfCurvature(self, pos: float, /) -> Vector: """ Vector = centerOfCurvature(float pos) - Get the center of curvature at the given parameter [First|Last] if defined """ ... @constmethod - def intersect(self, curve_or_surface: object, precision: float) -> object: + def intersect(self, curve_or_surface: object, precision: float, /) -> object: """ Returns all intersection points and curve segments between the curve and the curve/surface. @@ -341,21 +345,21 @@ class GeometryCurve(Geometry): ... @constmethod - def intersectCS(self, surface: object) -> object: + def intersectCS(self, surface: object, /) -> object: """ Returns all intersection points and curve segments between the curve and the surface. """ ... @constmethod - def intersectCC(self, otherCurve: "GeometryCurve") -> List[Vector]: + def intersectCC(self, otherCurve: "GeometryCurve", /) -> List[Vector]: """ Returns all intersection points between this curve and the given curve. """ ... @constmethod - def toBSpline(self, points: Tuple[float, float]) -> "BSplineCurve": + def toBSpline(self, points: Tuple[float, float], /) -> "BSplineCurve": """ Converts a curve of any type (only part from First to Last) to BSpline curve. toBSpline((first: float, last: float)) -> BSplineCurve @@ -363,7 +367,7 @@ class GeometryCurve(Geometry): ... @constmethod - def toNurbs(self, points: Tuple[float, float]) -> "NurbsCurve": + def toNurbs(self, points: Tuple[float, float], /) -> "NurbsCurve": """ Converts a curve of any type (only part from First to Last) to NURBS curve. toNurbs((first: float, last: float)) -> NurbsCurve @@ -371,7 +375,7 @@ class GeometryCurve(Geometry): ... @constmethod - def trim(self, points: Tuple[float, float]) -> "TrimmedCurve": + def trim(self, points: Tuple[float, float], /) -> "TrimmedCurve": """ Returns a trimmed curve defined in the given parameter range. trim((first: float, last: float)) -> TrimmedCurve @@ -380,8 +384,7 @@ class GeometryCurve(Geometry): @constmethod def approximateBSpline( - self, Tolerance: float, MaxSegments: int, MaxDegree: int, Order: str = "C2" - ) -> "BSplineCurve": + self, Tolerance: float, MaxSegments: int, MaxDegree: int, Order: str = "C2", /) -> "BSplineCurve": """ Approximates a curve of any type to a B-Spline curve. approximateBSpline(Tolerance, MaxSegments, MaxDegree, [Order='C2']) -> BSplineCurve @@ -395,7 +398,7 @@ class GeometryCurve(Geometry): ... @constmethod - def reversedParameter(self, U: float) -> float: + def reversedParameter(self, U: float, /) -> float: """ Returns the parameter on the reversed curve for the point of parameter U on this curve. """ diff --git a/src/Mod/Part/App/GeometryDoubleExtension.pyi b/src/Mod/Part/App/GeometryDoubleExtension.pyi index e91ba72224..af1af6688a 100644 --- a/src/Mod/Part/App/GeometryDoubleExtension.pyi +++ b/src/Mod/Part/App/GeometryDoubleExtension.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from GeometryExtension import GeometryExtension diff --git a/src/Mod/Part/App/GeometryExtension.pyi b/src/Mod/Part/App/GeometryExtension.pyi index 08c10000ee..3904ed194c 100644 --- a/src/Mod/Part/App/GeometryExtension.pyi +++ b/src/Mod/Part/App/GeometryExtension.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.PyObjectBase import PyObjectBase from typing import Final diff --git a/src/Mod/Part/App/GeometryIntExtension.pyi b/src/Mod/Part/App/GeometryIntExtension.pyi index 56c58a7aaa..18df13ea9d 100644 --- a/src/Mod/Part/App/GeometryIntExtension.pyi +++ b/src/Mod/Part/App/GeometryIntExtension.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from Part.GeometryExtension import GeometryExtension from typing import Final diff --git a/src/Mod/Part/App/GeometryStringExtension.pyi b/src/Mod/Part/App/GeometryStringExtension.pyi index d958dd5a8e..b64ab4cf8b 100644 --- a/src/Mod/Part/App/GeometryStringExtension.pyi +++ b/src/Mod/Part/App/GeometryStringExtension.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from GeometryExtension import GeometryExtension diff --git a/src/Mod/Part/App/GeometrySurface.pyi b/src/Mod/Part/App/GeometrySurface.pyi index 96404f7fb8..b64cac5fa0 100644 --- a/src/Mod/Part/App/GeometrySurface.pyi +++ b/src/Mod/Part/App/GeometrySurface.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.Rotation import Rotation as RotationPy from Base.Vector import Vector @@ -43,21 +47,21 @@ class GeometrySurface(Geometry): ... @constmethod - def getD0(self, param: float) -> Vector: + def getD0(self, param: float, /) -> Vector: """ Returns the point of given parameter """ ... @constmethod - def getDN(self, n: int) -> Any: + def getDN(self, n: int, /) -> Any: """ Returns the n-th derivative """ ... @constmethod - def value(self, u: float, v: float) -> Vector: + def value(self, u: float, v: float, /) -> Vector: """ value(u,v) -> Point Computes the point of parameter (u,v) on this surface @@ -65,7 +69,7 @@ class GeometrySurface(Geometry): ... @constmethod - def tangent(self, u: float, v: float) -> Tuple[Vector, Vector]: + def tangent(self, u: float, v: float, /) -> Tuple[Vector, Vector]: """ tangent(u,v) -> (Vector,Vector) Computes the tangent of parameter (u,v) on this geometry @@ -73,7 +77,7 @@ class GeometrySurface(Geometry): ... @constmethod - def normal(self, u: float, v: float) -> Vector: + def normal(self, u: float, v: float, /) -> Vector: """ normal(u,v) -> Vector Computes the normal of parameter (u,v) on this geometry @@ -114,7 +118,7 @@ class GeometrySurface(Geometry): ... @constmethod - def isUmbillic(self, u: float, v: float) -> bool: + def isUmbillic(self, u: float, v: float, /) -> bool: """ isUmbillic(u,v) -> bool Check if the geometry on parameter is an umbillic point, @@ -123,7 +127,7 @@ class GeometrySurface(Geometry): ... @constmethod - def curvature(self, u: float, v: float, type: str) -> float: + def curvature(self, u: float, v: float, type: str, /) -> float: """ curvature(u,v,type) -> float The value of type must be one of this: Max, Min, Mean or Gauss @@ -132,7 +136,7 @@ class GeometrySurface(Geometry): ... @constmethod - def curvatureDirections(self, u: float, v: float) -> Tuple[Vector, Vector]: + def curvatureDirections(self, u: float, v: float, /) -> Tuple[Vector, Vector]: """ curvatureDirections(u,v) -> (Vector,Vector) Computes the directions of maximum and minimum curvature @@ -150,7 +154,7 @@ class GeometrySurface(Geometry): ... @constmethod - def isPlanar(self, tolerance: float = 0.0) -> bool: + def isPlanar(self, tolerance: float = 0.0, /) -> bool: """ isPlanar([float]) -> Bool Checks if the surface is planar within a certain tolerance. @@ -158,14 +162,14 @@ class GeometrySurface(Geometry): ... @constmethod - def uIso(self, u: Tuple) -> Union[GeometryCurve, Line]: + def uIso(self, u: Tuple, /) -> Union[GeometryCurve, Line]: """ Builds the U isoparametric curve """ ... @constmethod - def vIso(self, v: Tuple) -> Union[GeometryCurve, Line]: + def vIso(self, v: Tuple, /) -> Union[GeometryCurve, Line]: """ Builds the V isoparametric curve """ @@ -266,7 +270,7 @@ class GeometrySurface(Geometry): ... @constmethod - def intersectSS(self, SecondSurface: Any, precision_code: int = 0) -> Any: + def intersectSS(self, SecondSurface: Any, precision_code: int = 0, /) -> Any: """ Returns all intersection curves of this surface and the given surface. The required arguments are: diff --git a/src/Mod/Part/App/HLRBRep/HLRBRep_Algo.pyi b/src/Mod/Part/App/HLRBRep/HLRBRep_Algo.pyi index 6e057c5471..33d5565b3f 100644 --- a/src/Mod/Part/App/HLRBRep/HLRBRep_Algo.pyi +++ b/src/Mod/Part/App/HLRBRep/HLRBRep_Algo.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod, class_declarations from Base.PyObjectBase import PyObjectBase from typing import Final @@ -62,7 +66,7 @@ class HLRBRep_Algo(PyObjectBase): Licence: LGPL """ - def add(self, S, nbIso: int = 0) -> None: + def add(self, S, nbIso: int = 0, /) -> None: """ add(S, nbIso=0) @@ -72,7 +76,7 @@ class HLRBRep_Algo(PyObjectBase): """ ... - def remove(self, i: int) -> None: + def remove(self, i: int, /) -> None: """ remove(i) @@ -80,7 +84,7 @@ class HLRBRep_Algo(PyObjectBase): """ ... - def index(self, S) -> int: + def index(self, S, /) -> int: """ index(S) -> int @@ -121,7 +125,7 @@ class HLRBRep_Algo(PyObjectBase): """ ... - def showAll(self, i: int = -1) -> None: + def showAll(self, i: int = -1, /) -> None: """ showAll(i=-1) @@ -130,7 +134,7 @@ class HLRBRep_Algo(PyObjectBase): """ ... - def hide(self, i: int = -1, j: int = -1) -> None: + def hide(self, i: int = -1, j: int = -1, /) -> None: """ hide(i=-1, j=-1) @@ -140,7 +144,7 @@ class HLRBRep_Algo(PyObjectBase): """ ... - def hideAll(self, i: int = -1) -> None: + def hideAll(self, i: int = -1, /) -> None: """ hideAll(i=-1) @@ -157,7 +161,7 @@ class HLRBRep_Algo(PyObjectBase): """ ... - def select(self, i: int = -1) -> None: + def select(self, i: int = -1, /) -> None: """ select(i=-1) @@ -166,7 +170,7 @@ class HLRBRep_Algo(PyObjectBase): """ ... - def selectEdge(self, i: int) -> None: + def selectEdge(self, i: int, /) -> None: """ selectEdge(i) @@ -174,7 +178,7 @@ class HLRBRep_Algo(PyObjectBase): """ ... - def selectFace(self, i: int) -> None: + def selectFace(self, i: int, /) -> None: """ selectFace(i) diff --git a/src/Mod/Part/App/HLRBRep/HLRBRep_PolyAlgo.pyi b/src/Mod/Part/App/HLRBRep/HLRBRep_PolyAlgo.pyi index 5d795cbb43..471bfa6ba0 100644 --- a/src/Mod/Part/App/HLRBRep/HLRBRep_PolyAlgo.pyi +++ b/src/Mod/Part/App/HLRBRep/HLRBRep_PolyAlgo.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod, class_declarations from Base.PyObjectBase import PyObjectBase from Part.TopoShapePy import TopoShape @@ -62,7 +66,7 @@ class HLRBRep_PolyAlgo(PyObjectBase): same shape. """ - def load(self, S: TopoShape) -> None: + def load(self, S: TopoShape, /) -> None: """ load(S) @@ -70,7 +74,7 @@ class HLRBRep_PolyAlgo(PyObjectBase): """ ... - def remove(self, i: int) -> None: + def remove(self, i: int, /) -> None: """ remove(i) @@ -87,7 +91,7 @@ class HLRBRep_PolyAlgo(PyObjectBase): """ ... - def shape(self, i: int) -> TopoShape: + def shape(self, i: int, /) -> TopoShape: """ shape(i) -> TopoShape @@ -95,7 +99,7 @@ class HLRBRep_PolyAlgo(PyObjectBase): """ ... - def index(self, S: TopoShape) -> int: + def index(self, S: TopoShape, /) -> int: """ index(S) -> int @@ -165,7 +169,7 @@ class HLRBRep_PolyAlgo(PyObjectBase): """ ... - def outLinedShape(self, S: TopoShape) -> TopoShape: + def outLinedShape(self, S: TopoShape, /) -> TopoShape: """ outLinedShape(S) -> TopoShape diff --git a/src/Mod/Part/App/HLRBRep/HLRToShape.pyi b/src/Mod/Part/App/HLRBRep/HLRToShape.pyi index 0367ea61c0..04e91394dc 100644 --- a/src/Mod/Part/App/HLRBRep/HLRToShape.pyi +++ b/src/Mod/Part/App/HLRBRep/HLRToShape.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Part.TopoShapePy import TopoShape from Base.PyObjectBase import PyObjectBase @@ -41,7 +45,7 @@ class HLRToShape(PyObjectBase): class. """ - def vCompound(self, Shape: Optional[TopoShape] = None) -> TopoShape: + def vCompound(self, Shape: Optional[TopoShape] = None, /) -> TopoShape: """ vCompound(Shape=None) -> TopoShape @@ -50,7 +54,7 @@ class HLRToShape(PyObjectBase): """ ... - def Rg1LineVCompound(self, Shape: Optional[TopoShape] = None) -> TopoShape: + def Rg1LineVCompound(self, Shape: Optional[TopoShape] = None, /) -> TopoShape: """ Rg1LineVCompound(Shape=None) -> TopoShape @@ -59,7 +63,7 @@ class HLRToShape(PyObjectBase): """ ... - def RgNLineVCompound(self, Shape: Optional[TopoShape] = None) -> TopoShape: + def RgNLineVCompound(self, Shape: Optional[TopoShape] = None, /) -> TopoShape: """ RgNLineVCompound(Shape=None) -> TopoShape @@ -68,7 +72,7 @@ class HLRToShape(PyObjectBase): """ ... - def outLineVCompound(self, Shape: Optional[TopoShape] = None) -> TopoShape: + def outLineVCompound(self, Shape: Optional[TopoShape] = None, /) -> TopoShape: """ outLineVCompound(Shape=None) -> TopoShape @@ -77,7 +81,7 @@ class HLRToShape(PyObjectBase): """ ... - def outLineVCompound3d(self, Shape: Optional[TopoShape] = None) -> TopoShape: + def outLineVCompound3d(self, Shape: Optional[TopoShape] = None, /) -> TopoShape: """ outLineVCompound(Shape=None) -> TopoShape @@ -86,7 +90,7 @@ class HLRToShape(PyObjectBase): """ ... - def isoLineVCompound(self, Shape: Optional[TopoShape] = None) -> TopoShape: + def isoLineVCompound(self, Shape: Optional[TopoShape] = None, /) -> TopoShape: """ isoLineVCompound(Shape=None) -> TopoShape @@ -95,7 +99,7 @@ class HLRToShape(PyObjectBase): """ ... - def hCompound(self, Shape: Optional[TopoShape] = None) -> TopoShape: + def hCompound(self, Shape: Optional[TopoShape] = None, /) -> TopoShape: """ hCompound(Shape=None) -> TopoShape @@ -104,7 +108,7 @@ class HLRToShape(PyObjectBase): """ ... - def Rg1LineHCompound(self, Shape: Optional[TopoShape] = None) -> TopoShape: + def Rg1LineHCompound(self, Shape: Optional[TopoShape] = None, /) -> TopoShape: """ Rg1LineHCompound(Shape=None) -> TopoShape @@ -113,7 +117,7 @@ class HLRToShape(PyObjectBase): """ ... - def RgNLineHCompound(self, Shape: Optional[TopoShape] = None) -> TopoShape: + def RgNLineHCompound(self, Shape: Optional[TopoShape] = None, /) -> TopoShape: """ RgNLineHCompound(Shape=None) -> TopoShape @@ -122,7 +126,7 @@ class HLRToShape(PyObjectBase): """ ... - def outLineHCompound(self, Shape: Optional[TopoShape] = None) -> TopoShape: + def outLineHCompound(self, Shape: Optional[TopoShape] = None, /) -> TopoShape: """ outLineHCompound(Shape=None) -> TopoShape @@ -131,7 +135,7 @@ class HLRToShape(PyObjectBase): """ ... - def isoLineHCompound(self, Shape: Optional[TopoShape] = None) -> TopoShape: + def isoLineHCompound(self, Shape: Optional[TopoShape] = None, /) -> TopoShape: """ isoLineHCompound(Shape=None) -> TopoShape diff --git a/src/Mod/Part/App/HLRBRep/PolyHLRToShape.pyi b/src/Mod/Part/App/HLRBRep/PolyHLRToShape.pyi index b69947f70f..a79afc5930 100644 --- a/src/Mod/Part/App/HLRBRep/PolyHLRToShape.pyi +++ b/src/Mod/Part/App/HLRBRep/PolyHLRToShape.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.PyObjectBase import PyObjectBase from Part.HLRBRep_PolyAlgo import HLRBRep_PolyAlgo @@ -40,7 +44,7 @@ class PolyHLRToShape(PyObjectBase): new computation of the algorithm, but only reads its internal results. """ - def update(self, algo: HLRBRep_PolyAlgo) -> None: + def update(self, algo: HLRBRep_PolyAlgo, /) -> None: """ update(algo: HLRBRep_PolyAlgo) """ @@ -58,7 +62,7 @@ class PolyHLRToShape(PyObjectBase): """ ... - def vCompound(self, Shape: Optional[TopoShape] = None) -> TopoShape: + def vCompound(self, Shape: Optional[TopoShape] = None, /) -> TopoShape: """ vCompound(Shape=None) -> TopoShape @@ -67,7 +71,7 @@ class PolyHLRToShape(PyObjectBase): """ ... - def Rg1LineVCompound(self, Shape: Optional[TopoShape] = None) -> TopoShape: + def Rg1LineVCompound(self, Shape: Optional[TopoShape] = None, /) -> TopoShape: """ Rg1LineVCompound(Shape=None) -> TopoShape @@ -76,7 +80,7 @@ class PolyHLRToShape(PyObjectBase): """ ... - def RgNLineVCompound(self, Shape: Optional[TopoShape] = None) -> TopoShape: + def RgNLineVCompound(self, Shape: Optional[TopoShape] = None, /) -> TopoShape: """ RgNLineVCompound(Shape=None) -> TopoShape @@ -85,7 +89,7 @@ class PolyHLRToShape(PyObjectBase): """ ... - def outLineVCompound(self, Shape: Optional[TopoShape] = None) -> TopoShape: + def outLineVCompound(self, Shape: Optional[TopoShape] = None, /) -> TopoShape: """ outLineVCompound(Shape=None) -> TopoShape @@ -94,7 +98,7 @@ class PolyHLRToShape(PyObjectBase): """ ... - def hCompound(self, Shape: Optional[TopoShape] = None) -> TopoShape: + def hCompound(self, Shape: Optional[TopoShape] = None, /) -> TopoShape: """ hCompound(Shape=None) -> TopoShape @@ -103,7 +107,7 @@ class PolyHLRToShape(PyObjectBase): """ ... - def Rg1LineHCompound(self, Shape: Optional[TopoShape] = None) -> TopoShape: + def Rg1LineHCompound(self, Shape: Optional[TopoShape] = None, /) -> TopoShape: """ Rg1LineHCompound(Shape=None) -> TopoShape @@ -112,7 +116,7 @@ class PolyHLRToShape(PyObjectBase): """ ... - def RgNLineHCompound(self, Shape: Optional[TopoShape] = None) -> TopoShape: + def RgNLineHCompound(self, Shape: Optional[TopoShape] = None, /) -> TopoShape: """ RgNLineHCompound(Shape=None) -> TopoShape @@ -121,7 +125,7 @@ class PolyHLRToShape(PyObjectBase): """ ... - def outLineHCompound(self, Shape: Optional[TopoShape] = None) -> TopoShape: + def outLineHCompound(self, Shape: Optional[TopoShape] = None, /) -> TopoShape: """ outLineHCompound(Shape=None) -> TopoShape diff --git a/src/Mod/Part/App/Hyperbola.pyi b/src/Mod/Part/App/Hyperbola.pyi index a0689db88b..15d2c0c0ba 100644 --- a/src/Mod/Part/App/Hyperbola.pyi +++ b/src/Mod/Part/App/Hyperbola.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.Vector import Vector from Conic import Conic diff --git a/src/Mod/Part/App/Line.pyi b/src/Mod/Part/App/Line.pyi index c2ec01a386..11cdb6395b 100644 --- a/src/Mod/Part/App/Line.pyi +++ b/src/Mod/Part/App/Line.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from Base.Vector import Vector from GeometryCurve import GeometryCurve diff --git a/src/Mod/Part/App/LineSegment.pyi b/src/Mod/Part/App/LineSegment.pyi index 581d7ab8d5..a977096da6 100644 --- a/src/Mod/Part/App/LineSegment.pyi +++ b/src/Mod/Part/App/LineSegment.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from Base.Type import Type from TrimmedCurve import TrimmedCurve diff --git a/src/Mod/Part/App/OffsetCurve.pyi b/src/Mod/Part/App/OffsetCurve.pyi index 4c50a5343b..c8c6d41ee8 100644 --- a/src/Mod/Part/App/OffsetCurve.pyi +++ b/src/Mod/Part/App/OffsetCurve.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from Base.Vector import Vector from GeometryCurve import GeometryCurve diff --git a/src/Mod/Part/App/OffsetSurface.pyi b/src/Mod/Part/App/OffsetSurface.pyi index 8266243613..23a145e35b 100644 --- a/src/Mod/Part/App/OffsetSurface.pyi +++ b/src/Mod/Part/App/OffsetSurface.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from GeometrySurface import GeometrySurface diff --git a/src/Mod/Part/App/Parabola.pyi b/src/Mod/Part/App/Parabola.pyi index 096b42c475..741cc42407 100644 --- a/src/Mod/Part/App/Parabola.pyi +++ b/src/Mod/Part/App/Parabola.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.Vector import Vector from Conic import Conic @@ -35,7 +39,7 @@ class Parabola(Conic): and its directrix. This distance is twice the focal length. """ - def compute(self, p1: Vector, p2: Vector, p3: Vector) -> None: + def compute(self, p1: Vector, p2: Vector, p3: Vector, /) -> None: """ compute(p1,p2,p3) -> None diff --git a/src/Mod/Part/App/Part2DObject.pyi b/src/Mod/Part/App/Part2DObject.pyi index 189a9c95b5..3f7a62668e 100644 --- a/src/Mod/Part/App/Part2DObject.pyi +++ b/src/Mod/Part/App/Part2DObject.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from PartFeature import PartFeature diff --git a/src/Mod/Part/App/PartFeature.pyi b/src/Mod/Part/App/PartFeature.pyi index 98f3722106..e2d9769cc9 100644 --- a/src/Mod/Part/App/PartFeature.pyi +++ b/src/Mod/Part/App/PartFeature.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from App.GeoFeature import GeoFeature from App.DocumentObject import DocumentObject diff --git a/src/Mod/Part/App/Plane.pyi b/src/Mod/Part/App/Plane.pyi index 5b408d3111..043b51023f 100644 --- a/src/Mod/Part/App/Plane.pyi +++ b/src/Mod/Part/App/Plane.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from GeometrySurface import GeometrySurface diff --git a/src/Mod/Part/App/PlateSurface.pyi b/src/Mod/Part/App/PlateSurface.pyi index fecbd9252e..f801c976fd 100644 --- a/src/Mod/Part/App/PlateSurface.pyi +++ b/src/Mod/Part/App/PlateSurface.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from GeometrySurface import GeometrySurface diff --git a/src/Mod/Part/App/Point.pyi b/src/Mod/Part/App/Point.pyi index f989df2b49..3be16f85f5 100644 --- a/src/Mod/Part/App/Point.pyi +++ b/src/Mod/Part/App/Point.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.Vector import Vector from Geometry import Geometry diff --git a/src/Mod/Part/App/RectangularTrimmedSurface.pyi b/src/Mod/Part/App/RectangularTrimmedSurface.pyi index 1cbe0fae18..f1b5de1ddc 100644 --- a/src/Mod/Part/App/RectangularTrimmedSurface.pyi +++ b/src/Mod/Part/App/RectangularTrimmedSurface.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from GeometrySurface import GeometrySurface from typing import Any, Final, Tuple @@ -31,7 +35,7 @@ class RectangularTrimmedSurface(GeometrySurface): BasisSurface: Final[Any] = None """Represents the basis surface from which the trimmed surface is derived.""" - def setTrim(self, params: Tuple[float, float, float, float]) -> None: + def setTrim(self, params: Tuple[float, float, float, float], /) -> None: """ setTrim(self, params: (u1, u2, v1, v2)) -> None diff --git a/src/Mod/Part/App/ShapeFix/ShapeFix_Edge.pyi b/src/Mod/Part/App/ShapeFix/ShapeFix_Edge.pyi index 0cc7246f96..dacefa6c53 100644 --- a/src/Mod/Part/App/ShapeFix/ShapeFix_Edge.pyi +++ b/src/Mod/Part/App/ShapeFix/ShapeFix_Edge.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod, class_declarations from Base.PyObjectBase import PyObjectBase from typing import Final diff --git a/src/Mod/Part/App/ShapeFix/ShapeFix_EdgeConnect.pyi b/src/Mod/Part/App/ShapeFix/ShapeFix_EdgeConnect.pyi index 0a4f3d2749..267717aba7 100644 --- a/src/Mod/Part/App/ShapeFix/ShapeFix_EdgeConnect.pyi +++ b/src/Mod/Part/App/ShapeFix/ShapeFix_EdgeConnect.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.PyObjectBase import PyObjectBase from Part.App.TopoShapeEdge import TopoShapeEdge @@ -19,9 +23,11 @@ class ShapeFix_EdgeConnect(PyObjectBase): """ @overload - def add(self, edge1: TopoShapeEdge, edge2: TopoShapeEdge) -> None: ... + def add(self, edge1: TopoShapeEdge, edge2: TopoShapeEdge, /) -> None: ... + @overload - def add(self, shape: TopoShape) -> None: ... + def add(self, shape: TopoShape, /) -> None: ... + def add(self, *args, **kwargs) -> None: """ add(edge, edge) diff --git a/src/Mod/Part/App/ShapeFix/ShapeFix_Face.pyi b/src/Mod/Part/App/ShapeFix/ShapeFix_Face.pyi index eae87dc7e8..8b13d3fa16 100644 --- a/src/Mod/Part/App/ShapeFix/ShapeFix_Face.pyi +++ b/src/Mod/Part/App/ShapeFix/ShapeFix_Face.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Part.ShapeFix_Root import ShapeFix_Root from Part.TopoShapeFace import TopoShapeFace diff --git a/src/Mod/Part/App/ShapeFix/ShapeFix_FaceConnect.pyi b/src/Mod/Part/App/ShapeFix/ShapeFix_FaceConnect.pyi index 6819755e03..574bf56a28 100644 --- a/src/Mod/Part/App/ShapeFix/ShapeFix_FaceConnect.pyi +++ b/src/Mod/Part/App/ShapeFix/ShapeFix_FaceConnect.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.PyObjectBase import PyObjectBase @@ -15,13 +19,13 @@ class ShapeFix_FaceConnect(PyObjectBase): Licence: LGPL """ - def add(self, face) -> None: + def add(self, face, /) -> None: """ add(face, face) """ ... - def build(self, shell, sewtolerance, fixtolerance) -> None: + def build(self, shell, sewtolerance, fixtolerance, /) -> None: """ build(shell, sewtolerance, fixtolerance) """ diff --git a/src/Mod/Part/App/ShapeFix/ShapeFix_FixSmallFace.pyi b/src/Mod/Part/App/ShapeFix/ShapeFix_FixSmallFace.pyi index 8a5b45a32d..d2e4873263 100644 --- a/src/Mod/Part/App/ShapeFix/ShapeFix_FixSmallFace.pyi +++ b/src/Mod/Part/App/ShapeFix/ShapeFix_FixSmallFace.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from Part.App.ShapeFix.ShapeFix_Root import ShapeFix_Root from Part.App.TopoShape import TopoShape diff --git a/src/Mod/Part/App/ShapeFix/ShapeFix_FixSmallSolid.pyi b/src/Mod/Part/App/ShapeFix/ShapeFix_FixSmallSolid.pyi index a9baae65f6..1efcd01bd6 100644 --- a/src/Mod/Part/App/ShapeFix/ShapeFix_FixSmallSolid.pyi +++ b/src/Mod/Part/App/ShapeFix/ShapeFix_FixSmallSolid.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from Part.App.ShapeFix.ShapeFix_Root import ShapeFix_Root from typing import overload @@ -16,7 +20,7 @@ class ShapeFix_FixSmallSolid(ShapeFix_Root): Licence: LGPL """ - def setFixMode(self, theMode: int) -> None: + def setFixMode(self, theMode: int, /) -> None: """ Set working mode for operator: - theMode = 0 use both WidthFactorThreshold and VolumeThreshold parameters diff --git a/src/Mod/Part/App/ShapeFix/ShapeFix_FreeBounds.pyi b/src/Mod/Part/App/ShapeFix/ShapeFix_FreeBounds.pyi index f367b4a28b..a314490f7e 100644 --- a/src/Mod/Part/App/ShapeFix/ShapeFix_FreeBounds.pyi +++ b/src/Mod/Part/App/ShapeFix/ShapeFix_FreeBounds.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.PyObjectBase import PyObjectBase from Part.App.TopoShapeCompound import TopoShapeCompound diff --git a/src/Mod/Part/App/ShapeFix/ShapeFix_Root.pyi b/src/Mod/Part/App/ShapeFix/ShapeFix_Root.pyi index e5c67a64ea..e9b429c842 100644 --- a/src/Mod/Part/App/ShapeFix/ShapeFix_Root.pyi +++ b/src/Mod/Part/App/ShapeFix/ShapeFix_Root.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.PyObjectBase import PyObjectBase from typing import Final, overload diff --git a/src/Mod/Part/App/ShapeFix/ShapeFix_Shape.pyi b/src/Mod/Part/App/ShapeFix/ShapeFix_Shape.pyi index 1940aae036..c80c8f7007 100644 --- a/src/Mod/Part/App/ShapeFix/ShapeFix_Shape.pyi +++ b/src/Mod/Part/App/ShapeFix/ShapeFix_Shape.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Part.App.ShapeFix.ShapeFix_Root import ShapeFix_Root from Part.TopoShape import TopoShape diff --git a/src/Mod/Part/App/ShapeFix/ShapeFix_ShapeTolerance.pyi b/src/Mod/Part/App/ShapeFix/ShapeFix_ShapeTolerance.pyi index 862aacee9b..fdb86bf638 100644 --- a/src/Mod/Part/App/ShapeFix/ShapeFix_ShapeTolerance.pyi +++ b/src/Mod/Part/App/ShapeFix/ShapeFix_ShapeTolerance.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.PyObjectBase import PyObjectBase from Part.App.TopoShape import TopoShape @@ -18,24 +22,24 @@ class ShapeFix_ShapeTolerance(PyObjectBase): """ @overload - def limitTolerance(self, shape: TopoShape, tmin: float) -> None: ... + def limitTolerance(self, shape: TopoShape, tmin: float, /) -> None: ... + @overload - def limitTolerance( - self, shape: TopoShape, tmin: float, tmax: float, ShapeEnum: str = None - ) -> None: ... - def limitTolerance( - self, shape: TopoShape, tmin: float, tmax: float = 0, ShapeEnum: str = None - ) -> None: + def limitTolerance(self, shape: TopoShape, tmin: float, tmax: float, ShapeEnum: str = None, /) -> None: ... + + def limitTolerance(self, shape: TopoShape, tmin: float, tmax: float = 0, ShapeEnum: str = None, /) -> None: """ limitTolerance(shape, tmin, [tmax=0, ShapeEnum=SHAPE]) """ ... @overload - def setTolerance(self, shape: TopoShape, precision: float) -> None: ... + def setTolerance(self, shape: TopoShape, precision: float, /) -> None: ... + @overload - def setTolerance(self, shape: TopoShape, precision: float, ShapeEnum: str = None) -> None: ... - def setTolerance(self, shape: TopoShape, precision: float, ShapeEnum: str = None) -> None: + def setTolerance(self, shape: TopoShape, precision: float, ShapeEnum: str = None, /) -> None: ... + + def setTolerance(self, shape: TopoShape, precision: float, ShapeEnum: str = None, /) -> None: """ setTolerance(shape, precision, [ShapeEnum=SHAPE]) """ diff --git a/src/Mod/Part/App/ShapeFix/ShapeFix_Shell.pyi b/src/Mod/Part/App/ShapeFix/ShapeFix_Shell.pyi index 04160e2675..fd44d06384 100644 --- a/src/Mod/Part/App/ShapeFix/ShapeFix_Shell.pyi +++ b/src/Mod/Part/App/ShapeFix/ShapeFix_Shell.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Metadata import export, constmethod from Part.App.ShapeFix.ShapeFix_Root import ShapeFix_Root from typing import Final, overload diff --git a/src/Mod/Part/App/ShapeFix/ShapeFix_Solid.pyi b/src/Mod/Part/App/ShapeFix/ShapeFix_Solid.pyi index 2a468d75a9..371f015fa7 100644 --- a/src/Mod/Part/App/ShapeFix/ShapeFix_Solid.pyi +++ b/src/Mod/Part/App/ShapeFix/ShapeFix_Solid.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from Part.App.ShapeFix.ShapeFix_Root import ShapeFix_Root from typing import Final diff --git a/src/Mod/Part/App/ShapeFix/ShapeFix_SplitCommonVertex.pyi b/src/Mod/Part/App/ShapeFix/ShapeFix_SplitCommonVertex.pyi index b0d1d10624..478a53d208 100644 --- a/src/Mod/Part/App/ShapeFix/ShapeFix_SplitCommonVertex.pyi +++ b/src/Mod/Part/App/ShapeFix/ShapeFix_SplitCommonVertex.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from Part.App.ShapeFix.ShapeFix_Root import ShapeFix_Root from typing import overload diff --git a/src/Mod/Part/App/ShapeFix/ShapeFix_SplitTool.pyi b/src/Mod/Part/App/ShapeFix/ShapeFix_SplitTool.pyi index 6f2d9e6ba7..573e9d49ff 100644 --- a/src/Mod/Part/App/ShapeFix/ShapeFix_SplitTool.pyi +++ b/src/Mod/Part/App/ShapeFix/ShapeFix_SplitTool.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.PyObjectBase import PyObjectBase from typing import overload diff --git a/src/Mod/Part/App/ShapeFix/ShapeFix_Wire.pyi b/src/Mod/Part/App/ShapeFix/ShapeFix_Wire.pyi index 90cede9115..044104870d 100644 --- a/src/Mod/Part/App/ShapeFix/ShapeFix_Wire.pyi +++ b/src/Mod/Part/App/ShapeFix/ShapeFix_Wire.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Part.App.ShapeFix.ShapeFix_Root import ShapeFix_Root from typing import Final @@ -54,7 +58,7 @@ class ShapeFix_Wire(ShapeFix_Root): """ pass - def setSurface(self, surface: object, Placement: object = ...) -> None: + def setSurface(self, surface: object, Placement: object = ..., /) -> None: """ setSurface(surface, [Placement]) Set surface for the wire @@ -127,7 +131,7 @@ class ShapeFix_Wire(ShapeFix_Root): """ pass - def fixConnected(self, num: int) -> None: + def fixConnected(self, num: int, /) -> None: """ Applies fixConnected(num) to all edges in the wire Connection between first and last edges is treated only if @@ -176,13 +180,13 @@ class ShapeFix_Wire(ShapeFix_Root): """ pass - def fixGaps3d(self, num: int) -> None: + def fixGaps3d(self, num: int, /) -> None: """ Fixes gaps between ends of 3d curves on adjacent edges """ pass - def fixGaps2d(self, num: int) -> None: + def fixGaps2d(self, num: int, /) -> None: """ Fixes gaps between ends of pcurves on adjacent edges """ @@ -207,13 +211,13 @@ class ShapeFix_Wire(ShapeFix_Root): """ pass - def fixGap3d(self, num: int) -> None: + def fixGap3d(self, num: int, /) -> None: """ Fixes gap between ends of 3d curves on num-1 and num-th edges """ pass - def fixGap2d(self, num: int) -> None: + def fixGap2d(self, num: int, /) -> None: """ Fixes gap between ends of pcurves on num-1 and num-th edges """ diff --git a/src/Mod/Part/App/ShapeFix/ShapeFix_WireVertex.pyi b/src/Mod/Part/App/ShapeFix/ShapeFix_WireVertex.pyi index c213988ed5..0b1eaebb19 100644 --- a/src/Mod/Part/App/ShapeFix/ShapeFix_WireVertex.pyi +++ b/src/Mod/Part/App/ShapeFix/ShapeFix_WireVertex.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.PyObjectBase import PyObjectBase diff --git a/src/Mod/Part/App/ShapeFix/ShapeFix_Wireframe.pyi b/src/Mod/Part/App/ShapeFix/ShapeFix_Wireframe.pyi index c6383e7c47..77287d8ce4 100644 --- a/src/Mod/Part/App/ShapeFix/ShapeFix_Wireframe.pyi +++ b/src/Mod/Part/App/ShapeFix/ShapeFix_Wireframe.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Part.App.ShapeFix.ShapeFix_Root import ShapeFix_Root from typing import Final diff --git a/src/Mod/Part/App/ShapeUpgrade/UnifySameDomain.pyi b/src/Mod/Part/App/ShapeUpgrade/UnifySameDomain.pyi index 50b9850eb2..e6c7ddc7bc 100644 --- a/src/Mod/Part/App/ShapeUpgrade/UnifySameDomain.pyi +++ b/src/Mod/Part/App/ShapeUpgrade/UnifySameDomain.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.PyObjectBase import PyObjectBase from typing import overload diff --git a/src/Mod/Part/App/Sphere.pyi b/src/Mod/Part/App/Sphere.pyi index 93df75794f..67d6c5257a 100644 --- a/src/Mod/Part/App/Sphere.pyi +++ b/src/Mod/Part/App/Sphere.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.BaseClass import BaseClass from Base.Vector import Vector diff --git a/src/Mod/Part/App/SurfaceOfExtrusion.pyi b/src/Mod/Part/App/SurfaceOfExtrusion.pyi index 7409c77dcb..4590904807 100644 --- a/src/Mod/Part/App/SurfaceOfExtrusion.pyi +++ b/src/Mod/Part/App/SurfaceOfExtrusion.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from GeometrySurface import GeometrySurface from GeometryCurve import GeometryCurve diff --git a/src/Mod/Part/App/SurfaceOfRevolution.pyi b/src/Mod/Part/App/SurfaceOfRevolution.pyi index 52dcf70deb..9295628f01 100644 --- a/src/Mod/Part/App/SurfaceOfRevolution.pyi +++ b/src/Mod/Part/App/SurfaceOfRevolution.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from Base.Placement import Placement from Base.Vector import Vector diff --git a/src/Mod/Part/App/TopoShape.pyi b/src/Mod/Part/App/TopoShape.pyi index 849018519f..6978bd6894 100644 --- a/src/Mod/Part/App/TopoShape.pyi +++ b/src/Mod/Part/App/TopoShape.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.Vector import Vector from Base.Matrix import Matrix @@ -70,13 +74,13 @@ class TopoShape(ComplexGeoData): """ ... - def loads(self, brep_str: str) -> None: + def loads(self, brep_str: str, /) -> None: """ Deserialize the content of this shape from a string in BREP format. """ ... - def read(self, filename: str) -> None: + def read(self, filename: str, /) -> None: """ Read in an IGES, STEP or BREP file. read(filename) @@ -94,7 +98,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def exportIges(self, filename: str) -> None: + def exportIges(self, filename: str, /) -> None: """ Export the content of this shape to an IGES file. exportIges(filename) @@ -102,7 +106,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def exportStep(self, filename: str) -> None: + def exportStep(self, filename: str, /) -> None: """ Export the content of this shape to an STEP file. exportStep(filename) @@ -110,7 +114,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def exportBrep(self, filename: str) -> None: + def exportBrep(self, filename: str, /) -> None: """ Export the content of this shape to an BREP file. exportBrep(filename) @@ -120,7 +124,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def exportBinary(self, filename: str) -> None: + def exportBinary(self, filename: str, /) -> None: """ Export the content of this shape in binary format to a file. exportBinary(filename) @@ -146,28 +150,28 @@ class TopoShape(ComplexGeoData): ... @constmethod - def exportStl(self, filename: str) -> None: + def exportStl(self, filename: str, /) -> None: """ Export the content of this shape to an STL mesh file. exportStl(filename) """ ... - def importBrep(self, filename: str) -> None: + def importBrep(self, filename: str, /) -> None: """ Load the shape from a file in BREP format. importBrep(filename) """ ... - def importBinary(self, filename: str) -> None: + def importBinary(self, filename: str, /) -> None: """ Import the content to this shape of a string in BREP format. importBinary(filename) """ ... - def importBrepFromString(self, s: str, displayProgressBar: bool = True) -> None: + def importBrepFromString(self, s: str, displayProgressBar: bool = True, /) -> None: """ Load the shape from a string that keeps the content in BREP format. importBrepFromString(string, [displayProgressBar=True]) @@ -177,7 +181,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def extrude(self, vector: Vector) -> TopoShape: + def extrude(self, vector: Vector, /) -> TopoShape: """ Extrude the shape along a vector. extrude(vector) -> Shape @@ -187,7 +191,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def revolve(self, base: Vector, direction: Vector, angle: float) -> TopoShape: + def revolve(self, base: Vector, direction: Vector, angle: float, /) -> TopoShape: """ Revolve the shape around an Axis to a given degree. revolve(base, direction, angle) @@ -229,7 +233,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def check(self, runBopCheck: bool = False) -> bool: + def check(self, runBopCheck: bool = False, /) -> bool: """ Checks the shape and report errors in the shape structure. check([runBopCheck = False]) @@ -240,7 +244,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def fuse(self, tools: Tuple[TopoShape, ...], tolerance: float = 0.0) -> TopoShape: + def fuse(self, tools: Tuple[TopoShape, ...], tolerance: float = 0.0, /) -> TopoShape: """ Union of this and a given (list of) topo shape. fuse(tool) -> Shape @@ -259,7 +263,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def multiFuse(self, tools: Tuple[TopoShape, ...], tolerance: float = 0.0) -> TopoShape: + def multiFuse(self, tools: Tuple[TopoShape, ...], tolerance: float = 0.0, /) -> TopoShape: """ Union of this and a given list of topo shapes. multiFuse((tool1,tool2,...),[tolerance=0.0]) -> Shape @@ -275,7 +279,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def common(self, tools: Tuple[TopoShape, ...], tolerance: float = 0.0) -> TopoShape: + def common(self, tools: Tuple[TopoShape, ...], tolerance: float = 0.0, /) -> TopoShape: """ Intersection of this and a given (list of) topo shape. common(tool) -> Shape @@ -292,9 +296,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def section( - self, tool: Tuple[TopoShape, ...], tolerance: float = 0.0, approximation: bool = False - ) -> TopoShape: + def section(self, tool: Tuple[TopoShape, ...], tolerance: float = 0.0, approximation: bool = False, /) -> TopoShape: """ Section of this with a given (list of) topo shape. section(tool,[approximation=False]) -> Shape @@ -313,7 +315,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def slices(self, direction: Vector, distancesList: List[float]) -> List: + def slices(self, direction: Vector, distancesList: List[float], /) -> List: """ Make slices of this shape. slices(direction, distancesList) --> Wires @@ -321,7 +323,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def slice(self, direction: Vector, distance: float) -> List: + def slice(self, direction: Vector, distance: float, /) -> List: """ Make single slice of this shape. slice(direction, distance) --> Wires @@ -329,7 +331,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def cut(self, tool: Tuple[TopoShape, ...], tolerance: float = 0.0) -> TopoShape: + def cut(self, tool: Tuple[TopoShape, ...], tolerance: float = 0.0, /) -> TopoShape: """ Difference of this and a given (list of) topo shape cut(tool) -> Shape @@ -346,9 +348,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def generalFuse( - self, shapes: Tuple[TopoShape, ...], fuzzy_value: float = 0.0 - ) -> Tuple[TopoShape, List[List[TopoShape]]]: + def generalFuse(self, shapes: Tuple[TopoShape, ...], fuzzy_value: float = 0.0, /) -> Tuple[TopoShape, List[List[TopoShape]]]: """ Run general fuse algorithm (GFA) between this and given shapes. generalFuse(list_of_other_shapes, [fuzzy_value = 0.0]) -> (result, map) @@ -386,7 +386,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def childShapes(self, cumOri: bool = True, cumLoc: bool = True) -> List: + def childShapes(self, cumOri: bool = True, cumLoc: bool = True, /) -> List: """ Return a list of sub-shapes that are direct children of this shape. childShapes([cumOri=True, cumLoc=True]) -> list @@ -400,14 +400,14 @@ class TopoShape(ComplexGeoData): ... @constmethod - def ancestorsOfType(self, shape: TopoShape, shape_type: str) -> List: + def ancestorsOfType(self, shape: TopoShape, shape_type: str, /) -> List: """ For a sub-shape of this shape get its ancestors of a type. ancestorsOfType(shape, shape type) -> list """ ... - def removeInternalWires(self, minimalArea: float) -> bool: + def removeInternalWires(self, minimalArea: float, /) -> bool: """ Removes internal wires (also holes) from the shape. removeInternalWires(minimalArea) -> bool @@ -415,7 +415,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def mirror(self, base: Vector, norm: Vector) -> TopoShape: + def mirror(self, base: Vector, norm: Vector, /) -> TopoShape: """ Mirror this shape on a given plane. mirror(base, norm) -> Shape @@ -425,7 +425,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def transformGeometry(self, matrix: Matrix) -> TopoShape: + def transformGeometry(self, matrix: Matrix, /) -> TopoShape: """ Apply geometric transformation on this or a copy the shape. transformGeometry(matrix) -> Shape @@ -449,7 +449,7 @@ class TopoShape(ComplexGeoData): """ ... - def transformShape(self, matrix: Matrix, copy: bool = False, checkScale: bool = False) -> None: + def transformShape(self, matrix: Matrix, copy: bool = False, checkScale: bool = False, /) -> None: """ Apply transformation on a shape without changing the underlying geometry. transformShape(Matrix, [boolean copy=False, checkScale=False]) -> None @@ -469,7 +469,7 @@ class TopoShape(ComplexGeoData): """ ... - def translate(self, vector: Vector) -> None: + def translate(self, vector: Vector, /) -> None: """ Apply the translation to the current location of this shape. translate(vector) @@ -477,14 +477,14 @@ class TopoShape(ComplexGeoData): ... @constmethod - def translated(self, vector: Vector) -> TopoShape: + def translated(self, vector: Vector, /) -> TopoShape: """ Create a new shape with translation translated(vector) -> shape """ ... - def rotate(self, base: Vector, dir: Vector, degree: float) -> None: + def rotate(self, base: Vector, dir: Vector, degree: float, /) -> None: """ Apply the rotation (base, dir, degree) to the current location of this shape rotate(base, dir, degree) @@ -494,14 +494,14 @@ class TopoShape(ComplexGeoData): ... @constmethod - def rotated(self, base: Vector, dir: Vector, degree: float) -> TopoShape: + def rotated(self, base: Vector, dir: Vector, degree: float, /) -> TopoShape: """ Create a new shape with rotation. rotated(base, dir, degree) -> shape """ ... - def scale(self, factor: float, base: Vector = None) -> None: + def scale(self, factor: float, base: Vector = None, /) -> None: """ Apply scaling with point and factor to this shape. scale(factor, [base=App.Vector(0,0,0)]) @@ -509,7 +509,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def scaled(self, factor: float, base: Vector = None) -> TopoShape: + def scaled(self, factor: float, base: Vector = None, /) -> TopoShape: """ Create a new shape with scale. scaled(factor, [base=App.Vector(0,0,0)]) -> shape @@ -528,10 +528,12 @@ class TopoShape(ComplexGeoData): @overload @constmethod - def makeFillet(self, radius: float, edgeList: List) -> TopoShape: ... + def makeFillet(self, radius: float, edgeList: List, /) -> TopoShape: ... + @overload @constmethod - def makeFillet(self, radius1: float, radius2: float, edgeList: List) -> TopoShape: ... + def makeFillet(self, radius1: float, radius2: float, edgeList: List, /) -> TopoShape: ... + @constmethod def makeChamfer(self, *args) -> TopoShape: """ @@ -544,12 +546,14 @@ class TopoShape(ComplexGeoData): @overload @constmethod - def makeChamfer(self, radius: float, edgeList: List) -> TopoShape: ... + def makeChamfer(self, radius: float, edgeList: List, /) -> TopoShape: ... + @overload @constmethod - def makeChamfer(self, radius1: float, radius2: float, edgeList: List) -> TopoShape: ... + def makeChamfer(self, radius1: float, radius2: float, edgeList: List, /) -> TopoShape: ... + @constmethod - def makeThickness(self, faces: List, offset: float, tolerance: float) -> TopoShape: + def makeThickness(self, faces: List, offset: float, tolerance: float, /) -> TopoShape: """ Hollow a solid according to given thickness and faces. makeThickness(List of faces, Offset (Float), Tolerance (Float)) -> Shape @@ -653,7 +657,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def makeWires(self, op: str = None) -> TopoShape: + def makeWires(self, op: str = None, /) -> TopoShape: """ Make wire(s) using the edges of this shape makeWires([op=None]) @@ -715,7 +719,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def isPartner(self, shape: TopoShape) -> bool: + def isPartner(self, shape: TopoShape, /) -> bool: """ Checks if both shapes share the same geometry. Placement and orientation may differ. @@ -724,7 +728,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def isSame(self, shape: TopoShape) -> bool: + def isSame(self, shape: TopoShape, /) -> bool: """ Checks if both shapes share the same geometry and placement. Orientation may differ. @@ -733,7 +737,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def isEqual(self, shape: TopoShape) -> bool: + def isEqual(self, shape: TopoShape, /) -> bool: """ Checks if both shapes are equal. This means geometry, placement and orientation are equal. @@ -758,7 +762,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def isCoplanar(self, shape: TopoShape, tol: float = None) -> bool: + def isCoplanar(self, shape: TopoShape, tol: float = None, /) -> bool: """ Checks if this shape is coplanar with the given shape. isCoplanar(shape,tol=None) -> bool @@ -774,16 +778,14 @@ class TopoShape(ComplexGeoData): ... @constmethod - def findPlane(self, tol: float = None) -> TopoShape: + def findPlane(self, tol: float = None, /) -> TopoShape: """ Returns a plane if the shape is planar findPlane(tol=None) -> Shape """ ... - def fix( - self, working_precision: float, minimum_precision: float, maximum_precision: float - ) -> bool: + def fix(self, working_precision: float, minimum_precision: float, maximum_precision: float, /) -> bool: """ Tries to fix a broken shape. fix(working precision, minimum precision, maximum precision) -> bool @@ -811,7 +813,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def project(self, shapeList: List[TopoShape]) -> TopoShape: + def project(self, shapeList: List[TopoShape], /) -> TopoShape: """ Project a list of shapes on this shape project(shapeList) -> Shape @@ -819,7 +821,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def makeParallelProjection(self, shape: TopoShape, dir: Vector) -> TopoShape: + def makeParallelProjection(self, shape: TopoShape, dir: Vector, /) -> TopoShape: """ Parallel projection of an edge or wire on this shape makeParallelProjection(shape, dir) -> Shape @@ -827,7 +829,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def makePerspectiveProjection(self, shape: TopoShape, pnt: Vector) -> TopoShape: + def makePerspectiveProjection(self, shape: TopoShape, pnt: Vector, /) -> TopoShape: """ Perspective projection of an edge or wire on this shape makePerspectiveProjection(shape, pnt) -> Shape @@ -864,7 +866,7 @@ class TopoShape(ComplexGeoData): """ ... - def makeShapeFromMesh(self, mesh: Tuple[List[Vector], List], tolerance: float) -> TopoShape: + def makeShapeFromMesh(self, mesh: Tuple[List[Vector], List], tolerance: float, /) -> TopoShape: """ Make a compound shape out of mesh data. makeShapeFromMesh((vertex,facets),tolerance) -> Shape @@ -886,7 +888,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def copy(self, copyGeom: bool = True, copyMesh: bool = False) -> TopoShape: + def copy(self, copyGeom: bool = True, copyMesh: bool = False, /) -> TopoShape: """ Create a copy of this shape copy(copyGeom=True, copyMesh=False) -> Shape @@ -911,7 +913,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def replaceShape(self, tupleList: List[Tuple[TopoShape, TopoShape]]) -> TopoShape: + def replaceShape(self, tupleList: List[Tuple[TopoShape, TopoShape]], /) -> TopoShape: """ Replace a sub-shape with a new shape and return a new shape. replaceShape(tupleList) -> Shape @@ -921,7 +923,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def removeShape(self, shapeList: List[TopoShape]) -> TopoShape: + def removeShape(self, shapeList: List[TopoShape], /) -> TopoShape: """ Remove a sub-shape and return a new shape. removeShape(shapeList) -> Shape @@ -931,7 +933,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def defeaturing(self, shapeList: List[TopoShape]) -> TopoShape: + def defeaturing(self, shapeList: List[TopoShape], /) -> TopoShape: """ Remove a feature defined by supplied faces and return a new shape. defeaturing(shapeList) -> Shape @@ -941,7 +943,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def isInside(self, point: Vector, tolerance: float, checkFace: bool) -> bool: + def isInside(self, point: Vector, tolerance: float, checkFace: bool, /) -> bool: """ Checks whether a point is inside or outside the shape. isInside(point, tolerance, checkFace) => Boolean @@ -959,7 +961,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def proximity(self, shape: TopoShape, tolerance: float = None) -> Tuple[List[int], List[int]]: + def proximity(self, shape: TopoShape, tolerance: float = None, /) -> Tuple[List[int], List[int]]: """ Returns two lists of Face indexes for the Faces involved in the intersection. proximity(shape,[tolerance]) -> (selfFaces, shapeFaces) @@ -967,9 +969,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def distToShape( - self, shape: TopoShape, tol: float = 1e-7 - ) -> Tuple[float, List[Tuple[Vector, Vector]], List[Tuple]]: + def distToShape(self, shape: TopoShape, tol: float = 1e-7, /) -> Tuple[float, List[Tuple[Vector, Vector]], List[Tuple]]: """ Find the minimum distance to another shape. distToShape(shape, tol=1e-7) -> (dist, vectors, infos) @@ -996,7 +996,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def getElement(self, elementName: str, silent: bool = False) -> TopoShape: + def getElement(self, elementName: str, silent: bool = False, /) -> TopoShape: """ Returns a SubElement getElement(elementName, [silent = False]) -> Face | Edge | Vertex @@ -1007,14 +1007,14 @@ class TopoShape(ComplexGeoData): ... @constmethod - def countElement(self, type: str) -> int: + def countElement(self, type: str, /) -> int: """ Returns the count of a type of element countElement(type) -> int """ ... - def mapSubElement(self, shape: Union[TopoShape, Tuple[TopoShape, ...]], op: str = "") -> None: + def mapSubElement(self, shape: Union[TopoShape, Tuple[TopoShape, ...]], op: str = "", /) -> None: """ mapSubElement(shape|[shape...], op='') - maps the sub element of other shape @@ -1023,12 +1023,7 @@ class TopoShape(ComplexGeoData): """ ... - def mapShapes( - self, - generated: List[Tuple[TopoShape, TopoShape]], - modified: List[Tuple[TopoShape, TopoShape]], - op: str = "", - ) -> None: + def mapShapes(self, generated: List[Tuple[TopoShape, TopoShape]], modified: List[Tuple[TopoShape, TopoShape]], op: str = "", /) -> None: """ mapShapes(generated, modified, op='') @@ -1045,7 +1040,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def getElementHistory(self, name: str) -> Union[Tuple[str, str, List[str]], None]: + def getElementHistory(self, name: str, /) -> Union[Tuple[str, str, List[str]], None]: """ getElementHistory(name) - returns the element mapped name history @@ -1057,7 +1052,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def getTolerance(self, mode: int, ShapeType: str = "Shape") -> float: + def getTolerance(self, mode: int, ShapeType: str = "Shape", /) -> float: """ Determines a tolerance from the ones stored in a shape getTolerance(mode, ShapeType=Shape) -> float @@ -1076,7 +1071,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def overTolerance(self, value: float, ShapeType: str = "Shape") -> List[TopoShape]: + def overTolerance(self, value: float, ShapeType: str = "Shape", /) -> List[TopoShape]: """ Determines which shapes have a tolerance over the given value overTolerance(value, [ShapeType=Shape]) -> ShapeList @@ -1086,9 +1081,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def inTolerance( - self, valmin: float, valmax: float, ShapeType: str = "Shape" - ) -> List[TopoShape]: + def inTolerance(self, valmin: float, valmax: float, ShapeType: str = "Shape", /) -> List[TopoShape]: """ Determines which shapes have a tolerance within a given interval inTolerance(valmin, valmax, [ShapeType=Shape]) -> ShapeList @@ -1098,7 +1091,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def globalTolerance(self, mode: int) -> float: + def globalTolerance(self, mode: int, /) -> float: """ Returns the computed tolerance according to the mode globalTolerance(mode) -> float @@ -1110,7 +1103,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def fixTolerance(self, value: float, ShapeType: str = "Shape") -> None: + def fixTolerance(self, value: float, ShapeType: str = "Shape", /) -> None: """ Sets (enforces) tolerances in a shape to the given value fixTolerance(value, [ShapeType=Shape]) @@ -1124,7 +1117,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def limitTolerance(self, tmin: float, tmax: float = 0, ShapeType: str = "Shape") -> bool: + def limitTolerance(self, tmin: float, tmax: float = 0, ShapeType: str = "Shape", /) -> bool: """ Limits tolerances in a shape limitTolerance(tmin, [tmax=0, ShapeType=Shape]) -> bool @@ -1144,9 +1137,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def optimalBoundingBox( - self, useTriangulation: bool = True, useShapeTolerance: bool = False - ) -> BoundBox: + def optimalBoundingBox(self, useTriangulation: bool = True, useShapeTolerance: bool = False, /) -> BoundBox: """ Get the optimal bounding box optimalBoundingBox([useTriangulation = True, useShapeTolerance = False]) -> bound box @@ -1160,7 +1151,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def findSubShape(self, shape: TopoShape) -> Tuple[Union[str, None], int]: + def findSubShape(self, shape: TopoShape, /) -> Tuple[Union[str, None], int]: """ findSubShape(shape) -> (type_name, index) @@ -1200,7 +1191,7 @@ class TopoShape(ComplexGeoData): ... @constmethod - def getChildShapes(self, shapetype: str, avoidtype: str = "") -> List[TopoShape]: + def getChildShapes(self, shapetype: str, avoidtype: str = "", /) -> List[TopoShape]: """ getChildShapes(shapetype, avoidtype='') -> list(Shape) diff --git a/src/Mod/Part/App/TopoShapeCompSolid.pyi b/src/Mod/Part/App/TopoShapeCompSolid.pyi index 34a80fee85..d9edec4abe 100644 --- a/src/Mod/Part/App/TopoShapeCompSolid.pyi +++ b/src/Mod/Part/App/TopoShapeCompSolid.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from TopoShape import TopoShape @@ -17,7 +21,7 @@ class TopoShapeCompSolid(TopoShape): TopoShapeCompSolid is the OpenCasCade topological compound solid wrapper """ - def add(self, solid: TopoShape) -> None: + def add(self, solid: TopoShape, /) -> None: """ Add a solid to the compound. add(solid) diff --git a/src/Mod/Part/App/TopoShapeCompound.pyi b/src/Mod/Part/App/TopoShapeCompound.pyi index b78f52c4cb..7b7b44c503 100644 --- a/src/Mod/Part/App/TopoShapeCompound.pyi +++ b/src/Mod/Part/App/TopoShapeCompound.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from TopoShape import TopoShape @@ -16,7 +20,7 @@ class TopoShapeCompound(TopoShape): Licence: LGPL """ - def add(self, shape: TopoShape) -> None: + def add(self, shape: TopoShape, /) -> None: """ Add a shape to the compound. add(shape) @@ -24,9 +28,7 @@ class TopoShapeCompound(TopoShape): ... @constmethod - def connectEdgesToWires( - self, Shared: bool = True, Tolerance: float = 1e-7 - ) -> "TopoShapeCompound": + def connectEdgesToWires(self, Shared: bool = True, Tolerance: float = 1e-7, /) -> "TopoShapeCompound": """ Build a compound of wires out of the edges of this compound. connectEdgesToWires([Shared = True, Tolerance = 1e-7]) -> Compound diff --git a/src/Mod/Part/App/TopoShapeEdge.pyi b/src/Mod/Part/App/TopoShapeEdge.pyi index c9c9cce0f5..6ced86b057 100644 --- a/src/Mod/Part/App/TopoShapeEdge.pyi +++ b/src/Mod/Part/App/TopoShapeEdge.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.Vector import Vector from Wire import Wire @@ -141,7 +145,7 @@ class TopoShapeEdge(TopoShape): """Returns the continuity""" @constmethod - def getParameterByLength(self, pos: float, tolerance: float = 1e-7) -> float: + def getParameterByLength(self, pos: float, tolerance: float = 1e-7, /) -> float: """ Get the value of the primary parameter at the given distance along the cartesian length of the edge. getParameterByLength(pos, [tolerance = 1e-7]) -> Float @@ -161,7 +165,7 @@ class TopoShapeEdge(TopoShape): ... @constmethod - def tangentAt(self, paramval: float) -> Vector: + def tangentAt(self, paramval: float, /) -> Vector: """ Get the tangent direction at the given primary parameter value along the Edge if it is defined tangentAt(paramval) -> Vector @@ -199,7 +203,7 @@ class TopoShapeEdge(TopoShape): ... @constmethod - def valueAt(self, paramval: float) -> Vector: + def valueAt(self, paramval: float, /) -> Vector: """ Get the value of the cartesian parameter value at the given parameter value along the Edge valueAt(paramval) -> Vector @@ -241,7 +245,7 @@ class TopoShapeEdge(TopoShape): ... @constmethod - def parameters(self, face: object = ...) -> List[float]: + def parameters(self, face: object = ..., /) -> List[float]: """ Get the list of parameters of the tessellation of an edge. parameters([face]) -> list @@ -252,7 +256,7 @@ class TopoShapeEdge(TopoShape): ... @constmethod - def parameterAt(self, vertex: object) -> float: + def parameterAt(self, vertex: object, /) -> float: """ Get the parameter at the given vertex if lying on the edge parameterAt(Vertex) -> Float @@ -260,7 +264,7 @@ class TopoShapeEdge(TopoShape): ... @constmethod - def normalAt(self, paramval: float) -> Vector: + def normalAt(self, paramval: float, /) -> Vector: """ Get the normal direction at the given parameter value along the Edge if it is defined normalAt(paramval) -> Vector @@ -298,7 +302,7 @@ class TopoShapeEdge(TopoShape): ... @constmethod - def derivative1At(self, paramval: float) -> Vector: + def derivative1At(self, paramval: float, /) -> Vector: """ Get the first derivative at the given parameter value along the Edge if it is defined derivative1At(paramval) -> Vector @@ -336,7 +340,7 @@ class TopoShapeEdge(TopoShape): ... @constmethod - def derivative2At(self, paramval: float) -> Vector: + def derivative2At(self, paramval: float, /) -> Vector: """ Get the second derivative at the given parameter value along the Edge if it is defined derivative2At(paramval) -> Vector @@ -374,7 +378,7 @@ class TopoShapeEdge(TopoShape): ... @constmethod - def derivative3At(self, paramval: float) -> Vector: + def derivative3At(self, paramval: float, /) -> Vector: """ Get the third derivative at the given parameter value along the Edge if it is defined derivative3At(paramval) -> Vector @@ -412,7 +416,7 @@ class TopoShapeEdge(TopoShape): ... @constmethod - def curvatureAt(self, paramval: float) -> float: + def curvatureAt(self, paramval: float, /) -> float: """ Get the curvature at the given parameter [First|Last] if defined curvatureAt(paramval) -> Float @@ -420,7 +424,7 @@ class TopoShapeEdge(TopoShape): ... @constmethod - def centerOfCurvatureAt(self, paramval: float) -> Vector: + def centerOfCurvatureAt(self, paramval: float, /) -> Vector: """ Get the center of curvature at the given parameter [First|Last] if defined centerOfCurvatureAt(paramval) -> Vector @@ -428,7 +432,7 @@ class TopoShapeEdge(TopoShape): ... @constmethod - def firstVertex(self, Orientation: bool = False) -> Vertex: + def firstVertex(self, Orientation: bool = False, /) -> Vertex: """ Returns the Vertex of orientation FORWARD in this edge. firstVertex([Orientation=False]) -> Vertex @@ -439,7 +443,7 @@ class TopoShapeEdge(TopoShape): ... @constmethod - def lastVertex(self, Orientation: bool = False) -> Vertex: + def lastVertex(self, Orientation: bool = False, /) -> Vertex: """ Returns the Vertex of orientation REVERSED in this edge. lastVertex([Orientation=False]) -> Vertex @@ -527,7 +531,7 @@ class TopoShapeEdge(TopoShape): ... @constmethod - def split(self, paramval: float) -> Wire: + def split(self, paramval: float, /) -> Wire: """ Splits the edge at the given parameter values and builds a wire out of it split(paramval) -> Wire @@ -545,7 +549,7 @@ class TopoShapeEdge(TopoShape): ... @constmethod - def isSeam(self, Face: object) -> bool: + def isSeam(self, Face: object, /) -> bool: """ Checks whether the edge is a seam edge. isSeam(Face) @@ -553,7 +557,7 @@ class TopoShapeEdge(TopoShape): ... @constmethod - def curveOnSurface(self, idx: int) -> Tuple[object, object, object, float, float]: + def curveOnSurface(self, idx: int, /) -> Tuple[object, object, object, float, float]: """ Returns the 2D curve, the surface, the placement and the parameter range of index idx. curveOnSurface(idx) -> None or tuple diff --git a/src/Mod/Part/App/TopoShapeFace.pyi b/src/Mod/Part/App/TopoShapeFace.pyi index 2794ba48ca..8fffb1fdcf 100644 --- a/src/Mod/Part/App/TopoShapeFace.pyi +++ b/src/Mod/Part/App/TopoShapeFace.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.Vector import Vector from TopoShape import TopoShape @@ -87,7 +91,7 @@ class TopoShapeFace(TopoShape): eigen vectors of the matrix of inertia of the system. """ - def addWire(self, wire: object) -> None: + def addWire(self, wire: object, /) -> None: """ Adds a wire to the face. addWire(wire) @@ -95,7 +99,7 @@ class TopoShapeFace(TopoShape): ... @constmethod - def makeOffset(self, dist: float) -> object: + def makeOffset(self, dist: float, /) -> object: """ Offset the face by a given amount. makeOffset(dist) -> Face @@ -131,7 +135,7 @@ class TopoShapeFace(TopoShape): ... @constmethod - def tangentAt(self, u: float, v: float) -> Vector: + def tangentAt(self, u: float, v: float, /) -> Vector: """ Get the tangent in u and v isoparametric at the given point if defined tangentAt(u,v) -> Vector @@ -139,7 +143,7 @@ class TopoShapeFace(TopoShape): ... @constmethod - def valueAt(self, u: float, v: float) -> Vector: + def valueAt(self, u: float, v: float, /) -> Vector: """ Get the point at the given parameter [0|Length] if defined valueAt(u,v) -> Vector @@ -147,7 +151,7 @@ class TopoShapeFace(TopoShape): ... @constmethod - def normalAt(self, pos: float) -> Vector: + def normalAt(self, pos: float, /) -> Vector: """ Get the normal vector at the given parameter [0|Length] if defined normalAt(pos) -> Vector @@ -155,7 +159,7 @@ class TopoShapeFace(TopoShape): ... @constmethod - def derivative1At(self, u: float, v: float) -> Tuple[Vector, Vector]: + def derivative1At(self, u: float, v: float, /) -> Tuple[Vector, Vector]: """ Get the first derivative at the given parameter [0|Length] if defined derivative1At(u,v) -> (vectorU,vectorV) @@ -163,7 +167,7 @@ class TopoShapeFace(TopoShape): ... @constmethod - def derivative2At(self, u: float, v: float) -> Tuple[Vector, Vector]: + def derivative2At(self, u: float, v: float, /) -> Tuple[Vector, Vector]: """ Vector = d2At(pos) - Get the second derivative at the given parameter [0|Length] if defined derivative2At(u,v) -> (vectorU,vectorV) @@ -171,7 +175,7 @@ class TopoShapeFace(TopoShape): ... @constmethod - def curvatureAt(self, u: float, v: float) -> float: + def curvatureAt(self, u: float, v: float, /) -> float: """ Get the curvature at the given parameter [0|Length] if defined curvatureAt(u,v) -> Float @@ -179,7 +183,7 @@ class TopoShapeFace(TopoShape): ... @constmethod - def isPartOfDomain(self, u: float, v: float) -> bool: + def isPartOfDomain(self, u: float, v: float, /) -> bool: """ Check if a given (u,v) pair is inside the domain of a face isPartOfDomain(u,v) -> bool @@ -187,7 +191,7 @@ class TopoShapeFace(TopoShape): ... @constmethod - def makeHalfSpace(self, pos: object) -> object: + def makeHalfSpace(self, pos: object, /) -> object: """ Make a half-space solid by this face and a reference point. makeHalfSpace(pos) -> Shape @@ -216,7 +220,7 @@ class TopoShapeFace(TopoShape): ... @constmethod - def curveOnSurface(self, Edge: object) -> Optional[Tuple[object, float, float]]: + def curveOnSurface(self, Edge: object, /) -> Optional[Tuple[object, float, float]]: """ Returns the curve associated to the edge in the parametric space of the face. curveOnSurface(Edge) -> (curve, min, max) or None @@ -226,7 +230,7 @@ class TopoShapeFace(TopoShape): """ ... - def cutHoles(self, list_of_wires: List[object]) -> None: + def cutHoles(self, list_of_wires: List[object], /) -> None: """ Cut holes in the face. cutHoles(list_of_wires) diff --git a/src/Mod/Part/App/TopoShapeShell.pyi b/src/Mod/Part/App/TopoShapeShell.pyi index 1d86b69f65..9f35df02af 100644 --- a/src/Mod/Part/App/TopoShapeShell.pyi +++ b/src/Mod/Part/App/TopoShapeShell.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from TopoShape import TopoShape from typing import Final, Dict @@ -68,7 +72,7 @@ class TopoShapeShell(TopoShape): eigen vectors of the matrix of inertia of the system. """ - def add(self, face: object) -> None: + def add(self, face: object, /) -> None: """ Add a face to the shell. add(face) @@ -92,7 +96,7 @@ class TopoShapeShell(TopoShape): ... @constmethod - def makeHalfSpace(self, point: object) -> object: + def makeHalfSpace(self, point: object, /) -> object: """ Make a half-space solid by this shell and a reference point. makeHalfSpace(point) -> Solid diff --git a/src/Mod/Part/App/TopoShapeSolid.pyi b/src/Mod/Part/App/TopoShapeSolid.pyi index 11f971e312..957e563916 100644 --- a/src/Mod/Part/App/TopoShapeSolid.pyi +++ b/src/Mod/Part/App/TopoShapeSolid.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from TopoShape import TopoShape from Base.Vector import Vector @@ -77,7 +81,7 @@ class TopoShapeSolid(TopoShape): """ @constmethod - def getMomentOfInertia(self, point: Vector, direction: Vector) -> float: + def getMomentOfInertia(self, point: Vector, direction: Vector, /) -> float: """ computes the moment of inertia of the material system about the axis A. getMomentOfInertia(point,direction) -> Float @@ -85,7 +89,7 @@ class TopoShapeSolid(TopoShape): ... @constmethod - def getRadiusOfGyration(self, point: Vector, direction: Vector) -> float: + def getRadiusOfGyration(self, point: Vector, direction: Vector, /) -> float: """ Returns the radius of gyration of the current system about the axis A. getRadiusOfGyration(point,direction) -> Float @@ -94,10 +98,13 @@ class TopoShapeSolid(TopoShape): @overload @constmethod - def offsetFaces(self, facesTuple: Tuple[TopoShape, ...], offset: float) -> TopoShape: ... + def offsetFaces( + self, facesTuple: Tuple[TopoShape, ...], offset: float, /) -> TopoShape: ... + @overload @constmethod - def offsetFaces(self, facesDict: Dict[TopoShape, float]) -> TopoShape: ... + def offsetFaces(self, facesDict: Dict[TopoShape, float], /) -> TopoShape: ... + @constmethod def offsetFaces(self, *args, **kwargs) -> TopoShape: """ diff --git a/src/Mod/Part/App/TopoShapeVertex.pyi b/src/Mod/Part/App/TopoShapeVertex.pyi index 44685da8c5..7f8d8c9f75 100644 --- a/src/Mod/Part/App/TopoShapeVertex.pyi +++ b/src/Mod/Part/App/TopoShapeVertex.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from Base.Vector import Vector from TopoShape import TopoShape diff --git a/src/Mod/Part/App/TopoShapeWire.pyi b/src/Mod/Part/App/TopoShapeWire.pyi index b67fe61c91..179c81c3e0 100644 --- a/src/Mod/Part/App/TopoShapeWire.pyi +++ b/src/Mod/Part/App/TopoShapeWire.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from TopoShape import TopoShape from typing import Dict, List, Final, overload, Optional @@ -85,14 +89,15 @@ class TopoShapeWire(TopoShape): """ ... - def add(self, edge: object) -> None: + def add(self, edge: object, /) -> None: """ Add an edge to the wire add(edge) """ ... - def fixWire(self, face: Optional[object] = None, tolerance: Optional[float] = None) -> None: + def fixWire( + self, face: Optional[object] = None, tolerance: Optional[float] = None, /) -> None: """ Fix wire fixWire([face, tolerance]) @@ -102,7 +107,7 @@ class TopoShapeWire(TopoShape): ... @constmethod - def makeHomogenousWires(self, wire: object) -> object: + def makeHomogenousWires(self, wire: object, /) -> object: """ Make this and the given wire homogeneous to have the same number of edges makeHomogenousWires(wire) -> Wire @@ -110,7 +115,7 @@ class TopoShapeWire(TopoShape): ... @constmethod - def makePipe(self, profile: object) -> object: + def makePipe(self, profile: object, /) -> object: """ Make a pipe by sweeping along a wire. makePipe(profile) -> Shape @@ -124,7 +129,7 @@ class TopoShapeWire(TopoShape): isSolid: bool = False, isFrenet: bool = False, transition: int = 0, - ) -> object: + /,) -> object: """ Make a loft defined by a list of profiles along a wire. makePipeShell(shapeList,[isSolid=False,isFrenet=False,transition=0]) -> Shape diff --git a/src/Mod/Part/App/Toroid.pyi b/src/Mod/Part/App/Toroid.pyi index 4353a40f11..58d6618815 100644 --- a/src/Mod/Part/App/Toroid.pyi +++ b/src/Mod/Part/App/Toroid.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Part.GeometrySurface import GeometrySurface from Base.Vector import Vector diff --git a/src/Mod/Part/App/TrimmedCurve.pyi b/src/Mod/Part/App/TrimmedCurve.pyi index ee15e49b64..49e70f55b2 100644 --- a/src/Mod/Part/App/TrimmedCurve.pyi +++ b/src/Mod/Part/App/TrimmedCurve.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from BoundedCurve import BoundedCurve @@ -17,7 +21,7 @@ class TrimmedCurve(BoundedCurve): Licence: LGPL """ - def setParameterRange(self, first: float, last: float) -> None: + def setParameterRange(self, first: float, last: float, /) -> None: """ Re-trims this curve to the provided parameter range ([Float=First, Float=Last]) """ diff --git a/src/Mod/Part/Gui/ViewProviderPartExt.pyi b/src/Mod/Part/Gui/ViewProviderPartExt.pyi index dc9b6adea9..717c361643 100644 --- a/src/Mod/Part/Gui/ViewProviderPartExt.pyi +++ b/src/Mod/Part/Gui/ViewProviderPartExt.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from Gui.ViewProviderGeometryObject import ViewProviderGeometryObject diff --git a/src/Mod/PartDesign/App/Body.pyi b/src/Mod/PartDesign/App/Body.pyi index b8309421ad..773fcbe946 100644 --- a/src/Mod/PartDesign/App/Body.pyi +++ b/src/Mod/PartDesign/App/Body.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Part.BodyBase import BodyBase from typing import Final, overload @@ -17,7 +21,7 @@ class Body(BodyBase): VisibleFeature: Final[object] = ... """Return the visible feature of this body""" - def insertObject(self, feature: object, target: object, after: bool = False) -> None: + def insertObject(self, feature: object, target: object, after: bool = False, /) -> None: """ insertObject(feature, target, after=False) Insert the feature into the body after the given feature. diff --git a/src/Mod/PartDesign/App/Feature.pyi b/src/Mod/PartDesign/App/Feature.pyi index e1d3da4074..1bb573e5c8 100644 --- a/src/Mod/PartDesign/App/Feature.pyi +++ b/src/Mod/PartDesign/App/Feature.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from Part.PartFeature import PartFeature from typing import Optional, overload diff --git a/src/Mod/PartDesign/Gui/ViewProvider.pyi b/src/Mod/PartDesign/Gui/ViewProvider.pyi index 2bee076209..bbfd8fa060 100644 --- a/src/Mod/PartDesign/Gui/ViewProvider.pyi +++ b/src/Mod/PartDesign/Gui/ViewProvider.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from Gui.ViewProviderPartExt import ViewProviderPartExt from typing import Final, overload @@ -16,7 +20,7 @@ class ViewProvider(ViewProviderPartExt): Licence: LGPL """ - def setBodyMode(self, mode: bool) -> None: + def setBodyMode(self, mode: bool, /) -> None: """ setBodyMode(bool): body mode means that the object is part of a body and that the body is used to set the visual properties, not the features. Hence @@ -24,7 +28,7 @@ class ViewProvider(ViewProviderPartExt): """ ... - def makeTemporaryVisible(self, visible: bool) -> None: + def makeTemporaryVisible(self, visible: bool, /) -> None: """ makeTemporaryVisible(bool): makes this viewprovider visible in the scene graph without changing any properties, not the visibility one and also not diff --git a/src/Mod/Points/App/Points.pyi b/src/Mod/Points/App/Points.pyi index f84dabb13e..34a931d244 100644 --- a/src/Mod/Points/App/Points.pyi +++ b/src/Mod/Points/App/Points.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any, Final from Base.Metadata import constmethod, export diff --git a/src/Mod/Robot/App/Robot6Axis.pyi b/src/Mod/Robot/App/Robot6Axis.pyi index 267c1bc606..7021edaae5 100644 --- a/src/Mod/Robot/App/Robot6Axis.pyi +++ b/src/Mod/Robot/App/Robot6Axis.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any from Base.Metadata import export diff --git a/src/Mod/Robot/App/RobotObject.pyi b/src/Mod/Robot/App/RobotObject.pyi index 14b7b6729d..83f91b16b2 100644 --- a/src/Mod/Robot/App/RobotObject.pyi +++ b/src/Mod/Robot/App/RobotObject.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any from Base.Metadata import export diff --git a/src/Mod/Robot/App/Trajectory.pyi b/src/Mod/Robot/App/Trajectory.pyi index 5c3263398c..6e78fe8ba7 100644 --- a/src/Mod/Robot/App/Trajectory.pyi +++ b/src/Mod/Robot/App/Trajectory.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any, Final from Base.Metadata import export diff --git a/src/Mod/Robot/App/Waypoint.pyi b/src/Mod/Robot/App/Waypoint.pyi index 375e49c63f..d793ea0f34 100644 --- a/src/Mod/Robot/App/Waypoint.pyi +++ b/src/Mod/Robot/App/Waypoint.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any from Base.Metadata import export diff --git a/src/Mod/Sketcher/App/Constraint.pyi b/src/Mod/Sketcher/App/Constraint.pyi index 8c93386409..bda851deae 100644 --- a/src/Mod/Sketcher/App/Constraint.pyi +++ b/src/Mod/Sketcher/App/Constraint.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from Base.Persistence import Persistence from typing import Final diff --git a/src/Mod/Sketcher/App/ExternalGeometryExtension.pyi b/src/Mod/Sketcher/App/ExternalGeometryExtension.pyi index 3b809b32fb..e809190d31 100644 --- a/src/Mod/Sketcher/App/ExternalGeometryExtension.pyi +++ b/src/Mod/Sketcher/App/ExternalGeometryExtension.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Part.App.GeometryExtension import GeometryExtension from typing import Final, overload diff --git a/src/Mod/Sketcher/App/ExternalGeometryFacade.pyi b/src/Mod/Sketcher/App/ExternalGeometryFacade.pyi index 3c5ac0082d..37580a7033 100644 --- a/src/Mod/Sketcher/App/ExternalGeometryFacade.pyi +++ b/src/Mod/Sketcher/App/ExternalGeometryFacade.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.BaseClass import BaseClass from typing import Final, List diff --git a/src/Mod/Sketcher/App/GeometryFacade.pyi b/src/Mod/Sketcher/App/GeometryFacade.pyi index a78e115d2e..561be3cb90 100644 --- a/src/Mod/Sketcher/App/GeometryFacade.pyi +++ b/src/Mod/Sketcher/App/GeometryFacade.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.BaseClass import BaseClass from Base.Axis import Axis @@ -61,71 +65,71 @@ class GeometryFacade(BaseClass): """ ... - def rotate(self, Ang: float, axis: Axis) -> None: + def rotate(self, Ang: float, axis: Axis, /) -> None: """ Rotates this geometric object at angle Ang (in radians) about axis """ ... - def scale(self, center: CoordinateSystem, factor: float) -> None: + def scale(self, center: CoordinateSystem, factor: float, /) -> None: """ Applies a scaling transformation on this geometric object with a center and scaling factor """ ... - def transform(self, transformation: Placement) -> None: + def transform(self, transformation: Placement, /) -> None: """ Applies a transformation to this geometric object """ ... - def translate(self, offset: Vector) -> None: + def translate(self, offset: Vector, /) -> None: """ Translates this geometric object """ ... @constmethod - def hasExtensionOfType(self, type_str: str) -> bool: + def hasExtensionOfType(self, type_str: str, /) -> bool: """ Returns a boolean indicating whether a geometry extension of the type indicated as a string exists. """ ... @constmethod - def hasExtensionOfName(self, name: str) -> bool: + def hasExtensionOfName(self, name: str, /) -> bool: """ Returns a boolean indicating whether a geometry extension with the name indicated as a string exists. """ ... @constmethod - def getExtensionOfType(self, type_str: str) -> DocumentObjectExtension: + def getExtensionOfType(self, type_str: str, /) -> DocumentObjectExtension: """ Gets the first geometry extension of the type indicated by the string. """ ... @constmethod - def getExtensionOfName(self, name: str) -> DocumentObjectExtension: + def getExtensionOfName(self, name: str, /) -> DocumentObjectExtension: """ Gets the first geometry extension of the name indicated by the string. """ ... - def setExtension(self, extension: DocumentObjectExtension) -> None: + def setExtension(self, extension: DocumentObjectExtension, /) -> None: """ Sets a geometry extension of the indicated type. """ ... - def deleteExtensionOfType(self, type_str: str) -> None: + def deleteExtensionOfType(self, type_str: str, /) -> None: """ Deletes all extensions of the indicated type. """ ... - def deleteExtensionOfName(self, name: str) -> None: + def deleteExtensionOfName(self, name: str, /) -> None: """ Deletes all extensions of the indicated name. """ diff --git a/src/Mod/Sketcher/App/Sketch.pyi b/src/Mod/Sketcher/App/Sketch.pyi index 6fa03c0c7a..698aaed707 100644 --- a/src/Mod/Sketcher/App/Sketch.pyi +++ b/src/Mod/Sketcher/App/Sketch.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Base.Persistence import Persistence from Base.Vector import Vector @@ -56,8 +60,7 @@ class Sketch(Persistence): ... def moveGeometry( - self, GeoIndex: int, PointPos: Vector, Vector: Vector, relative: bool = False - ) -> None: + self, GeoIndex: int, PointPos: Vector, Vector: Vector, relative: bool = False, /) -> None: """ moveGeometry(GeoIndex,PointPos,Vector,[relative]) - move a given point (or curve) to another location. diff --git a/src/Mod/Sketcher/App/SketchGeometryExtension.pyi b/src/Mod/Sketcher/App/SketchGeometryExtension.pyi index 2fda454ba4..2e8cfe069e 100644 --- a/src/Mod/Sketcher/App/SketchGeometryExtension.pyi +++ b/src/Mod/Sketcher/App/SketchGeometryExtension.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod from Part.App.GeometryExtension import GeometryExtension diff --git a/src/Mod/Sketcher/App/SketchObject.pyi b/src/Mod/Sketcher/App/SketchObject.pyi index 1a7cffefb1..b8453d2c7c 100644 --- a/src/Mod/Sketcher/App/SketchObject.pyi +++ b/src/Mod/Sketcher/App/SketchObject.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, constmethod, no_args from Base.Quantity import Quantity from Base.Vector import Vector @@ -79,12 +83,11 @@ class SketchObject(Part2DObject): ... @overload - def addGeometry(self, geo: Geometry, isConstruction: bool = False) -> int: ... + def addGeometry(self, geo: Geometry, isConstruction: bool = False, /) -> int: ... @overload - def addGeometry(self, geo: List[Geometry], isConstruction: bool = False) -> Tuple[int, ...]: ... + def addGeometry(self, geo: List[Geometry], isConstruction: bool = False, /) -> Tuple[int, ...]: ... def addGeometry( - self, geo: Union[Geometry, List[Geometry]], isConstruction: bool = False - ) -> Union[int, Tuple[int, ...]]: + self, geo: Union[Geometry, List[Geometry]], isConstruction: bool = False, /) -> Union[int, Tuple[int, ...]]: """ Add geometric objects to the sketch. @@ -111,7 +114,7 @@ class SketchObject(Part2DObject): """ ... - def delGeometry(self, geoId: int, noSolve: bool) -> None: + def delGeometry(self, geoId: int, noSolve: bool, /) -> None: """ Delete a geometric object from the sketch. @@ -123,7 +126,7 @@ class SketchObject(Part2DObject): """ ... - def delGeometries(self, geoIds: List[int], noSolve: bool) -> None: + def delGeometries(self, geoIds: List[int], noSolve: bool, /) -> None: """ Delete a list of geometric objects from the sketch. @@ -135,7 +138,7 @@ class SketchObject(Part2DObject): """ ... - def deleteAllGeometry(self, noSolve: bool) -> None: + def deleteAllGeometry(self, noSolve: bool, /) -> None: """ Delete all the geometry objects from the sketch, except external geometry. @@ -143,7 +146,7 @@ class SketchObject(Part2DObject): """ ... - def detectDegeneratedGeometries(self, tolerance: float) -> int: + def detectDegeneratedGeometries(self, tolerance: float, /) -> int: """ Detect degenerated geometries. A curve geometry is considered degenerated if the parameter range is less than the tolerance. @@ -158,7 +161,7 @@ class SketchObject(Part2DObject): """ ... - def removeDegeneratedGeometries(self, tolerance: float) -> int: + def removeDegeneratedGeometries(self, tolerance: float, /) -> int: """ Remove degenerated geometries. A curve geometry is considered degenerated if the parameter range is less than the tolerance. @@ -181,7 +184,7 @@ class SketchObject(Part2DObject): """ ... - def toggleConstruction(self, geoId: int) -> None: + def toggleConstruction(self, geoId: int, /) -> None: """ Toggles a geometry between regular and construction. @@ -192,7 +195,7 @@ class SketchObject(Part2DObject): """ ... - def setConstruction(self, geoId: int, state: bool) -> None: + def setConstruction(self, geoId: int, state: bool, /) -> None: """ Set construction mode of a geometry. @@ -205,7 +208,7 @@ class SketchObject(Part2DObject): """ ... - def getConstruction(self, geoId: int) -> bool: + def getConstruction(self, geoId: int, /) -> bool: """ Determine whether the given geometry is a "construction geometry". @@ -221,12 +224,11 @@ class SketchObject(Part2DObject): ... @overload - def addConstraint(self, constraint: Constraint) -> int: ... + def addConstraint(self, constraint: Constraint, /) -> int: ... @overload - def addConstraint(self, constraints: List[Constraint]) -> Tuple[int, ...]: ... + def addConstraint(self, constraints: List[Constraint], /) -> Tuple[int, ...]: ... def addConstraint( - self, constraint: Union[Constraint, List[Constraint]] - ) -> Union[int, Tuple[int, ...]]: + self, constraint: Union[Constraint, List[Constraint]], /) -> Union[int, Tuple[int, ...]]: """ Add constraints to the sketch. @@ -244,7 +246,7 @@ class SketchObject(Part2DObject): """ ... - def delConstraint(self, constraintIndex: int, noSolve: bool) -> None: + def delConstraint(self, constraintIndex: int, noSolve: bool, /) -> None: """ Delete a constraint from the sketch. @@ -256,8 +258,7 @@ class SketchObject(Part2DObject): ... def delConstraints( - self, constraintIndices: List[int], updateGeometry: bool, noSolve: bool - ) -> None: + self, constraintIndices: List[int], updateGeometry: bool, noSolve: bool, /) -> None: """ Delete multiple constraints from a sketch @@ -269,7 +270,7 @@ class SketchObject(Part2DObject): """ ... - def renameConstraint(self, constraintIndex: int, name: str) -> None: + def renameConstraint(self, constraintIndex: int, name: str, /) -> None: """ Rename a constraint in the sketch. @@ -283,7 +284,7 @@ class SketchObject(Part2DObject): ... @constmethod - def getIndexByName(self, name: str) -> int: + def getIndexByName(self, name: str, /) -> int: """ Get the index of a constraint by name. @@ -295,7 +296,7 @@ class SketchObject(Part2DObject): """ ... - def carbonCopy(self, objName: str, asConstruction: bool = True) -> None: + def carbonCopy(self, objName: str, asConstruction: bool = True, /) -> None: """ Copy another sketch's geometry and constraints into this sketch. @@ -308,8 +309,7 @@ class SketchObject(Part2DObject): ... def addExternal( - self, objName: str, subName: str, defining: bool = False, intersection: bool = False - ) -> None: + self, objName: str, subName: str, defining: bool = False, intersection: bool = False, /) -> None: """ Add a link to an external geometry. @@ -324,7 +324,7 @@ class SketchObject(Part2DObject): """ ... - def delExternal(self, extGeoId: int) -> None: + def delExternal(self, extGeoId: int, /) -> None: """ Delete an external geometry link from the sketch. @@ -336,9 +336,9 @@ class SketchObject(Part2DObject): ... @overload - def delConstraintOnPoint(self, vertexId: int) -> None: ... + def delConstraintOnPoint(self, vertexId: int, /) -> None: ... @overload - def delConstraintOnPoint(self, geoId: int, pointPos: int) -> None: ... + def delConstraintOnPoint(self, geoId: int, pointPos: int, /) -> None: ... def delConstraintOnPoint(self, *args: int) -> None: """ Delete coincident constraints associated with a sketch point. @@ -366,7 +366,7 @@ class SketchObject(Part2DObject): """ ... - def setDatum(self, constraint: Union[int, str], value: Union[float, Quantity]) -> None: + def setDatum(self, constraint: Union[int, str], value: Union[float, Quantity], /) -> None: """ Set the value of a datum constraint (e.g. Distance or Angle) @@ -381,7 +381,7 @@ class SketchObject(Part2DObject): ... @constmethod - def getDatum(self, constraint: Union[int, str]) -> Quantity: + def getDatum(self, constraint: Union[int, str], /) -> Quantity: """ Get the value of a datum constraint (e.g. Distance or Angle) @@ -395,7 +395,7 @@ class SketchObject(Part2DObject): """ ... - def setDriving(self, constraintIndex: int, state: bool) -> None: + def setDriving(self, constraintIndex: int, state: bool, /) -> None: """ Set the Driving status of a datum constraint. @@ -408,7 +408,7 @@ class SketchObject(Part2DObject): """ ... - def setDatumsDriving(self, state: bool) -> None: + def setDatumsDriving(self, state: bool, /) -> None: """ Set the Driving status of all datum constraints. @@ -433,7 +433,7 @@ class SketchObject(Part2DObject): ... @constmethod - def getDriving(self, constraintIndex: int) -> bool: + def getDriving(self, constraintIndex: int, /) -> bool: """ Get the Driving status of a datum constraint. @@ -448,7 +448,7 @@ class SketchObject(Part2DObject): """ ... - def toggleDriving(self, constraintIndex: int) -> None: + def toggleDriving(self, constraintIndex: int, /) -> None: """ Toggle the Driving status of a datum constraint. @@ -483,7 +483,7 @@ class SketchObject(Part2DObject): """ ... - def setActive(self, constraintIndex: int, state: bool) -> None: + def setActive(self, constraintIndex: int, state: bool, /) -> None: """ Activates or deactivates a constraint (enforce it or not). @@ -497,7 +497,7 @@ class SketchObject(Part2DObject): ... @constmethod - def getActive(self, constraintIndex: int) -> bool: + def getActive(self, constraintIndex: int, /) -> bool: """ Get whether a constraint is active, i.e. enforced, or not. @@ -512,7 +512,7 @@ class SketchObject(Part2DObject): """ ... - def toggleActive(self, constraintIndex: int) -> None: + def toggleActive(self, constraintIndex: int, /) -> None: """ Toggle the constraint between active (enforced) and inactive. @@ -524,7 +524,7 @@ class SketchObject(Part2DObject): ... @constmethod - def getLabelPosition(self, constraintIndex: int) -> float: + def getLabelPosition(self, constraintIndex: int, /) -> float: """ Get label position of the constraint. @@ -538,7 +538,7 @@ class SketchObject(Part2DObject): """ ... - def setLabelPosition(self, constraintIndex: int, value: float) -> None: + def setLabelPosition(self, constraintIndex: int, value: float, /) -> None: """ Set label position of the constraint. @@ -551,7 +551,7 @@ class SketchObject(Part2DObject): ... @constmethod - def getLabelDistance(self, constraintIndex: int) -> float: + def getLabelDistance(self, constraintIndex: int, /) -> float: """ Get label distance of the constraint. @@ -565,7 +565,7 @@ class SketchObject(Part2DObject): """ ... - def setLabelDistance(self, constraintIndex: int, value: float) -> None: + def setLabelDistance(self, constraintIndex: int, value: float, /) -> None: """ Set label distance of the constraint. @@ -578,8 +578,7 @@ class SketchObject(Part2DObject): ... def moveGeometry( - self, GeoIndex: int, PointPos: int, Vector: Vector, relative: bool = False - ) -> None: + self, GeoIndex: int, PointPos: int, Vector: Vector, relative: bool = False, /) -> None: """ Move a given point (or curve) to another location. @@ -596,8 +595,7 @@ class SketchObject(Part2DObject): ... def moveGeometries( - self, Geos: List[Tuple[int, int]], Vector: Vector, relative: bool = False - ) -> None: + self, Geos: List[Tuple[int, int]], Vector: Vector, relative: bool = False, /) -> None: """ Move given points and curves to another location. @@ -615,7 +613,7 @@ class SketchObject(Part2DObject): ... @constmethod - def getPoint(self, GeoIndex: int, PointPos: int) -> Vector: + def getPoint(self, GeoIndex: int, PointPos: int, /) -> Vector: """ Retrieve the vector of a point in the sketch. @@ -624,7 +622,7 @@ class SketchObject(Part2DObject): ... @constmethod - def getGeoVertexIndex(self, index: int) -> Tuple[int, int]: + def getGeoVertexIndex(self, index: int, /) -> Tuple[int, int]: """ Retrieve the GeoId and PosId of a point in the sketch. @@ -753,7 +751,7 @@ class SketchObject(Part2DObject): """ ... - def calculateAngleViaPoint(self, GeoId1: int, GeoId2: int, px: float, py: float) -> float: + def calculateAngleViaPoint(self, GeoId1: int, GeoId2: int, px: float, py: float, /) -> float: """ calculateAngleViaPoint(GeoId1, GeoId2, px, py) - calculates angle between curves identified by GeoId1 and GeoId2 at point (x,y). The point must be @@ -762,7 +760,7 @@ class SketchObject(Part2DObject): """ ... - def isPointOnCurve(self, GeoIdCurve: int, x: float, y: float) -> bool: + def isPointOnCurve(self, GeoIdCurve: int, x: float, y: float, /) -> bool: """ isPointOnCurve(GeoIdCurve, float x, float y) -> bool - tests if the point (x,y) geometrically lies on a curve (e.g. ellipse). It treats lines as infinite, @@ -770,7 +768,7 @@ class SketchObject(Part2DObject): """ ... - def calculateConstraintError(self, index: int) -> float: + def calculateConstraintError(self, index: int, /) -> float: """ calculateConstraintError(index) - calculates the error function of the constraint identified by its index and returns the signed error value. @@ -780,7 +778,7 @@ class SketchObject(Part2DObject): """ ... - def changeConstraintsLocking(self, bLock: bool) -> None: + def changeConstraintsLocking(self, bLock: bool, /) -> None: """ changeConstraintsLocking(bLock) - locks or unlocks all tangent and perpendicular constraints. (Constraint locking prevents it from @@ -837,19 +835,19 @@ class SketchObject(Part2DObject): """ ... - def makeMissingPointOnPointCoincident(self, arg: bool) -> None: + def makeMissingPointOnPointCoincident(self, arg: bool, /) -> None: """ Applies the detected / set Point On Point coincident constraints. If the argument is True, then solving and redundant removal is done after each individual addition. """ ... - def makeMissingVerticalHorizontal(self, arg: bool) -> None: + def makeMissingVerticalHorizontal(self, arg: bool, /) -> None: """ Applies the detected / set Vertical/Horizontal constraints. If the argument is True, then solving and redundant removal is done after each individual addition. """ ... - def makeMissingEquality(self, arg: bool) -> None: + def makeMissingEquality(self, arg: bool, /) -> None: """ Applies the detected / set Equality constraints. If the argument is True, then solving and redundant removal is done after each individual addition. """ @@ -870,7 +868,7 @@ class SketchObject(Part2DObject): """ ... - def autoRemoveRedundants(self, arg: bool) -> None: + def autoRemoveRedundants(self, arg: bool, /) -> None: """ Removes constraints currently detected as redundant by the solver. If the argument is True, then the geometry is updated after solving. """ @@ -888,7 +886,7 @@ class SketchObject(Part2DObject): """ ... - def setGeometryIds(GeoIdsToIds: List[Tuple[int, int]]): + def setGeometryIds(GeoIdsToIds: List[Tuple[int, int]], /): """ Sets the GeometryId of the SketchGeometryExtension of the geometries with the provided GeoIds Expects a list of pairs (GeoId, id) diff --git a/src/Mod/Sketcher/App/SketchObjectSF.pyi b/src/Mod/Sketcher/App/SketchObjectSF.pyi index 5af77c2a15..0df672b9fd 100644 --- a/src/Mod/Sketcher/App/SketchObjectSF.pyi +++ b/src/Mod/Sketcher/App/SketchObjectSF.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from Part.App.Part2DObject import Part2DObject diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketchGeometryExtension.pyi b/src/Mod/Sketcher/Gui/ViewProviderSketchGeometryExtension.pyi index a3994baf4a..d12ff8d5f3 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketchGeometryExtension.pyi +++ b/src/Mod/Sketcher/Gui/ViewProviderSketchGeometryExtension.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from Part.App.GeometryExtension import GeometryExtension diff --git a/src/Mod/Spreadsheet/App/PropertyColumnWidths.pyi b/src/Mod/Spreadsheet/App/PropertyColumnWidths.pyi index 0bcb7c9cd0..1617880935 100644 --- a/src/Mod/Spreadsheet/App/PropertyColumnWidths.pyi +++ b/src/Mod/Spreadsheet/App/PropertyColumnWidths.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from Base.Persistence import Persistence diff --git a/src/Mod/Spreadsheet/App/PropertyRowHeights.pyi b/src/Mod/Spreadsheet/App/PropertyRowHeights.pyi index 6f27b86034..3a09048616 100644 --- a/src/Mod/Spreadsheet/App/PropertyRowHeights.pyi +++ b/src/Mod/Spreadsheet/App/PropertyRowHeights.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from Base.Persistence import Persistence diff --git a/src/Mod/Spreadsheet/App/PropertySheet.pyi b/src/Mod/Spreadsheet/App/PropertySheet.pyi index f8be8e14f0..c3b6b2a319 100644 --- a/src/Mod/Spreadsheet/App/PropertySheet.pyi +++ b/src/Mod/Spreadsheet/App/PropertySheet.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export, sequence_protocol from Base.Persistence import Persistence diff --git a/src/Mod/Spreadsheet/App/Sheet.pyi b/src/Mod/Spreadsheet/App/Sheet.pyi index d71ff4e19a..f2afe739d9 100644 --- a/src/Mod/Spreadsheet/App/Sheet.pyi +++ b/src/Mod/Spreadsheet/App/Sheet.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any from Base.Metadata import export diff --git a/src/Mod/Spreadsheet/Gui/ViewProviderSpreadsheet.pyi b/src/Mod/Spreadsheet/Gui/ViewProviderSpreadsheet.pyi index 5add098af1..96d60ce2ec 100644 --- a/src/Mod/Spreadsheet/Gui/ViewProviderSpreadsheet.pyi +++ b/src/Mod/Spreadsheet/Gui/ViewProviderSpreadsheet.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any from Base.Metadata import export diff --git a/src/Mod/Surface/App/Blending/BlendCurve.pyi b/src/Mod/Surface/App/Blending/BlendCurve.pyi index da40d824b6..a2622c6393 100644 --- a/src/Mod/Surface/App/Blending/BlendCurve.pyi +++ b/src/Mod/Surface/App/Blending/BlendCurve.pyi @@ -1,4 +1,6 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations from typing import Any diff --git a/src/Mod/Surface/App/Blending/BlendPoint.pyi b/src/Mod/Surface/App/Blending/BlendPoint.pyi index d44c4b2978..1a0cfd9d6e 100644 --- a/src/Mod/Surface/App/Blending/BlendPoint.pyi +++ b/src/Mod/Surface/App/Blending/BlendPoint.pyi @@ -1,4 +1,6 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations from typing import Any, Final diff --git a/src/Mod/TechDraw/App/CenterLine.pyi b/src/Mod/TechDraw/App/CenterLine.pyi index b652ef2b99..1f6296b2ec 100644 --- a/src/Mod/TechDraw/App/CenterLine.pyi +++ b/src/Mod/TechDraw/App/CenterLine.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any, Final from Base.PyObjectBase import PyObjectBase diff --git a/src/Mod/TechDraw/App/CosmeticEdge.pyi b/src/Mod/TechDraw/App/CosmeticEdge.pyi index 1403bc370d..92c7e887af 100644 --- a/src/Mod/TechDraw/App/CosmeticEdge.pyi +++ b/src/Mod/TechDraw/App/CosmeticEdge.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Final from Base.PyObjectBase import PyObjectBase diff --git a/src/Mod/TechDraw/App/CosmeticExtension.pyi b/src/Mod/TechDraw/App/CosmeticExtension.pyi index 07218eb29f..400834b4fb 100644 --- a/src/Mod/TechDraw/App/CosmeticExtension.pyi +++ b/src/Mod/TechDraw/App/CosmeticExtension.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from App.DocumentObjectExtension import DocumentObjectExtension diff --git a/src/Mod/TechDraw/App/CosmeticVertex.pyi b/src/Mod/TechDraw/App/CosmeticVertex.pyi index ae3da97780..adcc4c34b3 100644 --- a/src/Mod/TechDraw/App/CosmeticVertex.pyi +++ b/src/Mod/TechDraw/App/CosmeticVertex.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any, Final from Base.PyObjectBase import PyObjectBase diff --git a/src/Mod/TechDraw/App/DrawBrokenView.pyi b/src/Mod/TechDraw/App/DrawBrokenView.pyi index 73cec4d14d..3e4a085ad0 100644 --- a/src/Mod/TechDraw/App/DrawBrokenView.pyi +++ b/src/Mod/TechDraw/App/DrawBrokenView.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any from Base.Metadata import export diff --git a/src/Mod/TechDraw/App/DrawGeomHatch.pyi b/src/Mod/TechDraw/App/DrawGeomHatch.pyi index de603f8670..7485e8321d 100644 --- a/src/Mod/TechDraw/App/DrawGeomHatch.pyi +++ b/src/Mod/TechDraw/App/DrawGeomHatch.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any from Base.Metadata import export diff --git a/src/Mod/TechDraw/App/DrawHatch.pyi b/src/Mod/TechDraw/App/DrawHatch.pyi index 690f6c8f9f..d18ccedf14 100644 --- a/src/Mod/TechDraw/App/DrawHatch.pyi +++ b/src/Mod/TechDraw/App/DrawHatch.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any from Base.Metadata import export from App.DocumentObject import DocumentObject diff --git a/src/Mod/TechDraw/App/DrawLeaderLine.pyi b/src/Mod/TechDraw/App/DrawLeaderLine.pyi index 797e4a9438..dde8091a80 100644 --- a/src/Mod/TechDraw/App/DrawLeaderLine.pyi +++ b/src/Mod/TechDraw/App/DrawLeaderLine.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from DrawView import DrawView diff --git a/src/Mod/TechDraw/App/DrawPage.pyi b/src/Mod/TechDraw/App/DrawPage.pyi index f76b42d7e8..61681d87fc 100644 --- a/src/Mod/TechDraw/App/DrawPage.pyi +++ b/src/Mod/TechDraw/App/DrawPage.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any, Final from Base.Metadata import export diff --git a/src/Mod/TechDraw/App/DrawParametricTemplate.pyi b/src/Mod/TechDraw/App/DrawParametricTemplate.pyi index 1bdc533308..af38883645 100644 --- a/src/Mod/TechDraw/App/DrawParametricTemplate.pyi +++ b/src/Mod/TechDraw/App/DrawParametricTemplate.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any, Final from Base.Metadata import export diff --git a/src/Mod/TechDraw/App/DrawProjGroup.pyi b/src/Mod/TechDraw/App/DrawProjGroup.pyi index 489b009b0e..5a2a0a87f8 100644 --- a/src/Mod/TechDraw/App/DrawProjGroup.pyi +++ b/src/Mod/TechDraw/App/DrawProjGroup.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any from Base.Metadata import export diff --git a/src/Mod/TechDraw/App/DrawProjGroupItem.pyi b/src/Mod/TechDraw/App/DrawProjGroupItem.pyi index e2848a4d63..c4f8303fc7 100644 --- a/src/Mod/TechDraw/App/DrawProjGroupItem.pyi +++ b/src/Mod/TechDraw/App/DrawProjGroupItem.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any from Base.Metadata import export diff --git a/src/Mod/TechDraw/App/DrawRichAnno.pyi b/src/Mod/TechDraw/App/DrawRichAnno.pyi index 258184f688..ece06d65e5 100644 --- a/src/Mod/TechDraw/App/DrawRichAnno.pyi +++ b/src/Mod/TechDraw/App/DrawRichAnno.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from TechDraw.DrawView import DrawView diff --git a/src/Mod/TechDraw/App/DrawSVGTemplate.pyi b/src/Mod/TechDraw/App/DrawSVGTemplate.pyi index 2cc9f29114..184b1a114f 100644 --- a/src/Mod/TechDraw/App/DrawSVGTemplate.pyi +++ b/src/Mod/TechDraw/App/DrawSVGTemplate.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any from Base.Metadata import export diff --git a/src/Mod/TechDraw/App/DrawTemplate.pyi b/src/Mod/TechDraw/App/DrawTemplate.pyi index 26639c1638..013b935fd0 100644 --- a/src/Mod/TechDraw/App/DrawTemplate.pyi +++ b/src/Mod/TechDraw/App/DrawTemplate.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from App.DocumentObject import DocumentObject diff --git a/src/Mod/TechDraw/App/DrawTile.pyi b/src/Mod/TechDraw/App/DrawTile.pyi index f6db6b7b25..1d65c707d5 100644 --- a/src/Mod/TechDraw/App/DrawTile.pyi +++ b/src/Mod/TechDraw/App/DrawTile.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from App.DocumentObject import DocumentObject diff --git a/src/Mod/TechDraw/App/DrawTileWeld.pyi b/src/Mod/TechDraw/App/DrawTileWeld.pyi index b90ddf5c31..03d788df62 100644 --- a/src/Mod/TechDraw/App/DrawTileWeld.pyi +++ b/src/Mod/TechDraw/App/DrawTileWeld.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from TechDraw.DrawTile import DrawTile diff --git a/src/Mod/TechDraw/App/DrawView.pyi b/src/Mod/TechDraw/App/DrawView.pyi index c86dcce3e5..9e053235e6 100644 --- a/src/Mod/TechDraw/App/DrawView.pyi +++ b/src/Mod/TechDraw/App/DrawView.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any from Base.Metadata import export diff --git a/src/Mod/TechDraw/App/DrawViewAnnotation.pyi b/src/Mod/TechDraw/App/DrawViewAnnotation.pyi index 504207e028..8aebcc82ab 100644 --- a/src/Mod/TechDraw/App/DrawViewAnnotation.pyi +++ b/src/Mod/TechDraw/App/DrawViewAnnotation.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from TechDraw.Drawview import DrawView diff --git a/src/Mod/TechDraw/App/DrawViewClip.pyi b/src/Mod/TechDraw/App/DrawViewClip.pyi index 0288c0fff0..3b492e2381 100644 --- a/src/Mod/TechDraw/App/DrawViewClip.pyi +++ b/src/Mod/TechDraw/App/DrawViewClip.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any from Base.Metadata import export diff --git a/src/Mod/TechDraw/App/DrawViewCollection.pyi b/src/Mod/TechDraw/App/DrawViewCollection.pyi index 216c7cbfeb..259369729e 100644 --- a/src/Mod/TechDraw/App/DrawViewCollection.pyi +++ b/src/Mod/TechDraw/App/DrawViewCollection.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any from Base.Metadata import export diff --git a/src/Mod/TechDraw/App/DrawViewDimExtent.pyi b/src/Mod/TechDraw/App/DrawViewDimExtent.pyi index e9aeb5b3ba..e242699a7b 100644 --- a/src/Mod/TechDraw/App/DrawViewDimExtent.pyi +++ b/src/Mod/TechDraw/App/DrawViewDimExtent.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any from Base.Metadata import export diff --git a/src/Mod/TechDraw/App/DrawViewDimension.pyi b/src/Mod/TechDraw/App/DrawViewDimension.pyi index 362f33dee1..6d38994dc3 100644 --- a/src/Mod/TechDraw/App/DrawViewDimension.pyi +++ b/src/Mod/TechDraw/App/DrawViewDimension.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any from Base.Metadata import export diff --git a/src/Mod/TechDraw/App/DrawViewPart.pyi b/src/Mod/TechDraw/App/DrawViewPart.pyi index 8cdd911e2c..1f9bdec008 100644 --- a/src/Mod/TechDraw/App/DrawViewPart.pyi +++ b/src/Mod/TechDraw/App/DrawViewPart.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any from Base.Metadata import export diff --git a/src/Mod/TechDraw/App/DrawViewSymbol.pyi b/src/Mod/TechDraw/App/DrawViewSymbol.pyi index b30eefac83..ed3f2ba60f 100644 --- a/src/Mod/TechDraw/App/DrawViewSymbol.pyi +++ b/src/Mod/TechDraw/App/DrawViewSymbol.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any from Base.Metadata import export diff --git a/src/Mod/TechDraw/App/DrawWeldSymbol.pyi b/src/Mod/TechDraw/App/DrawWeldSymbol.pyi index 589aa83a62..a5f9298743 100644 --- a/src/Mod/TechDraw/App/DrawWeldSymbol.pyi +++ b/src/Mod/TechDraw/App/DrawWeldSymbol.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from Base.Metadata import export from TechDraw.DrawView import DrawView diff --git a/src/Mod/TechDraw/App/GeomFormat.pyi b/src/Mod/TechDraw/App/GeomFormat.pyi index a69a9ee5e9..fc1ce35920 100644 --- a/src/Mod/TechDraw/App/GeomFormat.pyi +++ b/src/Mod/TechDraw/App/GeomFormat.pyi @@ -1,3 +1,7 @@ +# SPDX-License: LGPL-2.1-or-later + +from __future__ import annotations + from typing import Any, Final from Base.PyObjectBase import PyObjectBase diff --git a/src/Tools/bindings/model/generateModel_Python.py b/src/Tools/bindings/model/generateModel_Python.py index 1782ffbcc3..a148dd64b6 100644 --- a/src/Tools/bindings/model/generateModel_Python.py +++ b/src/Tools/bindings/model/generateModel_Python.py @@ -14,9 +14,174 @@ from model.typedModel import ( Parameter, ParameterType, SequenceProtocol, + FuncArgument, + ArgumentKind, ) +class FunctionSignature: + """ + Parse function arguments with correct classification and order. + """ + + args: list[FuncArgument] + has_keywords: bool + docstring: str + + const_flag: bool = False + static_flag: bool = False + class_flag: bool = False + noargs_flag: bool = False + is_overload: bool = False + + def __init__(self, func: ast.FunctionDef): + self.args = [] + self.has_keywords = False + self.is_overload = False + self.docstring = ast.get_docstring(func) or "" + + args = func.args + self.update_flags(func) + + self.args.extend( + ( + FuncArgument( + arg.arg, + self.get_annotation_str(arg.annotation), + ArgumentKind.PositionOnly, + ) + for arg in args.posonlyargs + ), + ) + + self.args.extend( + ( + FuncArgument( + arg.arg, + self.get_annotation_str(arg.annotation), + ArgumentKind.Arg, + ) + for arg in args.args + ), + ) + + # tricky part to determine if there are keyword arguments or not + if args.args: + if args.args[0].arg in ("self", "cls"): + instance_args = len(args.args) > 1 + else: + instance_args = True + else: + instance_args = False + + self.has_keywords = bool(instance_args or args.kwonlyargs or args.kwarg) + + if args.vararg: + self.args.append( + FuncArgument( + args.vararg.arg, + self.get_annotation_str(args.vararg.annotation), + ArgumentKind.VarArg, + ), + ) + + self.args.extend( + ( + FuncArgument( + arg.arg, + self.get_annotation_str(arg.annotation), + ArgumentKind.KwOnly, + ) + for arg in args.kwonlyargs + ), + ) + + if args.kwarg: + self.args.append( + FuncArgument( + args.kwarg.arg, + self.get_annotation_str(args.kwarg.annotation), + ArgumentKind.KwArg, + ), + ) + + def get_annotation_str(self, node: ast.AST | None) -> str: + if not node: + return "object" + return ast.unparse(node) + + def update_flags(self, func: ast.FunctionDef) -> None: + for deco in func.decorator_list: + match deco: + case ast.Name(id, _): + name = id + case ast.Attribute(_, attr, _): + name = attr + case _: + continue + + match name: + case "constmethod": + self.const_flag = True + case "classmethod": + self.class_flag = True + case "no_args": + self.noargs_flag = True + case "staticmethod": + self.static_flag = True + case "overload": + self.is_overload = True + + +class Function: + name: str + signatures: list[FunctionSignature] + + def __init__(self, func: ast.FunctionDef) -> None: + self.name = func.name + self.signatures = [FunctionSignature(func)] + + def update(self, func: ast.FunctionDef) -> None: + self.signatures.append(FunctionSignature(func)) + + @property + def docstring(self) -> str: + return "\n".join((f.docstring for f in self.signatures)) + + @property + def has_keywords(self) -> bool: + overloads = len(self.signatures) > 1 + if overloads: + return any( + sig.has_keywords for sig in self.signatures if sig.is_overload + ) + return self.signatures[0].has_keywords + + @property + def signature(self) -> FunctionSignature | None: + """First non overload signature""" + for sig in self.signatures: + if not sig.is_overload: + return sig + return None + + @property + def static_flag(self) -> bool: + return any(sig.static_flag for sig in self.signatures) + + @property + def const_flag(self) -> bool: + return any(sig.const_flag for sig in self.signatures) + + @property + def class_flag(self) -> bool: + return any(sig.class_flag for sig in self.signatures) + + @property + def noargs_flag(self) -> bool: + return any(sig.noargs_flag for sig in self.signatures) + + def _extract_decorator_kwargs(decorator: ast.expr) -> dict: """ Extract keyword arguments from a decorator call like `@export(Father="...", Name="...")`. @@ -146,7 +311,9 @@ def _python_type_to_parameter_type(py_type: str) -> ParameterType: return ParameterType.OBJECT -def _parse_class_attributes(class_node: ast.ClassDef, source_code: str) -> List[Attribute]: +def _parse_class_attributes( + class_node: ast.ClassDef, source_code: str +) -> List[Attribute]: """ Parse top-level attributes (e.g. `TypeId: str = ""`) from the class AST node. We'll create an `Attribute` for each. For the `Documentation` of each attribute, @@ -158,7 +325,11 @@ def _parse_class_attributes(class_node: ast.ClassDef, source_code: str) -> List[ for idx, stmt in enumerate(class_node.body): if isinstance(stmt, ast.AnnAssign): # e.g.: `TypeId: Final[str] = ""` - name = stmt.target.id if isinstance(stmt.target, ast.Name) else "unknown" + name = ( + stmt.target.id + if isinstance(stmt.target, ast.Name) + else "unknown" + ) # Evaluate the type annotation and detect Final for read-only attributes if isinstance(stmt.annotation, ast.Name): # e.g. `str` @@ -201,7 +372,12 @@ def _parse_class_attributes(class_node: ast.ClassDef, source_code: str) -> List[ attr_doc = _parse_docstring_for_documentation(docstring) param = Parameter(Name=name, Type=param_type) - attr = Attribute(Documentation=attr_doc, Parameter=param, Name=name, ReadOnly=readonly) + attr = Attribute( + Documentation=attr_doc, + Parameter=param, + Name=name, + ReadOnly=readonly, + ) attributes.append(attr) return attributes @@ -216,7 +392,7 @@ def _parse_methods(class_node: ast.ClassDef) -> List[Methode]: """ methods = [] - def collect_function_defs(nodes): + def collect_function_defs(nodes) -> list[ast.FunctionDef]: funcs = [] for node in nodes: if isinstance(node, ast.FunctionDef): @@ -226,99 +402,42 @@ def _parse_methods(class_node: ast.ClassDef) -> List[Methode]: funcs.extend(collect_function_defs(node.orelse)) return funcs - for stmt in collect_function_defs(class_node.body): - # Skip methods decorated with @overload - skip_method = False - for deco in stmt.decorator_list: - match deco: - case ast.Name(id="overload"): - skip_method = True - break - case ast.Attribute(attr="overload"): - skip_method = True - break - case _: - pass - if skip_method: - continue + # Collect including overloads + functions: dict[str, Function] = {} + for func_node in collect_function_defs(class_node.body): + if func := functions.get(func_node.name): + func.update(func_node) + else: + functions[func_node.name] = Function(func_node) - # Extract method name - method_name = stmt.name - - # Extract docstring - method_docstring = ast.get_docstring(stmt) or "" - doc_obj = _parse_docstring_for_documentation(method_docstring) - has_keyword_args = False + for func in functions.values(): + doc_obj = _parse_docstring_for_documentation(func.docstring) method_params = [] - # Helper for extracting an annotation string - def get_annotation_str(annotation): - match annotation: - case ast.Name(id=name): - return name - case ast.Attribute(value=ast.Name(id=name), attr=attr): - return f"{name}.{attr}" - case ast.Subscript(value=ast.Name(id=name), slice=_): - return name - case ast.Subscript( - value=ast.Attribute(value=ast.Name(id=name), attr=attr), slice=_ - ): - return f"{name}.{attr}" - case _: - return "object" + signature = func.signature + if signature is None: + continue # Process positional parameters (skipping self/cls) - for arg in stmt.args.args: - param_name = arg.arg - if param_name in ("self", "cls"): + for arg_i, arg in enumerate(signature.args): + param_name = arg.name + if arg_i == 0 and param_name in ("self", "cls"): continue - annotation_str = "object" - if arg.annotation: - annotation_str = get_annotation_str(arg.annotation) - param_type = _python_type_to_parameter_type(annotation_str) + param_type = _python_type_to_parameter_type(arg.annotation) method_params.append(Parameter(Name=param_name, Type=param_type)) - # Process keyword-only parameters - for kwarg in stmt.args.kwonlyargs: - has_keyword_args = True - param_name = kwarg.arg - annotation_str = "object" - if kwarg.annotation: - annotation_str = get_annotation_str(kwarg.annotation) - param_type = _python_type_to_parameter_type(annotation_str) - method_params.append(Parameter(Name=param_name, Type=param_type)) - - if stmt.args.kwarg: - has_keyword_args = True - - keyword_flag = has_keyword_args and not stmt.args.vararg - - # Check for various decorators using any(...) - const_method_flag = any( - isinstance(deco, ast.Name) and deco.id == "constmethod" for deco in stmt.decorator_list - ) - static_method_flag = any( - isinstance(deco, ast.Name) and deco.id == "staticmethod" for deco in stmt.decorator_list - ) - class_method_flag = any( - isinstance(deco, ast.Name) and deco.id == "classmethod" for deco in stmt.decorator_list - ) - no_args = any( - isinstance(deco, ast.Name) and deco.id == "no_args" for deco in stmt.decorator_list - ) - - methode = Methode( - Name=method_name, + method = Methode( + Name=func.name, Documentation=doc_obj, Parameter=method_params, - Const=const_method_flag, - Static=static_method_flag, - Class=class_method_flag, - Keyword=keyword_flag, - NoArgs=no_args, + Const=func.const_flag, + Static=func.static_flag, + Class=func.class_flag, + Keyword=func.has_keywords, + NoArgs=func.noargs_flag, ) - methods.append(methode) + methods.append(method) return methods @@ -457,7 +576,9 @@ def _extract_base_class_name(base: ast.expr) -> str: return base_str -def _parse_class(class_node, source_code: str, path: str, imports_mapping: dict) -> PythonExport: +def _parse_class( + class_node, source_code: str, path: str, imports_mapping: dict +) -> PythonExport: base_class_name = None for base in class_node.bases: base_class_name = _extract_base_class_name(base) @@ -489,7 +610,9 @@ def _parse_class(class_node, source_code: str, path: str, imports_mapping: dict) match args[0]: case ast.Constant(value=val): class_declarations_text = val - case ast.Call(func=ast.Name(id="sequence_protocol"), keywords=_, args=_): + case ast.Call( + func=ast.Name(id="sequence_protocol"), keywords=_, args=_ + ): sequence_protocol_kwargs = _extract_decorator_kwargs(decorator) case _: pass @@ -509,23 +632,33 @@ def _parse_class(class_node, source_code: str, path: str, imports_mapping: dict) native_python_class_name = _get_native_python_class_name(class_node.name) include = _get_module_path(module_name) + "/" + native_class_name + ".h" - father_native_python_class_name = _get_native_python_class_name(base_class_name) + father_native_python_class_name = _get_native_python_class_name( + base_class_name + ) father_include = ( - _get_module_path(parent_module_name) + "/" + father_native_python_class_name + ".h" + _get_module_path(parent_module_name) + + "/" + + father_native_python_class_name + + ".h" ) py_export = PythonExport( Documentation=doc_obj, ModuleName=module_name, - Name=export_decorator_kwargs.get("Name", "") or native_python_class_name, + Name=export_decorator_kwargs.get("Name", "") + or native_python_class_name, PythonName=export_decorator_kwargs.get("PythonName", "") or None, Include=export_decorator_kwargs.get("Include", "") or include, - Father=export_decorator_kwargs.get("Father", "") or father_native_python_class_name, + Father=export_decorator_kwargs.get("Father", "") + or father_native_python_class_name, Twin=export_decorator_kwargs.get("Twin", "") or native_class_name, - TwinPointer=export_decorator_kwargs.get("TwinPointer", "") or native_class_name, + TwinPointer=export_decorator_kwargs.get("TwinPointer", "") + or native_class_name, Namespace=export_decorator_kwargs.get("Namespace", "") or module_name, - FatherInclude=export_decorator_kwargs.get("FatherInclude", "") or father_include, - FatherNamespace=export_decorator_kwargs.get("FatherNamespace", "") or parent_module_name, + FatherInclude=export_decorator_kwargs.get("FatherInclude", "") + or father_include, + FatherNamespace=export_decorator_kwargs.get("FatherNamespace", "") + or parent_module_name, Constructor=export_decorator_kwargs.get("Constructor", False), NumberProtocol=export_decorator_kwargs.get("NumberProtocol", False), RichCompare=export_decorator_kwargs.get("RichCompare", False), diff --git a/src/Tools/bindings/model/typedModel.py b/src/Tools/bindings/model/typedModel.py index 7c60385fe5..baa5d19ab9 100644 --- a/src/Tools/bindings/model/typedModel.py +++ b/src/Tools/bindings/model/typedModel.py @@ -326,3 +326,19 @@ class GenerateModel: # Each method might have parameters for param in meth.Parameter: print(f" * param: {param.Name}, type={param.Type}") + +# Rich Modules + +class ArgumentKind(Enum): + PositionOnly = 0 + Arg = 1 + VarArg = 2 + KwOnly = 3 + KwArg = 4 + +@dataclass +class FuncArgument: + name: str + annotation: str + kind: ArgumentKind +