Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d4513d75f9 | |||
| ef5a570dd4 | |||
| 424d7d9caf | |||
| 6aa643837a | |||
| 32cbb33e10 |
+2
-5
@@ -6,7 +6,7 @@ services:
|
||||
# Speckle Server dependencies
|
||||
#######
|
||||
postgres:
|
||||
image: "postgres:16-alpine"
|
||||
image: "postgres:16.4-alpine3.20@sha256:d898b0b78a2627cb4ee63464a14efc9d296884f1b28c841b0ab7d7c42f1fffdf"
|
||||
restart: always
|
||||
environment:
|
||||
POSTGRES_DB: speckle
|
||||
@@ -49,10 +49,6 @@ services:
|
||||
retries: 30
|
||||
start_period: 10s
|
||||
|
||||
####
|
||||
# Speckle Server
|
||||
#######
|
||||
|
||||
speckle-server:
|
||||
image: speckle/speckle-server:latest
|
||||
restart: always
|
||||
@@ -79,6 +75,7 @@ services:
|
||||
# TODO: Change this to the URL of the speckle server, as accessed from the network
|
||||
CANONICAL_URL: "http://127.0.0.1:8080"
|
||||
SPECKLE_AUTOMATE_URL: "http://127.0.0.1:3030"
|
||||
FRONTEND_ORIGIN: "http://127.0.0.1:8081"
|
||||
|
||||
# TODO: Change thvolumes:
|
||||
REDIS_URL: "redis://redis"
|
||||
|
||||
+1
-1
@@ -79,7 +79,7 @@ ignore = ["UP006", "UP007", "UP035"]
|
||||
[[tool.uv.index]]
|
||||
name = "pypi"
|
||||
url = "https://pypi.org/simple/"
|
||||
publish-url = "https://pypi.org/legacy/"
|
||||
publish-url = "https://upload.pypi.org/legacy/"
|
||||
|
||||
[[tool.uv.index]]
|
||||
name = "test"
|
||||
|
||||
@@ -332,7 +332,7 @@ class AutomationContext:
|
||||
def attach_error_to_objects(
|
||||
self,
|
||||
category: str,
|
||||
object_ids: Union[str, List[str]],
|
||||
objects: Union[Base, List[Base]],
|
||||
message: Optional[str] = None,
|
||||
metadata: Optional[Dict[str, Any]] = None,
|
||||
visual_overrides: Optional[Dict[str, Any]] = None,
|
||||
@@ -351,7 +351,7 @@ class AutomationContext:
|
||||
self.attach_result_to_objects(
|
||||
ObjectResultLevel.ERROR,
|
||||
category,
|
||||
object_ids,
|
||||
objects,
|
||||
message,
|
||||
metadata,
|
||||
visual_overrides,
|
||||
@@ -360,7 +360,7 @@ class AutomationContext:
|
||||
def attach_warning_to_objects(
|
||||
self,
|
||||
category: str,
|
||||
object_ids: Union[str, List[str]],
|
||||
objects: Union[Base, List[Base]],
|
||||
message: Optional[str] = None,
|
||||
metadata: Optional[Dict[str, Any]] = None,
|
||||
visual_overrides: Optional[Dict[str, Any]] = None,
|
||||
@@ -369,7 +369,7 @@ class AutomationContext:
|
||||
self.attach_result_to_objects(
|
||||
ObjectResultLevel.WARNING,
|
||||
category,
|
||||
object_ids,
|
||||
objects,
|
||||
message,
|
||||
metadata,
|
||||
visual_overrides,
|
||||
@@ -378,7 +378,7 @@ class AutomationContext:
|
||||
def attach_success_to_objects(
|
||||
self,
|
||||
category: str,
|
||||
object_ids: Union[str, List[str]],
|
||||
objects: Union[Base, List[Base]],
|
||||
message: Optional[str] = None,
|
||||
metadata: Optional[Dict[str, Any]] = None,
|
||||
visual_overrides: Optional[Dict[str, Any]] = None,
|
||||
@@ -387,7 +387,7 @@ class AutomationContext:
|
||||
self.attach_result_to_objects(
|
||||
ObjectResultLevel.SUCCESS,
|
||||
category,
|
||||
object_ids,
|
||||
objects,
|
||||
message,
|
||||
metadata,
|
||||
visual_overrides,
|
||||
@@ -396,7 +396,7 @@ class AutomationContext:
|
||||
def attach_info_to_objects(
|
||||
self,
|
||||
category: str,
|
||||
object_ids: Union[str, List[str]],
|
||||
objects: Union[Base, List[Base]],
|
||||
message: Optional[str] = None,
|
||||
metadata: Optional[Dict[str, Any]] = None,
|
||||
visual_overrides: Optional[Dict[str, Any]] = None,
|
||||
@@ -405,7 +405,7 @@ class AutomationContext:
|
||||
self.attach_result_to_objects(
|
||||
ObjectResultLevel.INFO,
|
||||
category,
|
||||
object_ids,
|
||||
objects,
|
||||
message,
|
||||
metadata,
|
||||
visual_overrides,
|
||||
@@ -415,19 +415,22 @@ class AutomationContext:
|
||||
self,
|
||||
level: ObjectResultLevel,
|
||||
category: str,
|
||||
object_ids: Union[str, List[str]],
|
||||
objects: Union[Base, List[Base]],
|
||||
message: Optional[str] = None,
|
||||
metadata: Optional[Dict[str, Any]] = None,
|
||||
visual_overrides: Optional[Dict[str, Any]] = None,
|
||||
) -> None:
|
||||
if isinstance(object_ids, list):
|
||||
if len(object_ids) < 1:
|
||||
if isinstance(objects, list):
|
||||
if len(objects) < 1:
|
||||
raise ValueError(
|
||||
f"Need atleast one object_id to report a(n) {level.value.upper()}"
|
||||
)
|
||||
id_list = object_ids
|
||||
id_list = [o.id for o in objects]
|
||||
application_ids = [o.applicationId for o in objects]
|
||||
else:
|
||||
id_list = [object_ids]
|
||||
id_list = [objects.id]
|
||||
application_ids = [objects.applicationId]
|
||||
metadata["applicationIds"] = application_ids
|
||||
print(
|
||||
f"Created new {level.value.upper()}"
|
||||
f" category: {category} caused by: {message}"
|
||||
|
||||
@@ -9,7 +9,7 @@ from specklepy.objects.other import RenderMaterial
|
||||
@dataclass(kw_only=True)
|
||||
class ColorProxy(
|
||||
Base,
|
||||
speckle_type="Models.Proxies.ColorProxy",
|
||||
speckle_type="Speckle.Core.Models.Proxies.ColorProxy",
|
||||
detachable={"objects"},
|
||||
):
|
||||
objects: List[str]
|
||||
@@ -20,7 +20,7 @@ class ColorProxy(
|
||||
@dataclass(kw_only=True)
|
||||
class GroupProxy(
|
||||
Base,
|
||||
speckle_type="Models.Proxies.GroupProxy",
|
||||
speckle_type="Speckle.Core.Models.Proxies.GroupProxy",
|
||||
detachable={"objects"},
|
||||
):
|
||||
objects: List[str]
|
||||
@@ -31,7 +31,7 @@ class GroupProxy(
|
||||
class InstanceProxy(
|
||||
Base,
|
||||
IHasUnits,
|
||||
speckle_type="Models.Proxies.InstanceProxy",
|
||||
speckle_type="Speckle.Core.Models.Instances.InstanceProxy",
|
||||
):
|
||||
definition_id: str
|
||||
transform: List[float]
|
||||
@@ -41,7 +41,7 @@ class InstanceProxy(
|
||||
@dataclass(kw_only=True)
|
||||
class InstanceDefinitionProxy(
|
||||
Base,
|
||||
speckle_type="Models.Proxies.InstanceDefinitionProxy",
|
||||
speckle_type="Speckle.Core.Models.Instances.InstanceDefinitionProxy",
|
||||
detachable={"objects"},
|
||||
):
|
||||
objects: List[str]
|
||||
|
||||
@@ -133,7 +133,7 @@ def automate_function(
|
||||
raise ValueError("Cannot operate on objects without their id's.")
|
||||
automation_context.attach_error_to_objects(
|
||||
"Forbidden speckle_type",
|
||||
version_root_object.id,
|
||||
version_root_object,
|
||||
"This project should not contain the type: "
|
||||
f"{function_inputs.forbidden_speckle_type}",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user