From 236fd1d9f2009083fbbfce7190c27fbf1d7c88b8 Mon Sep 17 00:00:00 2001 From: yo mama Date: Fri, 7 Aug 2015 18:33:30 -0700 Subject: getting ready --- frontend/imdither/run.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 frontend/imdither/run.py (limited to 'frontend/imdither/run.py') diff --git a/frontend/imdither/run.py b/frontend/imdither/run.py new file mode 100755 index 0000000..3fed429 --- /dev/null +++ b/frontend/imdither/run.py @@ -0,0 +1,35 @@ +#!/usr/bin/python2.7 +from bottle import route, run, static_file, request +import makeDither +import urlDownload + +@route('/') +def server_static(): + return static_file("imdither.html", root='./') + +@route('/dithers/') +def server_static(filename): + return static_file(filename, root='./dithers/') + +@route('/img/') +def server_static(filename): + return static_file(filename, root='./img/') + +@route('/') +def server_static(filename): + return static_file(filename, root='./') + +@route('/process', method='POST') +def process_image(): + url = request.forms.get('url') + params = request.forms.get('params') + download = urlDownload.UrlDownload(url) + tempfile = download.dir + download.filename + makeDither.Dither(tempfile) + +@route('/status', method='GET') +def show_status(): + pass +#run(host='0.0.0.0', port=4111, debug=True) +run(server='flup', host='localhost', port=4111, debug=True) + -- cgit v1.2.3-70-g09d2