commit a5b5637cfe14459ad8ef6d4ac1745c14048f19e1 Author: Thomas Klaehn Date: Wed May 5 14:17:10 2021 +0200 Initial commit diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..8622796 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,27 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Python: Flask", + "type": "python", + "request": "launch", + "module": "flask", + "env": { + "FLASK_APP": "gardenui/app.py", + "FLASK_ENV": "development", + "FLASK_DEBUG": "0" + }, + "args": [ + "run", + "--no-debugger", + "--no-reload", + "--host=0.0.0.0", + "--port=8000" + ], + "jinja": true + } + ] +} \ No newline at end of file diff --git a/gardenui.service b/gardenui.service new file mode 100644 index 0000000..8cf6eda --- /dev/null +++ b/gardenui.service @@ -0,0 +1,10 @@ +[Unit] +Description=Garden UI service +After=multi-user.target gardencontrol.service + +[Service] +Type=idle +ExecStart=gunicorn --bind 0.0.0.0:80 gardenui:app + +[Install] +WantedBy=multi-user.target diff --git a/gardenui/__init__.py b/gardenui/__init__.py new file mode 100644 index 0000000..0ccc333 --- /dev/null +++ b/gardenui/__init__.py @@ -0,0 +1,2 @@ +from .app import app + diff --git a/gardenui/__pycache__/app.cpython-37.pyc b/gardenui/__pycache__/app.cpython-37.pyc new file mode 100644 index 0000000..b1e8ef2 Binary files /dev/null and b/gardenui/__pycache__/app.cpython-37.pyc differ diff --git a/gardenui/app.py b/gardenui/app.py new file mode 100644 index 0000000..9e21dd1 --- /dev/null +++ b/gardenui/app.py @@ -0,0 +1,161 @@ + +import json +import logging +import xmlrpc.client + +from flask import Flask +from flask import render_template +from flask import make_response +from flask import request +from flask import jsonify + +LOG_LEVEL = logging.INFO +LOG_FILE = "/var/log/sauna.log" +LOG_FORMAT = "%(asctime)s %(levelname)s %(message)s" + +URL = 'http://{}:{}'.format('localhost', 64001) + +# logging.basicConfig(format=LOG_FORMAT, level=LOG_LEVEL, filename=LOG_FILE) +logging.basicConfig(format=LOG_FORMAT, level=LOG_LEVEL) +log = logging.getLogger() + + +app = Flask(__name__) + +@app.route('/') +def index(): + return render_template('index.html') + +@app.route('/garden') +def garden(): + return render_template('garden.html') + +@app.route('/greenhouse_1') +def greenhouse_1(): + return render_template('greenhouse_1.html') + +@app.route('/greenhouse_2') +def greenhouse_2(): + return render_template('greenhouse_2.html') + +@app.route('/sample/', methods=['GET']) +def get_sample(idx='0'): + idx = int(idx) + res = {} + client = xmlrpc.client.ServerProxy(URL) + + if idx == 1: + heat = {} + heat['id'] = str(idx) + heat['state'] = client.get_current_heat_state(idx) + temp = client.get_current_temperature(idx) + if temp: + temperature = {} + temperature['id'] = str(idx) + temperature['value'] = temp + res['heat'] = heat + res['temperature'] = temperature + + water = {} + water['id'] = str(idx) + water['state'] = client.get_current_water_state(idx) + res['water'] = water + + return make_response(jsonify(res), 200) + +@app.route('/config/', methods=['GET']) +def get_config(idx='0'): + idx = int(idx) + res = {} + client = xmlrpc.client.ServerProxy(URL) + + if idx == 1: + heat = {} + heat['id'] = str(idx) + heat['autostate'] = client.get_heat_autostate(idx) + heat['on_temperature'] = client.get_on_temperature(idx) + heat['off_temperature'] = client.get_off_temperature(idx) + res['heat'] = heat + + water = {} + water['id'] = str(idx) + water['autostate'] = client.get_water_autostate(idx) + water['times'] = client.get_water_times(idx) + res['water'] = water + + return make_response(jsonify(res), 200) + + +@app.route('/sample', methods=['PATCH']) +def patch_sample(): + client = xmlrpc.client.ServerProxy(URL) + record = json.loads(request.data) + if 'id' in record and record['id'] == '1': + if 'heatstate' in record: + if record['heatstate']: + client.set_heat_state(record['id']) + else: + client.clear_heat_state(record['id']) + if 'id' in record and 'waterstate' in record: + if record['waterstate']: + client.set_water_state(record['id']) + else: + client.clear_water_state(record['id']) + return make_response("", 204) + + +@app.route('/config', methods=['PATCH']) +def patch_config(): + client = xmlrpc.client.ServerProxy(URL) + record = json.loads(request.data) + if 'water' in record: + water = record['water'] + if 'autostate' in water: + if water['autostate']: + client.set_water_autostate(water['id']) + else: + client.clear_water_autostate(water['id']) + if 'times' in water: + client.set_water_times(water['id'], water['times']) + if 'heat' in record: + if 'id' in record['heat'] and record['heat']['id'] == '1': + if 'autostate' in record['heat']: + if record['heat']['autostate']: + client.set_heat_autostate('1') + else: + client.clear_heat_autostate('1') + if 'increase_on_temperature' in record['heat']: + if record['heat']['increase_on_temperature']: + client.increase_on_temperature('1') + if 'decrease_on_temperature' in record['heat']: + if record['heat']['decrease_on_temperature']: + client.decrease_on_temperature('1') + if 'increase_off_temperature' in record['heat']: + if record['heat']['increase_off_temperature']: + client.increase_off_temperature('1') + if 'decrease_off_temperature' in record['heat']: + if record['heat']['decrease_off_temperature']: + client.decrease_off_temperature('1') + + # prepare answer + res = {} + if 'heat' in record and record['heat']['id'] == '1': + heat = {} + heat['id'] = '1' + heat['autostate'] = client.get_heat_autostate(1) + heat['on_temperature'] = client.get_on_temperature(1) + heat['off_temperature'] = client.get_off_temperature(1) + res['heat'] = heat + if 'water' in record: + water = {} + water['id'] = record['water']['id'] + water['autostate'] = client.get_water_autostate(int(record['water']['id'])) + water['times'] = client.get_water_times(int(record['water']['id'])) + res['water'] = water + + + return make_response(jsonify(res), 200) + + +if __name__ == '__main__': + app.run(debug=True, host='0.0.0.0', port=8000) diff --git a/gardenui/static/css/style.css b/gardenui/static/css/style.css new file mode 100644 index 0000000..08c9ea8 --- /dev/null +++ b/gardenui/static/css/style.css @@ -0,0 +1,73 @@ +html, body { + font-size: 22px !important; + font-family: arial, verdana, helvetica, sans-serif; + color: #b6b6b6; + background: #282929; +} + +h1, h2, h3 {text-align: center;} +p {text-align: center;} +div {text-align: center;} + +.center { + margin-left: auto; + margin-right: auto; + text-align: center; +} + +input { + border: 1px #999999 solid; + background-color: #f6f6f6; + padding: 2px 4px 2px 4px; + margin: 0 0 0.5rem 0; + font-size: 1.0rem; + border-radius: 8px; +} + +input[type="submit" i] { + color: #b6b6b6; + background-color: #282929; + padding: 10px; + margin: 10px 0; + border-color: #b6b6b6; + border-width: 3px; + border-radius: 18px; + font-size: 20px; +} + +input[type="text"] { + border-radius: 8px; +} + +td { + padding: 8px; +} + +.table_left { + text-align: right; +} + +footer { + position: fixed; + /* left: 50%; */ + bottom: 20px; + /* transform: translate(-50%, -50%); */ + margin: 0 auto; +} + +a { + outline: none; + color: #b6b6b6; + text-decoration-line: none; +} + +select { + color: #b6b6b6; + background-color: #282929; + padding: 10px; + margin: 10px 0; + border-color: #b6b6b6; + border-width: 3px; + border-radius: 16px; + font-size: 20px; +} diff --git a/gardenui/static/scripts/garden.js b/gardenui/static/scripts/garden.js new file mode 100644 index 0000000..08734f0 --- /dev/null +++ b/gardenui/static/scripts/garden.js @@ -0,0 +1,116 @@ +var on_switch_water = function() { + var state = true; + if(document.getElementById("water_switch").value == "ausschalten") { + state = false; + } + var json_str = JSON.stringify({"id": "3", "waterstate": state}); + patch_sample(json_str); +} + +var on_switch_auto_state = function() { + var state = true; + if(document.getElementById("auto_switch").value == "ausschalten") { + state = false; + } + var json_str = JSON.stringify({"water": {"id": "3", "autostate": state}}); + patch_config(json_str); +} + +var on_change_config = function() { + var on_time_one = document.getElementById("water_on_one").value; + var off_time_one = document.getElementById("water_off_one").value; + var on_time_two = document.getElementById("water_on_two").value; + var off_time_two = document.getElementById("water_off_two").value; + var json_str = JSON.stringify({"water": {"id": "3", "times": [{"on_time": on_time_one, "off_time": off_time_one}, {"on_time": on_time_two, "off_time": off_time_two}]}}); + patch_config(json_str); +} + +var http_patch_config = new XMLHttpRequest(); +http_patch_config.onreadystatechange = function () { + if (http_patch_config.readyState === 4) { + var status = http_patch_config.status; + if (status === 0 || (status >= 200 && status < 400)) { + // The request has been completed successfully + parse_config(http_patch_config.responseText); + } + } else { + // request error + } +} +var patch_config = function(config) { + http_patch_config.abort(); + http_patch_config.open("PATCH", "/config"); + http_patch_config.setRequestHeader("Content-Type", "application/json;charset=UTF-8"); + http_patch_config.send(config); +} + +var patch_http = new XMLHttpRequest(); +var patch_sample = function(sample) { + patch_http.abort(); + patch_http.open("PATCH", "/sample"); + patch_http.setRequestHeader("Content-Type", "application/json;charset=UTF-8"); + patch_http.send(sample); +} + +var parse_config = function (event) { + var config = JSON.parse(event) + var output = "einschalten" + var visibility = 'hidden' + if(config.water && config.water.id == '3') { + if(config.water.autostate) { + output = "ausschalten" + visibility = "visible" + document.getElementById("water_on_one").value = config.water.times[0].on_time; + document.getElementById("water_off_one").value = config.water.times[0].off_time; + document.getElementById("water_on_two").value = config.water.times[1].on_time; + document.getElementById("water_off_two").value = config.water.times[1].off_time; + } + document.getElementById("auto_switch").value = output; + document.getElementById("water_times").style.visibility = visibility + } +} + +var parse_sample = function (event) { + var sample = JSON.parse(event) + if(sample.water && sample.water.id == '3') { + var switch_caption = "einschalten"; + if(sample.water.state) { + switch_caption = "ausschalten"; + } + document.getElementById("water_switch").value = switch_caption; + } +} + +var http = new XMLHttpRequest(); +http.onreadystatechange = function () { + if (http.readyState === 4) { + var status = http.status; + if (status === 0 || (status >= 200 && status < 400)) { + // The request has been completed successfully + parse_sample(http.responseText); + setTimeout(function () { + http.open("GET", 'sample/3'); + http.send(); + }, 500); + } + } else { + // request error + } +} +http.open("GET", "sample/3"); +http.send(); + +var http_get_config = new XMLHttpRequest(); +http_get_config.onreadystatechange = function () { + if (http_get_config.readyState === 4) { + var status = http_get_config.status; + if (status === 0 || (status >= 200 && status < 400)) { + // The request has been completed successfully + parse_config(http_get_config.responseText); + } + } else { + // request error + } +} +http_get_config.open("GET", "config/3"); +http_get_config.send(); diff --git a/gardenui/static/scripts/greenhouse_1.js b/gardenui/static/scripts/greenhouse_1.js new file mode 100644 index 0000000..f958ae7 --- /dev/null +++ b/gardenui/static/scripts/greenhouse_1.js @@ -0,0 +1,176 @@ +var on_switch_heat = function() { + var state = true; + if(document.getElementById("heat_switch").value == "ausschalten") { + state = false; + } + var json_str = JSON.stringify({"id": "1", "heatstate": state}); + patch_sample(json_str); +} + +var on_switch_heat_autostate = function() { + var state = true; + if(document.getElementById("heat_auto_switch").value == "ausschalten") { + state = false; + } + var json_str = JSON.stringify({"heat": {"id": "1", "autostate": state}}); + patch_config(json_str); +} + +var on_increase_on_temperature = function() { + var json_str = JSON.stringify({"heat": {"id": "1", "increase_on_temperature": true}}); + patch_config(json_str); +} + +var on_increase_off_temperature = function() { + var json_str = JSON.stringify({"heat": {"id": "1", "increase_off_temperature": true}}); + patch_config(json_str); +} + +var on_decrease_on_temperature = function() { + var json_str = JSON.stringify({"heat": {"id": "1", "decrease_on_temperature": true}}); + patch_config(json_str); +} + +var on_decrease_off_temperature = function() { + var json_str = JSON.stringify({"heat": {"id": "1", "decrease_off_temperature": true}}); + patch_config(json_str); +} + +var on_switch_water = function() { + var state = true; + if(document.getElementById("water_switch").value == "ausschalten") { + state = false; + } + var json_str = JSON.stringify({"id": "1", "waterstate": state}); + patch_sample(json_str); +} + +var on_switch_water_auto_state = function() { + var state = true; + if(document.getElementById("water_auto_switch").value == "ausschalten") { + state = false; + } + var json_str = JSON.stringify({"water": {"id": "1", "autostate": state}}); + patch_config(json_str); +} + +var on_change_config = function() { + var on_time_one = document.getElementById("water_on_one").value; + var off_time_one = document.getElementById("water_off_one").value; + var on_time_two = document.getElementById("water_on_two").value; + var off_time_two = document.getElementById("water_off_two").value; + var json_str = JSON.stringify({"water": {"id": "1", "times": [{"on_time": on_time_one, "off_time": off_time_one}, {"on_time": on_time_two, "off_time": off_time_two}]}}); + patch_config(json_str); +} + +var http_patch_config = new XMLHttpRequest(); +http_patch_config.onreadystatechange = function () { + if (http_patch_config.readyState === 4) { + var status = http_patch_config.status; + if (status === 0 || (status >= 200 && status < 400)) { + // The request has been completed successfully + parse_config(http_patch_config.responseText); + } + } else { + // request error + } +} +var patch_config = function(config) { + http_patch_config.abort(); + http_patch_config.open("PATCH", "/config"); + http_patch_config.setRequestHeader("Content-Type", "application/json;charset=UTF-8"); + http_patch_config.send(config); +} + +var patch_http = new XMLHttpRequest(); +var patch_sample = function(sample) { + patch_http.abort(); + patch_http.open("PATCH", "/sample"); + patch_http.setRequestHeader("Content-Type", "application/json;charset=UTF-8"); + patch_http.send(sample); +} + +var parse_config = function (event) { + var config = JSON.parse(event) + var output = "einschalten" + var visibility = 'hidden' + if(config.heat && config.heat.id == '1') { + if(config.heat.autostate) { + output = "ausschalten" + visibility = "visible" + document.getElementById("on_temperature").innerHTML = config.heat.on_temperature; + document.getElementById("off_temperature").innerHTML = config.heat.off_temperature; + } + document.getElementById("heat_auto_switch").value = output; + document.getElementById("config_temperatures").style.visibility = visibility + } + output = "einschalten" + visibility = 'hidden' + if(config.water && config.water.id == '1') { + if(config.water.autostate) { + output = "ausschalten" + visibility = "visible" + document.getElementById("water_on_one").value = config.water.times[0].on_time; + document.getElementById("water_off_one").value = config.water.times[0].off_time; + document.getElementById("water_on_two").value = config.water.times[1].on_time; + document.getElementById("water_off_two").value = config.water.times[1].off_time; + } + document.getElementById("water_auto_switch").value = output; + document.getElementById("water_times").style.visibility = visibility + } +} + +var parse_sample = function (event) { + var sample = JSON.parse(event) + if(sample.heat && sample.heat.id == '1') { + var switch_caption = "einschalten"; + if(sample.heat.state) { + switch_caption = "ausschalten"; + } + document.getElementById("heat_switch").value = switch_caption; + } + if(sample.temperature && sample.temperature.id == '1') { + document.getElementById("temperature_value").innerHTML = sample.temperature.value; + } + if(sample.water && sample.water.id == '1') { + var switch_caption = "einschalten"; + if(sample.water.state) { + switch_caption = "ausschalten"; + } + document.getElementById("water_switch").value = switch_caption; + } +} + +var http = new XMLHttpRequest(); +http.onreadystatechange = function () { + if (http.readyState === 4) { + var status = http.status; + if (status === 0 || (status >= 200 && status < 400)) { + // The request has been completed successfully + parse_sample(http.responseText); + setTimeout(function () { + http.open("GET", 'sample/1'); + http.send(); + }, 500); + } + } else { + // request error + } +} +http.open("GET", "sample/1"); +http.send(); + +var http_get_config = new XMLHttpRequest(); +http_get_config.onreadystatechange = function () { + if (http_get_config.readyState === 4) { + var status = http_get_config.status; + if (status === 0 || (status >= 200 && status < 400)) { + // The request has been completed successfully + parse_config(http_get_config.responseText); + } + } else { + // request error + } +} +http_get_config.open("GET", "config/1"); +http_get_config.send(); diff --git a/gardenui/static/scripts/greenhouse_2.js b/gardenui/static/scripts/greenhouse_2.js new file mode 100644 index 0000000..a8581f5 --- /dev/null +++ b/gardenui/static/scripts/greenhouse_2.js @@ -0,0 +1,116 @@ +var on_switch_water = function() { + var state = true; + if(document.getElementById("water_switch").value == "ausschalten") { + state = false; + } + var json_str = JSON.stringify({"id": "2", "waterstate": state}); + patch_sample(json_str); +} + +var on_switch_auto_state = function() { + var state = true; + if(document.getElementById("auto_switch").value == "ausschalten") { + state = false; + } + var json_str = JSON.stringify({"water": {"id": "2", "autostate": state}}); + patch_config(json_str); +} + +var on_change_config = function() { + var on_time_one = document.getElementById("water_on_one").value; + var off_time_one = document.getElementById("water_off_one").value; + var on_time_two = document.getElementById("water_on_two").value; + var off_time_two = document.getElementById("water_off_two").value; + var json_str = JSON.stringify({"water": {"id": "2", "times": [{"on_time": on_time_one, "off_time": off_time_one}, {"on_time": on_time_two, "off_time": off_time_two}]}}); + patch_config(json_str); +} + +var http_patch_config = new XMLHttpRequest(); +http_patch_config.onreadystatechange = function () { + if (http_patch_config.readyState === 4) { + var status = http_patch_config.status; + if (status === 0 || (status >= 200 && status < 400)) { + // The request has been completed successfully + parse_config(http_patch_config.responseText); + } + } else { + // request error + } +} +var patch_config = function(config) { + http_patch_config.abort(); + http_patch_config.open("PATCH", "/config"); + http_patch_config.setRequestHeader("Content-Type", "application/json;charset=UTF-8"); + http_patch_config.send(config); +} + +var patch_http = new XMLHttpRequest(); +var patch_sample = function(sample) { + patch_http.abort(); + patch_http.open("PATCH", "/sample"); + patch_http.setRequestHeader("Content-Type", "application/json;charset=UTF-8"); + patch_http.send(sample); +} + +var parse_config = function (event) { + var config = JSON.parse(event) + var output = "einschalten" + var visibility = 'hidden' + if(config.water && config.water.id == '2') { + if(config.water.autostate) { + output = "ausschalten" + visibility = "visible" + document.getElementById("water_on_one").value = config.water.times[0].on_time; + document.getElementById("water_off_one").value = config.water.times[0].off_time; + document.getElementById("water_on_two").value = config.water.times[1].on_time; + document.getElementById("water_off_two").value = config.water.times[1].off_time; + } + document.getElementById("auto_switch").value = output; + document.getElementById("water_times").style.visibility = visibility + } +} + +var parse_sample = function (event) { + var sample = JSON.parse(event) + if(sample.water && sample.water.id == '2') { + var switch_caption = "einschalten"; + if(sample.water.state) { + switch_caption = "ausschalten"; + } + document.getElementById("water_switch").value = switch_caption; + } +} + +var http = new XMLHttpRequest(); +http.onreadystatechange = function () { + if (http.readyState === 4) { + var status = http.status; + if (status === 0 || (status >= 200 && status < 400)) { + // The request has been completed successfully + parse_sample(http.responseText); + setTimeout(function () { + http.open("GET", 'sample/2'); + http.send(); + }, 500); + } + } else { + // request error + } +} +http.open("GET", "sample/2"); +http.send(); + +var http_get_config = new XMLHttpRequest(); +http_get_config.onreadystatechange = function () { + if (http_get_config.readyState === 4) { + var status = http_get_config.status; + if (status === 0 || (status >= 200 && status < 400)) { + // The request has been completed successfully + parse_config(http_get_config.responseText); + } + } else { + // request error + } +} +http_get_config.open("GET", "config/2"); +http_get_config.send(); diff --git a/gardenui/templates/garden.html b/gardenui/templates/garden.html new file mode 100644 index 0000000..9d66846 --- /dev/null +++ b/gardenui/templates/garden.html @@ -0,0 +1,77 @@ + + + + Garten + + + + + + +

Garten

+ + + + + + + + + +
Bewässerung + +
Zeigesteuerte Bewässerung + +
+ + + + \ No newline at end of file diff --git a/gardenui/templates/greenhouse_1.html b/gardenui/templates/greenhouse_1.html new file mode 100644 index 0000000..f7cac27 --- /dev/null +++ b/gardenui/templates/greenhouse_1.html @@ -0,0 +1,123 @@ + + + + Gewächshaus 1 + + + + + + +

Gewächshaus 1

+
+ + + + + +

Temperatur

+ + + + + + + + + +
Heizung + +
Frostwächter + +
+ +
+ + + + + + + + + +
Bewässerung + +
Zeigesteuerte Bewässerung + +
+ + + + \ No newline at end of file diff --git a/gardenui/templates/greenhouse_2.html b/gardenui/templates/greenhouse_2.html new file mode 100644 index 0000000..0d2d075 --- /dev/null +++ b/gardenui/templates/greenhouse_2.html @@ -0,0 +1,77 @@ + + + + Gewächshaus 2 + + + + + + +

Gewächshaus 2

+ + + + + + + + + +
Bewässerung + +
Zeigesteuerte Bewässerung + +
+ + + + \ No newline at end of file diff --git a/gardenui/templates/index.html b/gardenui/templates/index.html new file mode 100644 index 0000000..15a3e89 --- /dev/null +++ b/gardenui/templates/index.html @@ -0,0 +1,26 @@ + + + + Garten + + + + + +

Garten

+ + + + + diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..4915a13 --- /dev/null +++ b/setup.py @@ -0,0 +1,40 @@ + +import os +import shutil +import stat +from setuptools import setup +from setuptools.command.install import install + +NAME = 'Gardenui' +VERSION = '1' +AUTHOR = 'Thomas Klaehn' +EMAIL = 'tkl@blackfinn.de' +PACKAGES = ['gardenui'] +REQUIRES = ['Flask', 'gunicorn'] +PACKAGE_DATA = {'gardenui': ['templates/*', 'static/css/*', 'static/scripts/*']} + +SERVICEDIR = "/lib/systemd/system" +DAEMON_START_SCRIPT = os.path.join(SERVICEDIR, 'gardenui.service') + +LOGFILE = "/var/log/gardenui.log" + +class Install(install): + def run(self): + install.run(self) + os.makedirs(SERVICEDIR, exist_ok=True) + shutil.copyfile('gardenui.service', os.path.join(SERVICEDIR, DAEMON_START_SCRIPT)) + os.chmod(DAEMON_START_SCRIPT, stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH) + + try: + open(LOGFILE, 'r') + except FileNotFoundError: + os.makedirs(os.path.dirname(LOGFILE), exist_ok=True) + open(LOGFILE, 'x') + os.chmod(LOGFILE, stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | + stat.S_IWGRP | stat.S_IROTH | stat.S_IWOTH) + + +setup(name=NAME, version=VERSION, long_description=__doc__, author=AUTHOR, + author_email=EMAIL, packages=PACKAGES, include_package_data=True, + package_data=PACKAGE_DATA, zip_safe=False, install_requires=REQUIRES, + cmdclass={'install': Install})