|
@@ -1,5 +1,23 @@
|
|
|
#!/usr/bin/python3
|
|
#!/usr/bin/python3
|
|
|
|
|
|
|
|
|
|
+import configparser
|
|
|
|
|
+import lib.config
|
|
|
|
|
+import lib.app_control
|
|
|
|
|
+
|
|
|
|
|
+# we need to initially load the configuration file.
|
|
|
|
|
+# This is loaded via a local symlink
|
|
|
|
|
+myCar_config = configparser.ConfigParser()
|
|
|
|
|
+myCar_config.read('data/etc/myCar.conf')
|
|
|
|
|
+
|
|
|
|
|
+# fill in config values with defaults
|
|
|
|
|
+myCar_config = lib.config.myCar_read_config_defaults(myCar_config)
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+import atexit
|
|
|
|
|
+atexit.register(lib.app_control.myCar_exit, myCar_config)
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
from flask import Flask
|
|
from flask import Flask
|
|
|
from flask import url_for
|
|
from flask import url_for
|
|
|
from flask import render_template
|
|
from flask import render_template
|
|
@@ -71,3 +89,11 @@ def myCar_bluetooth_connect():
|
|
|
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', bt_dev=bluew.devices(),bt_error='Bluetooth device ' + bt_dst_mac +' is not available')
|
|
|
|
|
|
|
|
return ret
|
|
return ret
|
|
|
|
|
+
|
|
|
|
|
+#@app.route('/conf', methods=['POST'])
|
|
|
|
|
+#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
|
|
|
|
|
+
|
|
|
|
|
+
|