Skip to content

Commit

Permalink
Merge pull request #182 from toshan-luktuke/vc-bundle
Browse files Browse the repository at this point in the history
Add the .vc3 file to the built application
  • Loading branch information
Suhas-G authored Aug 11, 2022
2 parents 42fd47a + e402d4b commit 6f859d5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion backend/synthesis/synthesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
'ObjectDetector': 'utils/models/yolov3/*'
}

PROJECT_FILE_EXTENSION = '.vc3'

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

# Project name (zipfile name)
project_name = f"{data['package']['name']}.zip" if data['package']['name'] != '' else 'Project.zip'
project_name = f"{data['package']['name']}" if data['package']['name'] != '' else 'Project'

# Add the .vc3 file to the built application, this will let us easily load the project in Visual Circuit
zipfile.append(project_name + PROJECT_FILE_EXTENSION, json.dumps(data))
# .zip is required for the name of the full package
project_name += '.zip'

return project_name, zipfile.get_zip()

0 comments on commit 6f859d5

Please sign in to comment.