From 03591e8e9dfa016e87d2c30c281169bb6d63436f Mon Sep 17 00:00:00 2001 From: Brett Date: Mon, 29 Apr 2024 17:13:26 -0400 Subject: [PATCH] wasm page generator for emscripten --- create_site.py | 2 +- create_systemd_service.py | 2 +- create_webasm_page.py | 210 ++++++++++++++++++++++ examples/emscripten.html | 173 ++++++++++++++++++ util/__pycache__/color_io.cpython-311.pyc | Bin 0 -> 1005 bytes util/color_io.py | 17 ++ 6 files changed, 402 insertions(+), 2 deletions(-) create mode 100755 create_webasm_page.py create mode 100644 examples/emscripten.html create mode 100644 util/__pycache__/color_io.cpython-311.pyc create mode 100644 util/color_io.py diff --git a/create_site.py b/create_site.py index ad46b80..c7089e9 100644 --- a/create_site.py +++ b/create_site.py @@ -2,7 +2,7 @@ import argparse import subprocess -import color_io +import util.color_io as color_io parser = argparse.ArgumentParser(prog='Site Generator', description='Apache/Nginx Site Generator', epilog='Currently Only For Nginx') diff --git a/create_systemd_service.py b/create_systemd_service.py index 250b269..3cebc2b 100644 --- a/create_systemd_service.py +++ b/create_systemd_service.py @@ -2,7 +2,7 @@ import argparse import subprocess -import color_io +import util.color_io as color_io import sys parser = argparse.ArgumentParser(prog='SystemD Service Generator', description='SystemD Service Unit File Generator', epilog='Meow') diff --git a/create_webasm_page.py b/create_webasm_page.py new file mode 100755 index 0000000..28e329b --- /dev/null +++ b/create_webasm_page.py @@ -0,0 +1,210 @@ +#!/bin/python3 + +import argparse +import subprocess +import util.color_io as color_io +import sys + +parser = argparse.ArgumentParser(prog='WebASM Generator', description='Creates a webpage to run a WebASM Project, designed for use with emscripten', epilog='Meow') + +parser.add_argument("-i", "--install", nargs='?', const="/var/www/html/", default=None) +if ("--install" in sys.argv or "-i" in sys.argv): + parser.add_argument("file", default=None) + +args = parser.parse_args() + +f = sys.stdout + +html_base = """ + + + + + + ${TITLE HERE} + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+ + + + +""" + +if args.install: + path = args.install + if not args.install.endswith("/"): + path += "/" + path += args.file + if not args.file.endswith(".html"): + path += ".html" + f = open(path, "wt") + +def bprint(*args, **kwargs): + print(*args, file=f, **kwargs) + +if __name__ == "__main__": + html_out = html_base.replace("${TITLE_HERE}", color_io.input_print("Please enter page title")); + html_out = html_out.replace("${SCRIPT_HERE}", color_io.input_print("Please enter script location and name")); + + bprint(html_out); \ No newline at end of file diff --git a/examples/emscripten.html b/examples/emscripten.html new file mode 100644 index 0000000..1535753 --- /dev/null +++ b/examples/emscripten.html @@ -0,0 +1,173 @@ + + + + + + ${TITLE HERE} + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+ + + + diff --git a/util/__pycache__/color_io.cpython-311.pyc b/util/__pycache__/color_io.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9cbeb1acad619a4d78632cfd3783f8bf754a9d14 GIT binary patch literal 1005 zcmZ`%&1(}u6rZ;{yJQ3FHtK0)i)Rf!uoX&Ex}9@a@j;eaxHp=KYv&^Ya!#`5a1RcY%=K z(wT@hHij!`oDxPDcqBuZRwo%?CZl!8Xv{!QXRt$(p+EA#wmm+kl!15|*YG~VDe~MRZEO>tVzz@IAM%RxAgmqZ;rC z*3fYYIeLxsX}FPY(>tH+k4LD!JVyBUA7T~>h&`PET{*cdF{~iWPR^i8WRz)4|4Cbz zbtW^F0P&|bW*9AG>}<-~JFTj5Tsx!+BIe5;W2s`Kh5gT_caS;Ap1EBymUka)ojePStXC3;d>$(#bv1HexcOqq4xo`CR$JpyENV|lK!@Uzml&=i{Eu8o@hpAg2c?fF zxtFU@$w(5^@TeB?gphqkqXm%z?l}1o4}1yZF_~}!LB0vAvDt*%+X