another web web-interface, beginner questions
#1
hi,
i just noticed that most of my JS-framework (for doing web based IDEs) might work out of the box on Kodi, thanks to JSON-RPC2.0 with full introspection. Now the default and Chorus does already do a good job but I'd like to add a bit more functionality:

Do you think that these features are possible to implement for the most platforms:

1. download any content from any add-on (i found redirect-download but I am not sure that will do). By downloading I mean client but also Kodi side(new context-menu item).
2. schedule a process for later on the Kodi. I guess cron not will be always there but may be Kodi has this already built-in
3. another end-user scripting language: are there any? Since its all about Python, I started digging into JS to Python and found indeed a tool called py2js which translates even more complex JS libraries(esprima). I developed recently a little macro language, very similar to what 'Network-Automation' did. I am convinced that I can export such blocks to Python, even with real-time feedback. Interface-wise you could edit those blocks even on the Kodi directly. Does such thing would be of any use? I think it would be great to extend your system with such blocks instead of having Addons only.


I'd be happy to hear any thoughts.
And thanks for this great tool!
Reply
#2
1, 2: I guess, if you need more features than Kodi JSON-RPC offers you need to implement a custom back-end as a Python addon which will support your own web/JSON interface and perform another tasks that you need. And here we come to your 3.

3: You don't need to translate JS into Python because it makes no sense. Python is a back-end language meaning that with it you can write a web/REST application that will interact with your web-UI. Python is widely used for programming web back-ends and Kodi is includes a full-featured Python 2.6-2.7 runtime (soon it will be 2.7 on all platforms), so you can use any Python web libraries/frameworks available to write your back-end. I guess you can even use Django with Kodi but it will be a huge overkill Smile I would recommend Bottle. It is a full-featured Python web micro-framework that consists of only 1 file with no external dependencies, so you can drop it into your back-end addon.

You can see a custom back-end/web-UI implementation based on Bottle in my YATP plugin. Especially take a look at wsgi_app.py, wsgi_server.py and server.py modules.
Reply
#3
Thanks Roman!

Ok, I will dig deeper then ;-)
Reply

Logout Mark Read Team Forum Stats Members Help
another web web-interface, beginner questions0