Add empty css file for each panel
This commit is contained in:
15
sm2gen.py
15
sm2gen.py
@@ -469,7 +469,9 @@ if __name__ == "__main__":
|
||||
routes = get_all_routes()
|
||||
lc_routes = lc_get_all_routes()
|
||||
|
||||
#
|
||||
# File names
|
||||
#
|
||||
# Define the path for the generated files
|
||||
directory_path = Path("Targets/" + hl("PackageName"))
|
||||
# Create the directory if it doesn't exist
|
||||
@@ -478,8 +480,9 @@ if __name__ == "__main__":
|
||||
|
||||
controller_file = check_file_version(target_directory_path + hl("PackageName") + ".pm")
|
||||
custom_controller_file = check_file_version(target_directory_path + hl("PackageName") + "-Custom.pm",3)
|
||||
print(custom_controller_file)
|
||||
#print(custom_controller_file)
|
||||
layout_file = check_file_version(target_directory_path + hl("PackageName").lower() + ".html.ep")
|
||||
css_file = check_file_version(target_directory_path + hl("PackageName").lower() + ".css")
|
||||
partial_files = list()
|
||||
for panel in routes:
|
||||
partial_files.append(check_file_version(
|
||||
@@ -538,7 +541,8 @@ if __name__ == "__main__":
|
||||
try:
|
||||
try:
|
||||
layout_mojo = layout_template.render(
|
||||
version=strVersion, **json5_dict, conditions=routes
|
||||
version=strVersion, **json5_dict, conditions=routes,
|
||||
lcPackageName=json5_dict["PackageName"].lower()
|
||||
)
|
||||
with open(layout_file, "w") as file:
|
||||
file.write(layout_mojo)
|
||||
@@ -547,7 +551,12 @@ if __name__ == "__main__":
|
||||
print(f"A Chameleon render on layout file error occurred: {e}")
|
||||
except Exception as e:
|
||||
print(f"A Chameleon template layout file error occurred: {e}")
|
||||
|
||||
|
||||
# Create the css file (empty for now, except the header)
|
||||
# maybe it should have empty expamples of all the relevant classes?
|
||||
with open(css_file, "w") as file:
|
||||
file.write(f"/*\n Generated by SM2Gen version: {strVersion}\n*/\n")
|
||||
|
||||
# Generate a partial file for each of the entries in the html list
|
||||
# Pull in the template code for each of the input types
|
||||
# html_controls = json5_to_dict('Templates/html_controls.html.ep.tem')
|
||||
|
Reference in New Issue
Block a user