From a9cde5ac54c5d195bb3b0c9cc054afb2c2335474 Mon Sep 17 00:00:00 2001 From: Siwat Sirichai Date: Tue, 2 Jan 2024 13:22:00 +0700 Subject: [PATCH] move html location --- ESPMegaPRO-OS-SDK/helper_scripts/html2cpp.py | 10 +++++----- ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/ESPMegaWebServer.hpp | 2 +- ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/all_html.h | 3 +++ .../lib/ESPMegaPRO/{html/config.h => config_html.h} | 0 ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/html/all.h | 3 --- .../lib/ESPMegaPRO/{html/ota.h => ota_html.h} | 0 6 files changed, 9 insertions(+), 9 deletions(-) create mode 100644 ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/all_html.h rename ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/{html/config.h => config_html.h} (100%) delete mode 100644 ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/html/all.h rename ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/{html/ota.h => ota_html.h} (100%) diff --git a/ESPMegaPRO-OS-SDK/helper_scripts/html2cpp.py b/ESPMegaPRO-OS-SDK/helper_scripts/html2cpp.py index 20a3888..30e43a9 100644 --- a/ESPMegaPRO-OS-SDK/helper_scripts/html2cpp.py +++ b/ESPMegaPRO-OS-SDK/helper_scripts/html2cpp.py @@ -34,11 +34,11 @@ for html_file in html_files: # Use xxd to convert the html file to a C++ file # The C++ file will have the same name as the original file but with a .h extension # Save the C++ file in lib/ESPMegaPRO/html - os.system("xxd -i temp/" + os.path.basename(html_file) + " > lib/ESPMegaPRO/html/" + os.path.basename(html_file).replace(".html", ".h")) + os.system("xxd -i temp/" + os.path.basename(html_file) + " > lib/ESPMegaPRO/" + os.path.basename(html_file).replace(".html", "_html.h")) # Now delete the temp file os.remove("temp/" + os.path.basename(html_file)) # Next we open the C++ file - f = open("lib/ESPMegaPRO/html/" + os.path.basename(html_file).replace(".html", ".h"), "r") + f = open("lib/ESPMegaPRO/" + os.path.basename(html_file).replace(".html", "_html.h"), "r") # Read the content of the C++ file cpp_content = f.read() # Close the C++ file @@ -59,7 +59,7 @@ for html_file in html_files: filename = os.path.basename(html_file).replace(".html", "") cpp_content = re.sub(r"const char (.*?)\[\] PROGMEM = {", r"const char " + filename + r"_html[] PROGMEM = {", cpp_content) # Reopen the C++ file - f = open("lib/ESPMegaPRO/html/" + os.path.basename(html_file).replace(".html", ".h"), "w") + f = open("lib/ESPMegaPRO/" + os.path.basename(html_file).replace(".html", "_html.h"), "w") # Write the new content to the C++ file f.write(cpp_content) # Close the C++ file @@ -67,10 +67,10 @@ for html_file in html_files: # Lastly, we need to create a header file that includes all the html files # Open the header file -f = open("lib/ESPMegaPRO/html/all.h", "w") +f = open("lib/ESPMegaPRO/all_html.h", "w") # Write the pragma once directive f.write("#pragma once\n") # Write the includes for all the html files for html_file in html_files: - f.write("#include \"" + os.path.basename(html_file).replace(".html", ".h") + "\"\n") + f.write("#include \"" + os.path.basename(html_file).replace(".html", "_html.h") + "\"\n") # Close the header file \ No newline at end of file diff --git a/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/ESPMegaWebServer.hpp b/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/ESPMegaWebServer.hpp index 00a4c9e..1e1491e 100644 --- a/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/ESPMegaWebServer.hpp +++ b/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/ESPMegaWebServer.hpp @@ -6,7 +6,7 @@ #include #include #include -#include +#include /** diff --git a/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/all_html.h b/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/all_html.h new file mode 100644 index 0000000..8c2ce21 --- /dev/null +++ b/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/all_html.h @@ -0,0 +1,3 @@ +#pragma once +#include "config_html.h" +#include "ota_html.h" diff --git a/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/html/config.h b/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/config_html.h similarity index 100% rename from ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/html/config.h rename to ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/config_html.h diff --git a/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/html/all.h b/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/html/all.h deleted file mode 100644 index 09bffb5..0000000 --- a/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/html/all.h +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once -#include "config.h" -#include "ota.h" diff --git a/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/html/ota.h b/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/ota_html.h similarity index 100% rename from ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/html/ota.h rename to ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/ota_html.h