Skip to content

Commit

Permalink
begin working on sequence handler
Browse files Browse the repository at this point in the history
ref #3
  • Loading branch information
maxgrossman committed Apr 22, 2018
1 parent 8b55ce3 commit e80afb0
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
5 changes: 5 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"development": {
"port": 8888
}
}
15 changes: 15 additions & 0 deletions handlers/sequence.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
class SequenceHandler(RequestHandler):
def post(self, dir_name_array):
# response
try:
# get the image paths
# cut them into sequences
# move them to path /sequence/<sequence_id>/
# do the sequence generating
self.set_status(200)

except:
self.write_error()

finally:
self.finish()
16 changes: 16 additions & 0 deletions index.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import tornado.ioloop
import tornado.web
import json
from os import environ
# config
with open('config.json', 'w') as f:
config = json.load(f)

devPort = config[environ['ENV'] if 'ENV' in environ.keys() else 'development']

if __name__ == "__main__":
app = tornado.web.Application([
url(r'/sequence', sequenceHandler)
])
app.listen(devPort)
app.ioloop.IOLoop.current().start()

0 comments on commit e80afb0

Please sign in to comment.