deserialized error fixed

This commit is contained in:
KatKatKateryna
2024-09-26 14:19:59 +01:00
parent ebfb49c4a1
commit 434f712cbf
2 changed files with 18 additions and 4 deletions
+2 -3
View File
@@ -111,7 +111,7 @@ class SpeckleProvider(BaseProvider):
print(completed_process.stderr)
raise Exception(m)
patch_specklepy()
patch_specklepy()
# assign global values
@@ -399,9 +399,8 @@ class SpeckleProvider(BaseProvider):
)
print(f"____{datetime.now().astimezone(timezone.utc)} _Rendering model '{branch['name']}' of the project '{stream['name']}'")
speckle_data = self.traverse_data(commit_obj, comments)
set_actions(self, client)
speckle_data = self.traverse_data(commit_obj, comments)
speckle_data["features"].extend(speckle_data["comments"])
speckle_data["comments"] = []
@@ -168,8 +168,23 @@ class ServerTransport(AbstractTransport):
# iter through returned objects saving them as we go
target_transport.begin_write()
all_lines = [line for _,line in enumerate(lines)]
# fix wrongly split lines
for i, line in enumerate(all_lines):
if line:
if line and i!= 0 and (len(line)<=10 or'"id": "' not in line[:10]):
# find the last line with ID
matching_index = -1
for k, id_line in enumerate(all_lines):
if k<i and '"id": "' in id_line:
matching_index = k
if k==i:
break
if matching_index != -1:
all_lines[matching_index] += "},{" + line
all_lines[i] = ""
for i, line in enumerate(all_lines):
if line and len(line)>10 and '"id": "' in line[:10]:
hash = line.split('"id": "')[1].split('"')[0]
obj = "{" + line + "}"
if i==0: