Skip to content

Commit dd732a3

Browse files
author
Jens Kürten
committed
fix ruff errors
1 parent 9da531b commit dd732a3

File tree

6 files changed

+65
-6
lines changed

6 files changed

+65
-6
lines changed

csfunctions/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,14 @@
77
from .request import Request
88
from .response import DataResponse, ErrorResponse, Response, WorkloadResponse
99
from .service import Service
10+
11+
__all__ = [
12+
"Event",
13+
"MetaData",
14+
"Request",
15+
"Response",
16+
"DataResponse",
17+
"ErrorResponse",
18+
"WorkloadResponse",
19+
"Service",
20+
]

csfunctions/actions/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,11 @@
88

99
ActionUnion = Union[AbortAndShowErrorAction, DummyAction]
1010
Action = Annotated[ActionUnion, Field(discriminator="name")]
11+
12+
__all__ = [
13+
"Action",
14+
"ActionNames",
15+
"DummyAction",
16+
"AbortAndShowErrorAction",
17+
"ActionUnion",
18+
]

csfunctions/events/__init__.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,26 @@
3838
EngineeringChangeReleaseCheckData,
3939
WorkflowTaskTriggerEventData,
4040
]
41+
42+
__all__ = [
43+
"DocumentReleaseEvent",
44+
"DocumentReleaseCheckEvent",
45+
"PartReleaseEvent",
46+
"PartReleaseCheckEvent",
47+
"FieldValueCalculationEvent",
48+
"DummyEvent",
49+
"EngineeringChangeRelease",
50+
"EngineeringChangeReleaseCheck",
51+
"WorkflowTaskTriggerEvent",
52+
"DocumentReleaseData",
53+
"DocumentReleaseCheckData",
54+
"PartReleaseData",
55+
"PartReleaseCheckData",
56+
"FieldValueCalculationData",
57+
"DummyEventData",
58+
"EngineeringChangeReleaseData",
59+
"EngineeringChangeReleaseCheckData",
60+
"WorkflowTaskTriggerEventData",
61+
"DocumentReleaseDialogData",
62+
"PartReleaseDialogData",
63+
]

csfunctions/objects/__init__.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,18 @@
2626
],
2727
Field(discriminator="object_type"),
2828
]
29+
30+
31+
__all__ = [
32+
"Document",
33+
"CADDocument",
34+
"Part",
35+
"File",
36+
"EngineeringChange",
37+
"Material",
38+
"BOMItem",
39+
"ObjectPropertyValue",
40+
"Briefcase",
41+
"Workflow",
42+
"BaseObject",
43+
]

csfunctions/objects/document.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from contextlib import suppress
12
from datetime import date, datetime
23
from typing import TYPE_CHECKING, Literal, Optional
34

@@ -8,10 +9,8 @@
89
from .base import BaseObject, ObjectType
910
from .file import File
1011

11-
try:
12+
with suppress(ImportError):
1213
from .part import Part
13-
except ImportError:
14-
pass
1514

1615
if TYPE_CHECKING:
1716
from csfunctions.events import EventData
@@ -81,6 +80,8 @@ class Document(BaseObject):
8180
part: Optional["Part"] = Field(None, exclude=True)
8281

8382
def link_objects(self, data: "EventData"):
83+
from .part import Part
84+
8485
if self.teilenummer:
8586
parts = get_items_of_type(data, Part)
8687
self._link_part(parts)

csfunctions/objects/part.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from contextlib import suppress
12
from datetime import date, datetime
23
from typing import TYPE_CHECKING, Literal, Optional
34

@@ -10,10 +11,8 @@
1011
if TYPE_CHECKING:
1112
from csfunctions.events import EventData
1213

13-
try:
14+
with suppress(ImportError):
1415
from .document import Document
15-
except ImportError:
16-
pass
1716

1817

1918
class Part(BaseObject):
@@ -82,6 +81,8 @@ class Part(BaseObject):
8281
documents: list["Document"] = Field([], exclude=True)
8382

8483
def link_objects(self, data: "EventData"):
84+
from .document import Document
85+
8586
if self.document_ids:
8687
documents = get_items_of_type(data, Document)
8788
self._link_documents(documents)

0 commit comments

Comments
 (0)