Read and write to DB from form finally workinggit status
This commit is contained in:
23
sm2gen.py
23
sm2gen.py
@@ -632,9 +632,9 @@ if __name__ == "__main__":
|
||||
file.write(controller_perl)
|
||||
logger.info(f"{controller_file} controller generated ok")
|
||||
except Exception as e:
|
||||
logger.info(f"A Chameleon controller render error occurred: {e} {traceback.format_exc()}")
|
||||
logger.info(f"A Chameleon controller *render* error occurred: {e} {traceback.format_exc()}")
|
||||
except Exception as e:
|
||||
logger.info(f"A Chameleon controller template error occurred: {e} {traceback.format_exc()}")
|
||||
logger.info(f"A Chameleon controller *template* error occurred: {e} {traceback.format_exc()}")
|
||||
|
||||
# Generate Custom controller file
|
||||
try:
|
||||
@@ -656,9 +656,9 @@ if __name__ == "__main__":
|
||||
file.write(custom_controller_perl)
|
||||
logger.info(f"{custom_controller_file} custom controller generated ok")
|
||||
except Exception as e:
|
||||
logger.info(f"A Chameleon custom controller render error occurred: {e} {traceback.format_exc()}")
|
||||
logger.info(f"A Chameleon custom controller *render* error occurred: {e} {traceback.format_exc()}")
|
||||
except Exception as e:
|
||||
logger.info(f"A Chameleon custom controller template error occurred: {e} {traceback.format_exc()}")
|
||||
logger.info(f"A Chameleon custom controller *template* error occurred: {e} {traceback.format_exc()}")
|
||||
|
||||
# generate Layout file
|
||||
layout_template = PageTemplateFile("Templates/layout.html.ep.tem")
|
||||
@@ -672,9 +672,9 @@ if __name__ == "__main__":
|
||||
file.write(layout_mojo)
|
||||
logger.info(f"{layout_file} mojo template layout file generated ok")
|
||||
except Exception as e:
|
||||
logger.info(f"A Chameleon render on layout file error occurred: {e}")
|
||||
logger.info(f"A Chameleon *render* on layout file error occurred: {e}")
|
||||
except Exception as e:
|
||||
logger.info(f"A Chameleon template layout file error occurred: {e}")
|
||||
logger.info(f"A Chameleon *template* layout file error occurred: {e}")
|
||||
|
||||
|
||||
# Generate a partial file for each of the entries in the html list
|
||||
@@ -735,11 +735,11 @@ if __name__ == "__main__":
|
||||
all_controls_html = all_controls_html + control_html
|
||||
except Exception as e:
|
||||
logger.info(
|
||||
f"A Chameleon render on partial file control {html_control} error occurred: {e}"
|
||||
f"A Chameleon *render* on partial file control {html_control} error occurred: {e}"
|
||||
)
|
||||
except Exception as e:
|
||||
logger.info(
|
||||
f"A Chameleon render on partial file control {html_control} error occurred: {e}"
|
||||
f"A Chameleon *template* on partial file control {html_control} error occurred: {e}"
|
||||
)
|
||||
else:
|
||||
# just a simple entry - name less numerics is type
|
||||
@@ -765,17 +765,18 @@ if __name__ == "__main__":
|
||||
)
|
||||
except Exception as e:
|
||||
logger.warning(
|
||||
f"A Chameleon render on partial file control {html_control} error occurred: {e}"
|
||||
f"A Chameleon *render* on partial file control {html_control} error occurred: {e}"
|
||||
)
|
||||
except Exception as e:
|
||||
logger.warning(
|
||||
f"A Chameleon template partial file control {html_control} error occurred: {e}"
|
||||
f"A Chameleon *template* partial file control {html_control} error occurred: {e}"
|
||||
)
|
||||
else:
|
||||
logger.debug(f"Skipping Chameleon expansion for {html_control}")
|
||||
simple_control_html = html_controls[html_Type]
|
||||
all_controls_html = all_controls_html + simple_control_html
|
||||
|
||||
else:
|
||||
logger.debug(f"{html_Type} not found in html_controls xml")
|
||||
# Now insert it into the partial file in the correct place.
|
||||
# Read in the text file and split at "%# Inputs etc in here."
|
||||
with open(partial_files[i], "r") as file:
|
||||
|
Reference in New Issue
Block a user