strix

A simple web UI for motion
git clone https://www.brianlane.com/git/strix
Log | Files | Refs | LICENSE

commit f7cdf01fd1db66c3916fd8a0df982cfa35386de0
parent 0bb797790056181cd1d12be59b795c0ab2bc1b99
Author: Brian C. Lane <bcl@brianlane.com>
Date:   Sat, 12 Aug 2017 12:26:26 -0700

Move the UI code inside the package

Diffstat:
Msetup.py | 4+++-
Msrc/strix/api.py | 3++-
Rstatic/index.html -> src/strix/ui/index.html | 0
Rstatic/jquery.js -> src/strix/ui/jquery.js | 0
Rstatic/mediaelement-and-player.min.js -> src/strix/ui/mediaelement-and-player.min.js | 0
Rstatic/mediaelementplayer.min.css -> src/strix/ui/mediaelementplayer.min.css | 0
Rstatic/mejs-controls.svg -> src/strix/ui/mejs-controls.svg | 0
Rstatic/style.css -> src/strix/ui/style.css | 0
8 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/setup.py b/setup.py @@ -25,6 +25,8 @@ setup( name="strix", version="0.0.1", packages=find_packages(), + package_dir = {"strix": "src/strix"}, + package_data = {"strix": ["ui/*"]}, setup_requires=['nose>=1.0', 'setuptools-lint'], tests_require=['tox', 'coverage', 'nose', 'pylint'], cmdclass={'test': Tox}, @@ -32,7 +34,7 @@ setup( author="Brian Lane", author_email="bcl@brianlane.com", description="A Motion Camera API Server and UI", - license="NeedToDecide", + license="GPLv2", keywords="motion security camera strix", url="https://www.brianlane.com/software/strix.html" ) diff --git a/src/strix/api.py b/src/strix/api.py @@ -16,6 +16,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. from datetime import datetime import multiprocessing as mp +import os import threading from bottle import route, run, static_file, request, Response @@ -34,7 +35,7 @@ def run_api(logging_queue: mp.Queue, base_dir: str, host: str, port: int, debug: @route('/') @route('/<filename>') def serve_root(filename: str = "index.html") -> Response: - return static_file(filename, root="./static") + return static_file(filename, root=os.path.dirname(__file__)+"/ui") @route('/motion/<filepath:path>') def serve_motion(filepath: str) -> Response: diff --git a/static/index.html b/src/strix/ui/index.html diff --git a/static/jquery.js b/src/strix/ui/jquery.js diff --git a/static/mediaelement-and-player.min.js b/src/strix/ui/mediaelement-and-player.min.js diff --git a/static/mediaelementplayer.min.css b/src/strix/ui/mediaelementplayer.min.css diff --git a/static/mejs-controls.svg b/src/strix/ui/mejs-controls.svg diff --git a/static/style.css b/src/strix/ui/style.css