Skip to content

Commit 3c6018d

Browse files
committed
revert
1 parent 5ff6437 commit 3c6018d

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

src/opengeodeweb_viewer/rpc/mesh/points/mesh_points_protocols.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ class VtkMeshPointsView(VtkMeshView):
2323
def __init__(self) -> None:
2424
super().__init__()
2525

26-
@exportRpc(mesh_points_prefix + str(mesh_points_schemas_dict["visibility"]["rpc"]))
26+
@exportRpc(mesh_points_prefix + mesh_points_schemas_dict["visibility"]["rpc"])
2727
def setMeshPointsVisibility(self, params: RpcParams) -> None:
2828
validate_schema(
2929
params, self.mesh_points_schemas_dict["visibility"], self.mesh_points_prefix
3030
)
3131
id, visibility = params["id"], params["visibility"]
3232
self.SetPointsVisibility(id, visibility)
3333

34-
@exportRpc(mesh_points_prefix + str(mesh_points_schemas_dict["color"]["rpc"]))
34+
@exportRpc(mesh_points_prefix + mesh_points_schemas_dict["color"]["rpc"])
3535
def setMeshPointsColor(self, params: RpcParamsWithColor) -> None:
3636
validate_schema(
3737
params, self.mesh_points_schemas_dict["color"], self.mesh_points_prefix
@@ -44,17 +44,15 @@ def setMeshPointsColor(self, params: RpcParamsWithColor) -> None:
4444
)
4545
self.SetPointsColor(id, red, green, blue)
4646

47-
@exportRpc(mesh_points_prefix + str(mesh_points_schemas_dict["size"]["rpc"]))
47+
@exportRpc(mesh_points_prefix + mesh_points_schemas_dict["size"]["rpc"])
4848
def setMeshPointsSize(self, params: RpcParams) -> None:
4949
validate_schema(
5050
params, self.mesh_points_schemas_dict["size"], self.mesh_points_prefix
5151
)
5252
id, size = params["id"], params["size"]
5353
self.SetPointsSize(id, size)
5454

55-
@exportRpc(
56-
mesh_points_prefix + str(mesh_points_schemas_dict["vertex_attribute"]["rpc"])
57-
)
55+
@exportRpc(mesh_points_prefix + mesh_points_schemas_dict["vertex_attribute"]["rpc"])
5856
def setMeshPointsVertexAttribute(self, params: RpcParams) -> None:
5957
validate_schema(
6058
params,

src/opengeodeweb_viewer/utils_functions.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,10 @@
1414
type RpcParamsWithColor = dict[str, JsonPrimitive | ColorDict]
1515
type RpcParamsWithList = dict[str, JsonPrimitive | list[str]]
1616

17-
type SchemaDict = dict[str, JsonValue]
18-
type SchemasDict = dict[str, SchemaDict]
1917

20-
21-
def get_schemas_dict(path: str) -> SchemasDict:
18+
def get_schemas_dict(path: str) -> object:
2219
json_files = os.listdir(path)
23-
schemas_dict: SchemasDict = {}
20+
schemas_dict = {}
2421
for json_file in json_files:
2522
last_point = json_file.rfind(".")
2623
filename = json_file[: -len(json_file) + last_point]
@@ -30,7 +27,9 @@ def get_schemas_dict(path: str) -> SchemasDict:
3027
return schemas_dict
3128

3229

33-
def validate_schema(params: RpcParams, schema: SchemaDict, prefix: str = "") -> None:
30+
def validate_schema(
31+
params: RpcParams, schema: dict[str, JsonValue], prefix: str = ""
32+
) -> None:
3433
print(f"{prefix}{schema['rpc']}", f"{params=}", flush=True)
3534
try:
3635
validate = fastjsonschema.compile(schema)

0 commit comments

Comments
 (0)