diff options
| author | yo mama <pepper@scannerjammer.com> | 2015-02-13 02:41:42 -0800 |
|---|---|---|
| committer | yo mama <pepper@scannerjammer.com> | 2015-02-13 02:41:42 -0800 |
| commit | 64f41d53728a966f10aef6d7ffbc00853d754300 (patch) | |
| tree | 082f17db25c61f66aec87dc47fbc208cb17ca168 /impattern/run.py | |
| parent | fab0563ff31365c2396f7353679c8239aed3ce8b (diff) | |
fixed some basics
Diffstat (limited to 'impattern/run.py')
| -rw-r--r-- | impattern/run.py | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/impattern/run.py b/impattern/run.py deleted file mode 100644 index 71cc247..0000000 --- a/impattern/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) - |
