One strategy is to simply put the entire node JavaScript file into ChatGPT or equivalent and ask ChatGPT to translate it to Python. You can then test the code locally with the front-end components in this repo. You need to copy and paste the files and match up the endpoints.
One of the problems is that the node server is serving up the ejs file. we need to convert it to the jinja template of flask. You may need to rewrite the viewer.ejs file to use jinja template syntax. I started the process.
new GitHub repo with the Python server code AND the front-end code to show the viewer
run locally at this stage
document status and functionality in README
Using ChatGPT translation, I got this far.
Using Flask with hard-coded contentid
Although I have the contentId hard-coded into the JavaScript, I am passing the entire content_data listing to the page. So, you can either parse it in JavaScript or rewrite the backend to send parsed data to the page.
Build Python example.
One strategy is to simply put the entire node JavaScript file into ChatGPT or equivalent and ask ChatGPT to translate it to Python. You can then test the code locally with the front-end components in this repo. You need to copy and paste the files and match up the endpoints.
experiment on branch python-experiment.
https://github.com/theta360developers/oppkey-ricoh-viewer-demo-basic/blob/python-experiment/python_experiment.py
One of the problems is that the node server is serving up the ejs file. we need to convert it to the jinja template of flask. You may need to rewrite the viewer.ejs file to use jinja template syntax. I started the process.
https://github.com/theta360developers/oppkey-ricoh-viewer-demo-basic/blob/python-experiment/views/flask_viewer.html
deliverables
Using ChatGPT translation, I got this far.
Using Flask with hard-coded contentid
Although I have the contentId hard-coded into the JavaScript, I am passing the entire content_data listing to the page. So, you can either parse it in JavaScript or rewrite the backend to send parsed data to the page.
Using Node