[bindings] remove redundant signatures. batch1

This commit is contained in:
Frank Martinez
2025-10-10 14:09:50 -05:00
parent d8b1a36e19
commit fc99a20a03
34 changed files with 194 additions and 668 deletions

View File

@@ -78,13 +78,13 @@ class DocumentObject(ExtensionContainer):
enum_vals: list = [],
) -> "DocumentObject":
"""
addProperty(type: string, name: string, group="", doc="", attr=0, read_only=False, hidden=False, locked = False, enum_vals=[]) -- Add a generic property.
Add a generic property.
"""
...
def removeProperty(self, string: str, /) -> None:
"""
removeProperty(string) -- Remove a generic property.
Remove a generic property.
Note, you can only remove user-defined properties but not built-in ones.
"""
@@ -135,7 +135,7 @@ class DocumentObject(ExtensionContainer):
def recompute(self, recursive: bool = False, /) -> None:
"""
recompute(recursive=False): Recomputes this object
Recomputes this object
"""
...
@@ -166,8 +166,6 @@ class DocumentObject(ExtensionContainer):
depth: int = 0,
) -> Any:
"""
getSubObject(subname, retType=0, matrix=None, transform=True, depth=0)
* subname(string|list|tuple): dot separated string or sequence of strings
referencing subobject.
@@ -196,15 +194,13 @@ class DocumentObject(ExtensionContainer):
def getSubObjectList(self, subname: str, /) -> list:
"""
getSubObjectList(subname)
Return a list of objects referenced by a given subname including this object
"""
...
def getSubObjects(self, reason: int = 0, /) -> list:
"""
getSubObjects(reason=0): Return subname reference of all sub-objects
Return subname reference of all sub-objects
"""
...
@@ -217,7 +213,6 @@ class DocumentObject(ExtensionContainer):
depth: int = 0,
) -> Any:
"""
getLinkedObject(recursive=True, matrix=None, transform=True, depth=0)
Returns the linked object if there is one, or else return itself
* recursive: whether to recursively resolve the links
@@ -234,14 +229,14 @@ class DocumentObject(ExtensionContainer):
def setElementVisible(self, element: str, visible: bool, /) -> int:
"""
setElementVisible(element,visible): Set the visibility of a child element
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:
"""
isElementVisible(element): Check if a child element is visible
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
"""
...
@@ -288,7 +283,7 @@ class DocumentObject(ExtensionContainer):
@constmethod
def resolve(self, subname: str, /) -> tuple:
"""
resolve(subname) -- resolve the sub object
resolve the sub object
Returns a tuple (subobj,parent,elementName,subElement), where 'subobj' is the
last object referenced in 'subname', and 'parent' is the direct parent of
@@ -301,7 +296,7 @@ class DocumentObject(ExtensionContainer):
@constmethod
def resolveSubElement(self, subname: str, append: bool, type: int, /) -> tuple:
"""
resolveSubElement(subname,append,type) -- resolve both new and old style sub element
resolve both new and old style sub element
subname: subname reference containing object hierarchy
append: Whether to append object hierarchy prefix inside subname to returned element name
@@ -313,22 +308,20 @@ class DocumentObject(ExtensionContainer):
def adjustRelativeLinks(self, parent: DocumentObject, recursive: bool = True, /) -> bool:
"""
adjustRelativeLinks(parent,recursive=True) -- auto correct potential cyclic dependencies
auto correct potential cyclic dependencies
"""
...
@constmethod
def getElementMapVersion(self, property_name: str, /) -> str:
"""
getElementMapVersion(property_name): return element map version of a given geometry property
return element map version of a given geometry property
"""
...
@constmethod
def isAttachedToDocument(self) -> bool:
"""
isAttachedToDocument() -> bool
Return true if the object is part of a document, false otherwise.
"""
...

View File

@@ -23,8 +23,6 @@ class GeoFeature(DocumentObject):
def getPaths(self) -> Any:
"""
getPaths()
Returns all possible paths to the root of the document.
Note: Not implemented.
"""
@@ -32,7 +30,6 @@ class GeoFeature(DocumentObject):
def getGlobalPlacement(self) -> Placement:
"""
getGlobalPlacement() -> Base.Placement
Deprecated: This function does not handle Links correctly. Use getGlobalPlacementOf instead.
Returns the placement of the object in the global coordinate space, respecting all stacked
@@ -45,14 +42,16 @@ class GeoFeature(DocumentObject):
@staticmethod
def getGlobalPlacementOf(targetObj: Any, rootObj: Any, subname: str, /) -> Placement:
"""
getGlobalPlacementOf(targetObj, rootObj, subname) -> Base.Placement
Selection example: obj = "part1" sub = "linkToPart2.LinkToBody.Pad.face1"
Examples:
obj = "part1"
sub = "linkToPart2.LinkToBody.Pad.face1"
Global placement of Pad in this context :
getGlobalPlacementOf(pad, part1, "linkToPart2.LinkToBody.Pad.face1")
Global placement of Pad in this context:
getGlobalPlacementOf(pad, part1, "linkToPart2.LinkToBody.Pad.face1")
Global placement of linkToPart2 in this context :
getGlobalPlacementOf(linkToPart2, part1, "linkToPart2.LinkToBody.Pad.face1")
Global placement of linkToPart2 in this context:
getGlobalPlacementOf(linkToPart2, part1, "linkToPart2.LinkToBody.Pad.face1")
Returns the placement of the object in the global coordinate space, respecting all stacked
relationships.
@@ -61,8 +60,6 @@ class GeoFeature(DocumentObject):
def getPropertyNameOfGeometry(self) -> Optional[str]:
"""
getPropertyNameOfGeometry() -> str or None
Returns the property name of the actual geometry.
For example for a Part feature it returns the value 'Shape', for a mesh feature the value
'Mesh' and so on.
@@ -72,8 +69,6 @@ class GeoFeature(DocumentObject):
def getPropertyOfGeometry(self) -> Optional[Any]:
"""
getPropertyOfGeometry() -> object or None
Returns the property of the actual geometry.
For example for a Part feature it returns its Shape property, for a Mesh feature its
Mesh property and so on.

View File

@@ -72,8 +72,6 @@ class GroupExtension(DocumentObjectExtension):
def hasObject(self, obj: Any, recursive: bool = False, /) -> bool:
"""
hasObject(obj, recursive=false)
Checks if the group has a given object
@param obj the object to check for.
@param recursive if true check also if the obj is child of some sub group (default is false).

View File

@@ -18,15 +18,18 @@ class LinkBaseExtension(DocumentObjectExtension):
LinkedChildren: Final[List[Any]] = []
"""Return a flattened (in case grouped by plain group) list of linked children"""
def configLinkProperty(self, **kwargs) -> Any:
def configLinkProperty(self, *args, **kwargs) -> Any:
"""
configLinkProperty(key=val,...): property configuration
configLinkProperty(key,...): property configuration with default name
Examples:
Called with default names:
configLinkProperty(prop1, prop2, ..., propN)
Called with custom names:
configLinkProperty(prop1=val1, prop2=val2, ..., propN=valN)
This methode is here to implement what I called Property Design
This method is here to implement what I called Property Design
Pattern. The extension operates on a predefined set of properties,
but it relies on the extended object to supply the actual property by
calling this methode. You can choose a sub set of functionality of
calling this method. You can choose a sub set of functionality of
this extension by supplying only some of the supported properties.
The 'key' are names used to refer to properties supported by this
@@ -45,35 +48,34 @@ class LinkBaseExtension(DocumentObjectExtension):
def getLinkExtProperty(self, name: str, /) -> Any:
"""
getLinkExtProperty(name): return the property value by its predefined name
return the property value by its predefined name
"""
...
def getLinkExtPropertyName(self, name: str, /) -> str:
"""
getLinkExtPropertyName(name): lookup the property name by its predefined name
lookup the property name by its predefined name
"""
...
@overload
def getLinkPropertyInfo(self, /) -> tuple:
def getLinkPropertyInfo(self, /) -> tuple[tuple[str, str, str]]:
...
@overload
def getLinkPropertyInfo(self, index: int, /) -> tuple:
def getLinkPropertyInfo(self, index: int, /) -> tuple[str, str, str]:
...
@overload
def getLinkPropertyInfo(self, name: str, /) -> tuple:
def getLinkPropertyInfo(self, name: str, /) -> tuple[str, str]:
...
def getLinkPropertyInfo(self, arg: Any = None, /) -> tuple:
"""
getLinkPropertyInfo(): return a tuple of (name,type,doc) for all supported properties.
getLinkPropertyInfo(index): return (name,type,doc) of a specific property
getLinkPropertyInfo(name): return (type,doc) of a specific property
Overloads:
(): return (name,type,doc) for all supported properties.
(index): return (name,type,doc) of a specific property
(name): return (type,doc) of a specific property
"""
...
@@ -85,12 +87,7 @@ class LinkBaseExtension(DocumentObjectExtension):
/,
) -> None:
"""
setLink(obj,subName=None,subElements=None): Set link object.
setLink([obj,...]),
setLink([(obj,subName,subElements),...]),
setLink({index:obj,...}),
setLink({index:(obj,subName,subElements),...}): set link element of a link group.
Called with only obj, set link object, otherwise set link element of a link group.
obj (DocumentObject): the object to link to. If this is None, then the link is cleared
@@ -102,7 +99,7 @@ class LinkBaseExtension(DocumentObjectExtension):
def cacheChildLabel(self, enable: bool = True, /) -> None:
"""
cacheChildLabel(enable=True): enable/disable child label cache
enable/disable child label cache
The cache is not updated on child label change for performance reason. You must
call this function on any child label change
@@ -111,16 +108,12 @@ class LinkBaseExtension(DocumentObjectExtension):
def flattenSubname(self, subname: str, /) -> str:
"""
flattenSubname(subname) -> string
Return a flattened subname in case it references an object inside a linked plain group
"""
...
def expandSubname(self, subname: str, /) -> str:
"""
expandSubname(subname) -> string
Return an expanded subname in case it references an object inside a linked plain group
"""
...

View File

@@ -27,8 +27,6 @@ class MeasureManager(PyObjectBase):
@staticmethod
def addMeasureType(id: str, label: str, measureType: MeasureType, /) -> None:
"""
addMeasureType(id, label, measureType) -> None
Add a new measure type.
id : str
@@ -44,8 +42,6 @@ class MeasureManager(PyObjectBase):
@no_args
def getMeasureTypes() -> List[Tuple[str, str, MeasureType]]:
"""
getMeasureTypes() -> List[(id, label, pythonMeasureType)]
Returns a list of all registered measure types.
"""
...

View File

@@ -191,8 +191,6 @@ class Metadata(PyObjectBase):
def getLastSupportedFreeCADVersion(self) -> Optional[str]:
"""
getLastSupportedFreeCADVersion() -> str or None
Search through all content package items, and determine if a maximum supported
version of FreeCAD is set.
Returns None if no maximum version is set, or if *any* content item fails to
@@ -203,8 +201,6 @@ class Metadata(PyObjectBase):
def getFirstSupportedFreeCADVersion(self) -> Optional[str]:
"""
getFirstSupportedFreeCADVersion() -> str or None
Search through all content package items, and determine if a minimum supported
version of FreeCAD is set.
Returns 0.0 if no minimum version is set, or if *any* content item fails to
@@ -216,8 +212,6 @@ class Metadata(PyObjectBase):
def supportsCurrentFreeCAD(self) -> bool:
"""
supportsCurrentFreeCAD() -> bool
Returns False if this metadata object directly indicates that it does not
support the current version of FreeCAD, or True if it makes no indication, or
specifically indicates that it does support the current version. Does not
@@ -227,8 +221,6 @@ class Metadata(PyObjectBase):
def getGenericMetadata(self, name: str, /) -> List[Any]:
"""
getGenericMetadata(name) -> list
Get the list of GenericMetadata objects with key 'name'.
Generic metadata objects are Python objects with a string 'contents' and a
dictionary of strings, 'attributes'. They represent unrecognized simple XML tags
@@ -238,56 +230,42 @@ class Metadata(PyObjectBase):
def addContentItem(self, content_type: str, metadata: "Metadata", /) -> None:
"""
addContentItem(content_type,metadata)
Add a new content item of type 'content_type' with metadata 'metadata'.
"""
...
def removeContentItem(self, content_type: str, name: str, /) -> None:
"""
removeContentItem(content_type,name)
Remove the content item of type 'content_type' with name 'name'.
"""
...
def addMaintainer(self, name: str, email: str, /) -> None:
"""
addMaintainer(name, email)
Add a new Maintainer.
"""
...
def removeMaintainer(self, name: str, email: str, /) -> None:
"""
removeMaintainer(name, email)
Remove the Maintainer.
"""
...
def addLicense(self, short_code: str, path: str, /) -> None:
"""
addLicense(short_code,path)
Add a new License.
"""
...
def removeLicense(self, short_code: str, /) -> None:
"""
removeLicense(short_code)
Remove the License.
"""
...
def addUrl(self, url_type: str, url: str, branch: str, /) -> None:
"""
addUrl(url_type,url,branch)
Add a new Url or type 'url_type' (which should be one of 'repository', 'readme',
'bugtracker', 'documentation', or 'webpage') If type is 'repository' you
@@ -298,32 +276,24 @@ class Metadata(PyObjectBase):
def removeUrl(self, url_type: str, url: str, /) -> None:
"""
removeUrl(url_type,url)
Remove the Url.
"""
...
def addAuthor(self, name: str, email: str, /) -> None:
"""
addAuthor(name, email)
Add a new Author with name 'name', and optionally email 'email'.
"""
...
def removeAuthor(self, name: str, email: str, /) -> None:
"""
removeAuthor(name, email)
Remove the Author.
"""
...
def addDepend(self, name: str, kind: str, optional: bool, /) -> None:
"""
addDepend(name, kind, optional)
Add a new Dependency on package 'name' of kind 'kind' (optional, one of 'auto' (the default),
'internal', 'addon', or 'python').
@@ -332,8 +302,6 @@ class Metadata(PyObjectBase):
def removeDepend(self, name: str, kind: str, /) -> None:
"""
removeDepend(name, kind)
Remove the Dependency on package 'name' of kind 'kind' (optional - if unspecified any
matching name is removed).
@@ -342,72 +310,54 @@ class Metadata(PyObjectBase):
def addConflict(self, name: str, kind: str, /) -> None:
"""
addConflict(name, kind)
Add a new Conflict. See documentation for addDepend().
"""
...
def removeConflict(self, name: str, kind: str, /) -> None:
"""
removeConflict(name, kind)
Remove the Conflict. See documentation for removeDepend().
"""
...
def addReplace(self, name: str, /) -> None:
"""
addReplace(name)
Add a new Replace.
"""
...
def removeReplace(self, name: str, /) -> None:
"""
removeReplace(name)
Remove the Replace.
"""
...
def addTag(self, tag: str, /) -> None:
"""
addTag(tag)
Add a new Tag.
"""
...
def removeTag(self, tag: str, /) -> None:
"""
removeTag(tag)
Remove the Tag.
"""
...
def addFile(self, filename: str, /) -> None:
"""
addFile(filename)
Add a new File.
"""
...
def removeFile(self, filename: str, /) -> None:
"""
removeFile(filename)
Remove the File.
"""
...
def write(self, filename: str, /) -> None:
"""
write(filename)
Write the metadata to the given file as XML data.
"""
...

View File

@@ -18,8 +18,6 @@ class PropertyContainer(Persistence):
def getPropertyByName(self, name: str, checkOwner: int = 0, /) -> Any:
"""
getPropertyByName(name, checkOwner=0) -> object or Tuple
Returns the value of a named property. Note that the returned property may not
always belong to this container (e.g. from a linked object).
@@ -34,8 +32,6 @@ class PropertyContainer(Persistence):
def getPropertyTouchList(self, name: str, /) -> tuple:
"""
getPropertyTouchList(name) -> tuple
Returns a list of index of touched values for list type properties.
name : str
@@ -45,8 +41,6 @@ class PropertyContainer(Persistence):
def getTypeOfProperty(self, name: str, /) -> list:
"""
getTypeOfProperty(name) -> list
Returns the type of a named property. This can be a list conformed by elements in
(Hidden, NoRecompute, NoPersist, Output, ReadOnly, Transient).
@@ -57,8 +51,6 @@ class PropertyContainer(Persistence):
def getTypeIdOfProperty(self, name: str, /) -> str:
"""
getTypeIdOfProperty(name) -> str
Returns the C++ class name of a named property.
name : str
@@ -68,8 +60,6 @@ class PropertyContainer(Persistence):
def setEditorMode(self, name: str, type: Union[int, List[str]], /) -> None:
"""
setEditorMode(name, type) -> None
Set the behaviour of the property in the property editor.
name : str
@@ -83,8 +73,6 @@ class PropertyContainer(Persistence):
def getEditorMode(self, name: str, /) -> list:
"""
getEditorMode(name) -> list
Get the behaviour of the property in the property editor.
It returns a list of strings with the current mode. If the list is empty there are no
special restrictions.
@@ -99,8 +87,6 @@ class PropertyContainer(Persistence):
def getGroupOfProperty(self, name: str, /) -> str:
"""
getGroupOfProperty(name) -> str
Returns the name of the group which the property belongs to in this class.
The properties are sorted in different named groups for convenience.
@@ -111,8 +97,6 @@ class PropertyContainer(Persistence):
def setGroupOfProperty(self, name: str, group: str, /) -> None:
"""
setGroupOfProperty(name, group) -> None
Set the name of the group of a dynamic property.
name : str
@@ -124,8 +108,6 @@ class PropertyContainer(Persistence):
def setPropertyStatus(self, name: str, val: Union[int, str, List[Union[str, int]]], /) -> None:
"""
setPropertyStatus(name, val) -> None
Set property status.
name : str
@@ -138,8 +120,6 @@ class PropertyContainer(Persistence):
def getPropertyStatus(self, name: str = "", /) -> list:
"""
getPropertyStatus(name='') -> list
Get property status.
name : str
@@ -149,8 +129,6 @@ class PropertyContainer(Persistence):
def getDocumentationOfProperty(self, name: str, /) -> str:
"""
getDocumentationOfProperty(name) -> str
Returns the documentation string of the property of this class.
name : str
@@ -160,8 +138,6 @@ class PropertyContainer(Persistence):
def setDocumentationOfProperty(self, name: str, docstring: str, /) -> None:
"""
setDocumentationOfProperty(name, docstring) -> None
Set the documentation string of a dynamic property of this class.
name : str
@@ -173,8 +149,6 @@ class PropertyContainer(Persistence):
def getEnumerationsOfProperty(self, name: str, /) -> Optional[list]:
"""
getEnumerationsOfProperty(name) -> list or None
Return all enumeration strings of the property of this class or None if not a
PropertyEnumeration.
@@ -186,8 +160,6 @@ class PropertyContainer(Persistence):
@constmethod
def dumpPropertyContent(self, Property: str, *, Compression: int = 3) -> bytearray:
"""
dumpPropertyContent(Property, Compression=3) -> bytearray
Dumps the content of the property, both the XML representation and the additional
data files required, into a byte representation.
@@ -200,8 +172,6 @@ class PropertyContainer(Persistence):
def restorePropertyContent(self, name: str, obj: object, /) -> None:
"""
restorePropertyContent(name, obj) -> None
Restore the content of the object from a byte representation as stored by `dumpPropertyContent`.
It could be restored from any Python object implementing the buffer protocol.
@@ -215,8 +185,6 @@ class PropertyContainer(Persistence):
@constmethod
def renameProperty(self, oldName: str, newName: str, /) -> None:
"""
renameProperty(oldName, newName) -> None
Rename a property.
oldName : str

View File

@@ -29,8 +29,6 @@ class StringHasher(BaseClass):
def getID(self, arg: Any, base64: bool = False, /) -> Any:
"""
getID(txt|id, base64=False) -> StringID
If the input is text, return a StringID object that is unique within this hasher. This
StringID object is reference counted. The hasher may only save hash ID's that are used.