summaryrefslogtreecommitdiff
path: root/run.py
diff options
context:
space:
mode:
authoryo mama <pepper@scannerjammer.com>2015-02-15 18:21:14 -0800
committeryo mama <pepper@scannerjammer.com>2015-02-15 18:21:14 -0800
commitca7216ef0777de4ea226c6d672c4862362f9e74c (patch)
tree35444af3fe7159efb6c6358a21b1c1867e4fd6fd /run.py
parent08640b7ab204e99463f37e5efb4af28f091c0b61 (diff)
finalizing
Diffstat (limited to 'run.py')
-rw-r--r--run.py48
1 files changed, 0 insertions, 48 deletions
diff --git a/run.py b/run.py
deleted file mode 100644
index 71cc247..0000000
--- a/run.py
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/usr/bin/python
-from bottle import route, run, static_file, request
-import makeDither
-import urlDownload
-from os import urandom
-from uuid import uuid4
-from pbutils import now, hexdir, pb_s3
-
-nametag = "imDither";
-
-@route('/')
-def server_static():
- return static_file("imdither.html", root='./')
-
-#@route('/getId')
-#def make_id():
-# return "%s_%s_%s" % (uuid4(), nametag, now());
-
-@route('/dithers/<filename>')
-def server_static(filename):
- return static_file(filename, root='./dithers/')
-
-@route('/img/<filename>')
-def server_static(filename):
- return static_file(filename, root='./img/')
-
-@route('/<filename>')
-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')
- unique_id = request.forms.get('unique_id');
- download = urlDownload.UrlDownload(url)
- tempfile = download.dir + download.filename
- dither = makeDither.Dither(tempfile)
- hexdir_name = hexdir(dither.result_file);
-
- return pb_s3(hexdir_name, dither.result_file);
-
-@route('/status', method='GET')
-def show_status():
- pass
-run(host='localhost', port=4111, debug=True)
-#run(server='flup', host='localhost', port=4111, debug=True)
-