Skip to content

Commit

Permalink
Add default name as Project.vc3
Browse files Browse the repository at this point in the history
  • Loading branch information
toshan-luktuke committed Aug 10, 2022
1 parent 865d8f6 commit e402d4b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions backend/synthesis/synthesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,13 @@ def synthesize(data: dict) -> Tuple[str, BytesIO]:
zipfile, optional_files = syntheize_modules(data, zipfile)
zipfile = synthesize_executioner(zipfile, optional_files)
zipfile = syntesize_extras(zipfile)
# Add the .vc3 file to the built application, this will let us easily load the project in Visual Circuit
zipfile.append(data['package']['name'] + PROJECT_FILE_EXTENSION, json.dumps(data))

# 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 e402d4b

Please sign in to comment.