Open sael9740 opened 2 years ago
Some other options:
1.) Using Google Forms (partial solution), see image below
2.) Having the user send their namelist in an embedded emailing feature then receiving an email back with what is and what is not supported. Could be checked with a Python dictionary
How is this support table different from our current support table, other than being slightly easier to modify?
We may be able to just use html and Python to upload files and check them. I have been playing around with this locally but have not quite got it to work yet, I believe I need to upload to a server, which local does not do.
The rst page:
HTML page
=========
.. raw:: html
:file: myfile.html
The html page that displays a button and a submit button:
<html>
<body>
<form enctype = "multipart/form-data" action = "python_script.py" method = "post">
<p>Upload File: <input type = "file" name = "filename" /></p>
<p><input type = "submit" value = "Upload" /></p>
</form>
</body>
</html>
The associated .py script:
"""
"This" is my example-script
===========================
"""
import os
fileitem = form['filename']
# check if the file has been uploaded
if fileitem.filename:
# strip the leading path from the file name
fn = os.path.basename(fileitem.filename)
# open read and write the file into the server
# open(fn, 'wb').write(fileitem.file.read())
with open(fn, encoding='UTF8') as f:
contents = f.read()
print(contents)
From here we can add more code to check conditions in the uploaded file(s) and display back to the user if the check passed or failed and if the latter, what failed and why.
Need to have a way for users to see what options are available. I have some ideas for making this into a nice interactive feature but for now we can just have an exhaustive support table. The code below can be used to generate a table that will work in rst.
@Jon-1996 - Let's start thinking about how and where to fit this into the documentation.