From 3c268d40ae591d4379448662e98210ea34cbfbd3 Mon Sep 17 00:00:00 2001 From: Brian Read Date: Tue, 9 Apr 2024 12:54:01 +0100 Subject: [PATCH] Comment out unecessary string replace --- sm2gen-ImportJSON5.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/sm2gen-ImportJSON5.py b/sm2gen-ImportJSON5.py index 554b8e2..dc64465 100644 --- a/sm2gen-ImportJSON5.py +++ b/sm2gen-ImportJSON5.py @@ -180,7 +180,7 @@ if __name__ == "__main__": #print() #print(controller_perl) # Map '$ 'to '$' to overcome problem with escaping $ signs - controller_perl = controller_perl.replace("$ ", "$") + #controller_perl = controller_perl.replace("$ ", "$") with open('Targets/'+hl('PackageName')+'.pm', 'w') as file: file.write(controller_perl) print("Targets/"+hl('PackageName')+'.pm controller generated ok') @@ -195,7 +195,7 @@ if __name__ == "__main__": try: layout_mojo = layout_template.render(**json5_dict,conditions=routes) # Map '$ 'to '$' to overcome problem with escaping $ signs - layout_mojo = layout_mojo.replace("$ ", "$") + #layout_mojo = layout_mojo.replace("$ ", "$") with open('Targets/'+hl('PackageName')+'.html.ep', 'w') as file: file.write(layout_mojo) print("Targets/"+hl('PackageName')+'.html.ep mojo template generated ok') @@ -220,7 +220,7 @@ if __name__ == "__main__": try: partial_mojo_template = partial_template.render(**partial_mojo_context) # Map '$ 'to '$' to overcome problem with escaping $ signs - partial_mojo_template = partial_mojo_template.replace("$ ", "$") + #partial_mojo_template = partial_mojo_template.replace("$ ", "$") with open('Targets/_'+hl('prefix')+"_"+html['route']+'.html.ep', 'w') as file: file.write(partial_mojo_template) print('Targets/_'+hl('prefix')+"_"+html['route']+'.html.ep mojo template generated ok') @@ -257,18 +257,16 @@ if __name__ == "__main__": print(f"An chameleon render on partial file control {inner_html['Name']} error occurred: {e}") else: #just a simple entry - name less numerics is type - #print(html_control) html_Type = ''.join(char for char in html_control if not char.isdigit()) - #html_Type = inner_html['Type'] #print(html_Type); try: simple_control_template = PageTemplate(html_controls[html_Type]) try: simple_control_html = simple_control_template.render(value=inner_html,prefix=prefix_is) # Map '$ 'to '$' to overcome problem with escaping $ signs - simple_control_html = simple_control_html.replace("$ ", "$") + #simple_control_html = simple_control_html.replace("$ ", "$") # Add in two tabs before each newline - simple_control_html = simple_control_html.replace("\n", "\n\t\t") + #simple_control_html = simple_control_html.replace("\n", "\n\t\t") all_controls_html = all_controls_html + simple_control_html except Exception as e: print(f"An chameleon render on partial file control {inner_html['Name']} error occurred: {e}")