Skip to content
Snippets Groups Projects
Commit 976c998f authored by Nabywaniec's avatar Nabywaniec
Browse files

use variables for extenstions

parent 13edf507
No related branches found
No related tags found
1 merge request!2Port silecs cli to Python
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment