black formatting

This commit is contained in:
Frank Martinez
2025-09-26 13:23:01 -05:00
parent 8e51db4072
commit 591e8a36b3
205 changed files with 381 additions and 853 deletions

View File

@@ -4,7 +4,6 @@ from __future__ import annotations
from Base.PyObjectBase import PyObjectBase
class ApplicationDirectories(PyObjectBase):
"""
Provides access to the directory versioning methods of its C++ counterpart.

View File

@@ -12,7 +12,6 @@ from Base.Matrix import Matrix
from StringHasher import StringHasher
from typing import Any, Final
@export(
Namespace="Data",
Reference=True,
@@ -37,14 +36,18 @@ class ComplexGeoData(Persistence):
...
@constmethod
def getFacesFromSubElement(self,) -> tuple[list[Vector], list[tuple[int, int, int]]]:
def getFacesFromSubElement(
self,
) -> tuple[list[Vector], list[tuple[int, int, int]]]:
"""
Return vertexes and faces from a sub-element.
"""
...
@constmethod
def getLinesFromSubElement(self,) -> tuple[list[Vector], list[tuple[int, int]]]:
def getLinesFromSubElement(
self,
) -> tuple[list[Vector], list[tuple[int, int]]]:
"""
Return vertexes and lines from a sub-element.
"""
@@ -133,7 +136,6 @@ class ComplexGeoData(Persistence):
Return the mapped element name
"""
...
BoundBox: Final[BoundBox] = ...
"""Get the bounding box (BoundBox) of the complex geometric data."""

View File

@@ -6,7 +6,6 @@ from PropertyContainer import PropertyContainer
from DocumentObject import DocumentObject
from typing import Final, Sequence
class Document(PropertyContainer):
"""
This is the Document class.

View File

@@ -9,7 +9,6 @@ from DocumentObjectGroup import DocumentObjectGroup
from ExtensionContainer import ExtensionContainer
from typing import Any, Final, List, Optional, Union, Tuple
class DocumentObject(ExtensionContainer):
"""
This is the father of all classes handled by the document
@@ -75,7 +74,7 @@ class DocumentObject(ExtensionContainer):
read_only: bool = False,
hidden: bool = False,
locked: bool = False,
enum_vals: list = []
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.

View File

@@ -4,11 +4,11 @@ from __future__ import annotations
from Extension import Extension
class DocumentObjectExtension(Extension):
"""
Base class for all document object extensions
Author: Stefan Troeger (stefantroeger@gmx.net)
Licence: LGPL
"""
...

View File

@@ -4,11 +4,11 @@ from __future__ import annotations
from DocumentObject import DocumentObject
class DocumentObjectGroup(DocumentObject):
"""
This class handles document objects in group
Author: Werner Mayer (wmayer@users.sourceforge.net)
Licence: LGPL
"""
...

View File

@@ -5,7 +5,6 @@ from __future__ import annotations
from typing import Final, Any
from Base.PyObjectBase import PyObjectBase
class Extension(PyObjectBase):
"""
Base class for all extensions

View File

@@ -5,7 +5,6 @@ from __future__ import annotations
from Base.Metadata import export, constmethod
from PropertyContainer import PropertyContainer
@export(
Initialization=True,
Constructor=True,

View File

@@ -6,7 +6,6 @@ from DocumentObject import DocumentObject
from Base import Placement
from typing import Any, Final, Optional
class GeoFeature(DocumentObject):
"""
App.GeoFeature class.

View File

@@ -4,11 +4,11 @@ from __future__ import annotations
from GroupExtension import GroupExtension
class GeoFeatureGroupExtension(GroupExtension):
"""
Author: Werner Mayer (wmayer@users.sourceforge.net)
Licence: LGPL
This class handles placeable group of document objects
"""
...

View File

@@ -6,8 +6,9 @@ from Base.Metadata import export
from DocumentObjectExtension import DocumentObjectExtension
from typing import Any, List
@export(Include="App/DocumentObjectGroup.h",)
@export(
Include="App/DocumentObjectGroup.h",
)
class GroupExtension(DocumentObjectExtension):
"""
Extension class which allows grouping of document objects

View File

@@ -6,8 +6,9 @@ from Base.Metadata import export
from DocumentObjectExtension import DocumentObjectExtension
from typing import Any, Final, List, Tuple, Optional, Union, overload
@export(Include="App/Link.h",)
@export(
Include="App/Link.h",
)
class LinkBaseExtension(DocumentObjectExtension):
"""
Link extension base class
@@ -45,28 +46,22 @@ class LinkBaseExtension(DocumentObjectExtension):
def getLinkExtProperty(self, name: str, /) -> Any:
"""
getLinkExtProperty(name): return the property value by its predefined name
getLinkExtProperty(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
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:
"""
getLinkPropertyInfo(): return a tuple of (name,type,doc) for all supported properties.
@@ -82,7 +77,7 @@ class LinkBaseExtension(DocumentObjectExtension):
obj: Any,
subName: Optional[str] = None,
subElements: Optional[Union[str, Tuple[str, ...]]] = None,
/
/,
) -> None:
"""
setLink(obj,subName=None,subElements=None): Set link object.

View File

@@ -6,14 +6,15 @@ from Base.Metadata import export, class_declarations
from Base.PyObjectBase import PyObjectBase
from typing import Any, overload
@export(
Constructor=True,
Delete=True,
)
@class_declarations("""public:
@class_declarations(
"""public:
static Base::Color toColor(PyObject* value);
""")
"""
)
class Material(PyObjectBase):
"""
App.Material class.
@@ -24,9 +25,7 @@ class Material(PyObjectBase):
"""
@overload
def __init__(self, *args: Any, **kwargs: Any) -> None:
...
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
def set(self, string: str, /) -> None:
"""
Set(string) -- Set the material.
@@ -36,7 +35,6 @@ class Material(PyObjectBase):
Satin, Metalized, Neon GNC, Chrome, Aluminium, Obsidian, Neon PHC, Jade, Ruby or Emerald.
"""
...
AmbientColor: Any = ...
"""Ambient color"""

View File

@@ -8,7 +8,6 @@ from typing import List, Tuple, TypeAlias
MeasureType: TypeAlias = object
@export(
Constructor=False,
Delete=True,

View File

@@ -6,7 +6,6 @@ from Base.Metadata import export, class_declarations
from Base.PyObjectBase import PyObjectBase
from typing import Any, List, Dict, overload, Optional
@export(
Constructor=True,
Delete=True,
@@ -53,20 +52,13 @@ class Metadata(PyObjectBase):
"""
@overload
def __init__(self) -> None:
...
def __init__(self) -> None: ...
@overload
def __init__(self, metadata: "Metadata") -> None:
...
def __init__(self, metadata: "Metadata") -> None: ...
@overload
def __init__(self, file: str) -> None:
...
def __init__(self, file: str) -> None: ...
@overload
def __init__(self, bytes: bytes) -> None:
...
def __init__(self, bytes: bytes) -> None: ...
Name: str = ""
"""String representing the name of this item."""

View File

@@ -4,11 +4,11 @@ from __future__ import annotations
from GeoFeatureGroupExtension import GeoFeatureGroupExtension
class OriginGroupExtension(GeoFeatureGroupExtension):
"""
Author: Alexander Golubev (fatzer2@gmail.com)
Licence: LGPL
This class handles placable group of document objects with an Origin
"""
...

View File

@@ -4,11 +4,11 @@ from __future__ import annotations
from GeoFeature import GeoFeature
class Part(GeoFeature):
"""
Author: Juergen Riegel (FreeCAD@juergen-riegel.net)
Licence: LGPL
This class handles document objects in Part
"""
...

View File

@@ -6,8 +6,9 @@ from Base.Metadata import export, constmethod
from Base.Persistence import Persistence
from typing import Any, Final, Union, List, Optional
@export(DisableNotify=True,)
@export(
DisableNotify=True,
)
class PropertyContainer(Persistence):
"""
App.PropertyContainer class.

View File

@@ -6,7 +6,6 @@ from Base.Metadata import export, constmethod
from Base.BaseClass import BaseClass
from typing import Any, Final, overload, Dict
@export(
Constructor=True,
Reference=True,
@@ -20,9 +19,7 @@ class StringHasher(BaseClass):
"""
@overload
def __init__(self, *args: Any, **kwargs: Any) -> None:
...
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
def getID(self, arg: Any, base64: bool = False, /) -> Any:
"""
getID(txt|id, base64=False) -> StringID
@@ -38,20 +35,15 @@ 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:
"""
Check if two hasher are the same
"""
...
Count: Final[int] = 0
"""Return count of used hashes"""

View File

@@ -6,15 +6,16 @@ from Base.Metadata import export, constmethod, class_declarations
from Base.BaseClass import BaseClass
from typing import Any, Final, List
@export(
Include="App/StringHasher.h",
Reference=True,
)
@class_declarations("""private:
@class_declarations(
"""private:
friend class StringID;
int _index = 0;
""")
"""
)
class StringID(BaseClass):
"""
This is the StringID class
@@ -29,7 +30,6 @@ class StringID(BaseClass):
Check if two StringIDs are the same
"""
...
Value: Final[int] = 0
"""Return the integer value of this ID"""

View File

@@ -4,11 +4,11 @@ from __future__ import annotations
from DocumentObjectExtension import DocumentObjectExtension
class SuppressibleExtension(DocumentObjectExtension):
"""
Author: Florian Foinant-Willig (flachyjoe@users.sourceforge.net)
Licence: LGPL
Extension class which allows suppressing of document objects
"""
...