From 577e625a5135a3652df07afd49d6c48c95d2621d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20M=C3=BCller?= Date: Thu, 26 Oct 2017 13:07:06 +0200 Subject: [PATCH] Revert "add images" This reverts commit f570309d9cc64b761aa2354da885be9cdf8d1b42. --- requirements.txt | 1 - soundboard.py | 19 ------------------- static/main.js | 17 ----------------- templates/index.html | 11 ----------- 4 files changed, 48 deletions(-) diff --git a/requirements.txt b/requirements.txt index 639537d..6aee249 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,4 +4,3 @@ itsdangerous==0.24 Jinja2==2.9.6 MarkupSafe==1.0 Werkzeug==0.12.2 -requests \ No newline at end of file diff --git a/soundboard.py b/soundboard.py index f6417b4..d6d7616 100644 --- a/soundboard.py +++ b/soundboard.py @@ -1,9 +1,6 @@ import os -import shutil import subprocess -import tempfile -import requests from flask import Flask, render_template, request, redirect, url_for, send_from_directory import config @@ -56,19 +53,3 @@ def index(sound=None, text=None, video=None): @app.route("/sounds/") def sounds(name): return send_from_directory(config.path, name) - -@app.route("/image/") -def image(imageurl=None): - if not imageurl: - return False - with tempfile.NamedTemporaryFile(mode="wb", buffering=True) as tmp: - image = requests.get(imageurl, stream=True) - if not image.ok: - return False - shutil.copyfileobj(image.raw, tmp) - subprocess.Popen(["killall", "pngview"]) - subprocess.Popen(["/opt/raspidmx/pngview/pngview", "-b", "0", "-d", "0", "-n", tmp.name]) - -@app.route("/kill/images") -def killImages(): - subprocess.Popen(["killall", "pngview"]) diff --git a/static/main.js b/static/main.js index 0adffca..01f86b4 100644 --- a/static/main.js +++ b/static/main.js @@ -197,20 +197,3 @@ function killAllAudio() { ajaxRequest("/?killvideo=yes"); } } - - - -/* -* Reads the stream url from input with id #streaming-url and forwards it to the server using AJAX. -*/ -function showImage() { - var streamUrl = document.querySelector("#streaming-url").value; - ajaxRequest("/image/?imageurl="+encodeURI(streamUrl)); -} - -/* -* Kills all images -*/ -function killAllImages() { - ajaxRequest("/kill/images"); -} diff --git a/templates/index.html b/templates/index.html index 51cfbfe..3e31879 100644 --- a/templates/index.html +++ b/templates/index.html @@ -33,7 +33,6 @@ Sounds Streams Voices - Images -