Skip to content
Snippets Groups Projects

Port silecs cli to Python

Merged m.nabywaniec requested to merge 70-port-cli-client-to-python into master
Compare and Show latest version
1 file
+ 4
4
Compare changes
  • Side-by-side
  • Inline
+ 4
4
@@ -113,7 +113,7 @@ def get_schema_path(silecs_design_deploy_path):
if extension == SILECSDEPLOY:
return DEPLOY_SHEMA_PATH
raise Exception("Error: Passed file for validation needs to have the extension '.silecsdesign' or '.silecsdeploy'")
raise Exception(f"Error: Passed file for validation needs to have the extension '.{SILECSDESIGN}' or '.{SILECSDEPLOY}'")
def get_silecs_file_path_from_fesa(fesa_design_deploy_path):
@@ -127,7 +127,7 @@ def get_silecs_file_path_from_fesa(fesa_design_deploy_path):
elif extension == DEPLOY:
extension = SILECSDEPLOY
else:
raise Exception("Error: Passed FESA file needs to have the extension '.design' or '.deploy'")
raise Exception(f"Error: Passed FESA file needs to have the extension '.{DESIGN}' or '.{DEPLOY}'")
return os.path.join(project_dir, project_name + "." + extension)
@@ -192,7 +192,7 @@ def create_silecs_design(filepath, project_name):
</SILECS-Design>"""
if os.path.isfile(filepath):
raise Exception(f"Error: There is already a .silecsdesign file available: {os.path.abspath(filepath)}")
raise Exception(f"Error: There is already a .{SILECSDESIGN} file available: {os.path.abspath(filepath)}")
with open(filepath, "w") as fp:
fp.write(design_template)
@@ -222,7 +222,7 @@ def create_silecs_deploy(filepath, project_name):
</SILECS-Deploy>"""
if os.path.isfile(filepath):
raise Exception(f"Error: There is already a .silecsdeploy file available: {os.path.abspath(filepath)}")
raise Exception(f"Error: There is already a .{SILECSDEPLOY} file available: {os.path.abspath(filepath)}")
with open(filepath, "w") as fp:
fp.write(deploy_template)
Loading