Removed python based webcam support (didn't work well with the raspi), switched instead to external stream (mjpg-streamer being the preferred webcam server)

This commit is contained in:
Gina Häußge committed 2013-01-03 00:39:17 +01:00
1 parent 8dc5e249d5
commit 4e4eed84bb
7 files changed
+67 -124

No files matched your search

+1 -19
View File
@@ -7,7 +7,6 @@ from werkzeug import secure_filename
from printer_webui.printer import Printer, getConnectionOptions
from printer_webui.settings import settings
from printer_webui.webcam import hasWebcamSupport, Webcam
import sys
import os
@@ -28,14 +27,10 @@ if not os.path.isdir(WEBCAM_FOLDER):
app = Flask("printer_webui")
printer = Printer()
if hasWebcamSupport():
webcam = Webcam()
else:
webcam = None
@app.route("/")
def index():
return render_template("index.html")
return render_template("index.html", webcamStream = settings().get("webcam", "stream"))
#~~ Printer state
@@ -261,19 +256,6 @@ def setSettings():
s.save()
return getSettings()
#~~ webcam
@app.route(BASEURL + "webcam/image", methods=["GET"])
def getImage():
if webcam is None:
abort(404)
image = webcam.get()
strIO = StringIO.StringIO()
image.save(strIO, "JPEG", quality=80)
strIO.seek(0)
return send_file(strIO, mimetype="image/jpeg")
#~~ helper functions
def sizeof_fmt(num):