Compare commits

...

1 Commits

Author SHA1 Message Date
0xee b645143b60 Add setup.py 2019-10-31 17:37:41 +01:00
7 changed files with 28 additions and 7 deletions

View File

@ -1,7 +1,8 @@
{ python }:
with python.pkgs;
buildPythonPackage rec {
buildPythonApplication rec {
name = "mqtt-dash";
src = ./.;
propagatedBuildInputs = [ flask ];
doCheck = false;
}

9
mqtt-dash Executable file
View File

@ -0,0 +1,9 @@
#!/usr/bin/env python
import os
from mqtt_dash.app import app
app.secret_key = os.urandom(12)
app.run(debug=False, host='0.0.0.0', port=4000)

1
mqtt_dash/__init__.py Normal file
View File

@ -0,0 +1 @@
from .app import app

View File

@ -2,7 +2,6 @@
from flask import Flask, flash, redirect, render_template_string
from flask import render_template, request, session, abort
import os
import uuid
app = Flask(__name__)
@ -200,8 +199,3 @@ def home():
row_layout("Some buttons", button_widget("test", "set to 1", 1),
button_widget("test", "set to foo", 'foo'))
])
if __name__ == "__main__":
app.secret_key = os.urandom(12)
app.run(debug=True, host='0.0.0.0', port=4000)

14
setup.py Normal file
View File

@ -0,0 +1,14 @@
#!/usr/bin/env python
from distutils.core import setup
setup(
name='mqtt-dash',
version='0.1',
description='MQTT Dashboard',
author='0xee',
author_email='mqtt-dash@0xee.eu',
packages=['mqtt_dash'],
scripts=['mqtt-dash'],
package_data={'mqtt_dash': ['templates/*.html']},
)

2
shell.nix Normal file
View File

@ -0,0 +1,2 @@
{ pkgs ? import <nixpkgs> {} }:
pkgs.callPackage ./. { python = pkgs.python3; }