Skip to content

Commit 6f859d5

Browse files
authored
Merge pull request #182 from toshan-luktuke/vc-bundle
Add the .vc3 file to the built application
2 parents 42fd47a + e402d4b commit 6f859d5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

backend/synthesis/synthesis.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
'ObjectDetector': 'utils/models/yolov3/*'
1515
}
1616

17+
PROJECT_FILE_EXTENSION = '.vc3'
1718

1819
def get_number_or_default(num, default):
1920
try:
@@ -146,6 +147,11 @@ def synthesize(data: dict) -> Tuple[str, BytesIO]:
146147
zipfile = syntesize_extras(zipfile)
147148

148149
# Project name (zipfile name)
149-
project_name = f"{data['package']['name']}.zip" if data['package']['name'] != '' else 'Project.zip'
150+
project_name = f"{data['package']['name']}" if data['package']['name'] != '' else 'Project'
151+
152+
# Add the .vc3 file to the built application, this will let us easily load the project in Visual Circuit
153+
zipfile.append(project_name + PROJECT_FILE_EXTENSION, json.dumps(data))
154+
# .zip is required for the name of the full package
155+
project_name += '.zip'
150156

151157
return project_name, zipfile.get_zip()

0 commit comments

Comments
 (0)