Hi everybody,
quick update on this.
So I was able to setup the extension point and the website will be displayed if I run "python app.py" manually via ssh. How can I start this on startup?
xml:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="test.pluign" name="Test" version="1.0.7" provider-name="Plugin">
<requires>
<import addon="xbmc.python" version="2.14.0"/>
<import addon="xbmc.json" version="6.0.0"/>
<import addon="xbmc.webinterface" version="1.0.0"/>
</requires>
<extension point="xbmc.webinterface" type="wsgi" library="app.py" entry="app" start="startup"/>
<extension point="xbmc.python.pluginsource" library="addon.py">
<provides>executable</provides>
</extension>
<extension point="xbmc.addon.metadata">
<platform>linux</platform>
<summary lang="en">Test Plugin Summary</summary>
<description lang="en">Test Plugin</description>
<license>GNU General Public License, v2</license>
<language></language>
<forum>nothing</forum>
<source>nothing</source>
<email>nothing</email>
</extension>
</addon>
One more thing...
As you can see I have the addon.py in this file there some functions I want to call with the input of the app.py (flask webservice). But my ways are not working and I get error messages like "ImportError: No module named xbmc". XBMC is the first thing I am importing in the addon.py.
python:
from flask import Flask, request, render_template
from addon import TestFunction
app = Flask(__name__)
@app.route('/')
def hello_Lightymon():
return 'Welcome to Lightymon!'
@app.route('/hello')
def my_form():
return render_template('form.html')
@app.route('/hello', methods=['POST'])
def my_form_post():
direction = request.form['direction']
device = request.form['device']
processed_text = device + " " + direction
TestFunction(ldevice)
return processed_text
if __name__ == '__main__':
app.run(host="0.0.0.0", port=8000, debug=False)
Extract from the addon.py
python:
import xbmc
import os
import sys
import xbmcaddon
import xbmcgui
import time
import subprocess
import urllib2
addon = xbmcaddon.Addon()
addonname = addon.getAddonInfo('name')
[...]
Any Ideas? Thank you very much.