|
|
@@ -15,7 +15,7 @@ myCar_config.read('data/etc/myCar.conf')
|
|
|
myCar_config = lib.config.myCar_read_config_defaults(myCar_config)
|
|
|
|
|
|
# please note, that this VERSION string is filled by subversion
|
|
|
-VERSION = "$Id$";
|
|
|
+VERSION = '$Id$'
|
|
|
|
|
|
import atexit
|
|
|
atexit.register(lib.app_control.myCar_exit, myCar_config)
|
|
|
@@ -49,18 +49,18 @@ app = Flask(__name__)
|
|
|
|
|
|
@app.route('/')
|
|
|
def myCar_root():
|
|
|
- return render_template('index.html', bt_ctrl_ispowered=lib.bluetooth.bt_ctrl_ispowered())
|
|
|
+ return render_template('index.html', VERSION=VERSION, bt_ctrl_ispowered=lib.bluetooth.bt_ctrl_ispowered())
|
|
|
|
|
|
@app.route('/bluetooth/controller')
|
|
|
def myCar_bluetooth_controller():
|
|
|
- return render_template('bluetooth/controller.html', bt_ctrl=lib.bluetooth.bt_getControllers())
|
|
|
+ return render_template('bluetooth/controller.html', VERSION=VERSION, bt_ctrl=lib.bluetooth.bt_getControllers())
|
|
|
|
|
|
@app.route('/bluetooth/devices')
|
|
|
def myCar_bluetooth_devices():
|
|
|
if lib.bluetooth.bt_ctrl_ispowered == False:
|
|
|
- return render_template('bluetooth/controller.html', bt_ctrl=lib.bluetooth.bt_getControllers(), bt_error="All Bluetooth Adapters are powered off")
|
|
|
+ return render_template('bluetooth/controller.html', VERSION=VERSION, bt_ctrl=lib.bluetooth.bt_getControllers(), bt_error="All Bluetooth Adapters are powered off")
|
|
|
else:
|
|
|
- return render_template('bluetooth/devices.html', bt_dev=lib.bluetooth.bt_getDevices())
|
|
|
+ return render_template('bluetooth/devices.html', VERSION=VERSION, bt_dev=lib.bluetooth.bt_getDevices())
|
|
|
|
|
|
@app.route('/bluetooth/connect', methods=['POST'])
|
|
|
def myCar_bluetooth_connect():
|
|
|
@@ -96,9 +96,9 @@ def myCar_bluetooth_connect():
|
|
|
else:
|
|
|
ret = 'Mac Address not provided'
|
|
|
except NameError:
|
|
|
- ret = render_template('bluetooth/devices.html', bt_dev=bluew.devices(),bt_error="No MAC provided to connect to")
|
|
|
+ ret = render_template('bluetooth/devices.html', VERSION=VERSION, bt_dev=bluew.devices(),bt_error="No MAC provided to connect to")
|
|
|
except bluew.errors.DeviceNotAvailable:
|
|
|
- ret = render_template('bluetooth/devices.html', bt_dev=bluew.devices(),bt_error='Bluetooth device ' + bt_dst_mac +' is not available')
|
|
|
+ ret = render_template('bluetooth/devices.html', VERSION=VERSION, bt_dev=bluew.devices(),bt_error='Bluetooth device ' + bt_dst_mac +' is not available')
|
|
|
|
|
|
return ret
|
|
|
|
|
|
@@ -107,7 +107,7 @@ def myCar_conf():
|
|
|
# this method reads the configuration file
|
|
|
# !!! beware due to stupidity in my mind this method also holds the
|
|
|
# !!! default vaules when the config file is not present
|
|
|
- return render_template('conf/main.html', config=myCar_config, sections=myCar_config.sections())
|
|
|
+ return render_template('conf/main.html', VERSION=VERSION, config=myCar_config, sections=myCar_config.sections())
|
|
|
|
|
|
|
|
|
@app.route('/confsave', methods=['POST'])
|
|
|
@@ -142,23 +142,23 @@ def myCar_conf_save():
|
|
|
@app.route('/gps')
|
|
|
def myCar_gps():
|
|
|
# dummy implementation before code is ready
|
|
|
- return render_template('empty.html')
|
|
|
+ return render_template('empty.html', VERSION=VERSION)
|
|
|
|
|
|
@app.route('/wifi')
|
|
|
def myCar_wifi():
|
|
|
# dummy implementation before code is ready
|
|
|
- return render_template('empty.html')
|
|
|
+ return render_template('empty.html', VERSION=VERSION)
|
|
|
|
|
|
@app.route('/system')
|
|
|
def myCar_system():
|
|
|
# dummy implementation before code is ready
|
|
|
- return render_template('empty.html')
|
|
|
+ return render_template('empty.html', VERSION=VERSION)
|
|
|
|
|
|
|
|
|
@app.route('/live')
|
|
|
def myCar_live():
|
|
|
# dummy implementation before code is ready
|
|
|
- return render_template('empty.html')
|
|
|
+ return render_template('empty.html', VERSION=VERSION)
|
|
|
|
|
|
|
|
|
@app.route('/record')
|
|
|
@@ -172,7 +172,7 @@ def myCar_record():
|
|
|
for f in fpflist:
|
|
|
flist.add(str(f).strip(myCar_config['paths'].get('app') + '/' + myCar_config['paths'].get('record')))
|
|
|
|
|
|
- return render_template('recordings/overview.html',files=flist, fpfiles=fpflist)
|
|
|
+ return render_template('recordings/overview.html', VERSION=VERSION, files=flist, fpfiles=fpflist)
|
|
|
|
|
|
# error handling
|
|
|
@app.errorhandler(404)
|