12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- # coding=utf-8
- import os
- import tornado.httpserver
- import tornado.ioloop
- import tornado.options
- import tornado.web
- from tornado.options import define, options
- define("port", default=8000, help="run on the given port", type=int)
- class Application(tornado.web.Application):
- def __init__(self):
- handlers = [
- (r"/", MainHandler),
- ]
- settings = dict(
- template_path=os.path.join(os.path.dirname(__file__), "templates"),
- static_path=os.path.join(os.path.dirname(__file__), "static"),
- debug=True,
- )
- tornado.web.Application.__init__(self, handlers, **settings)
- class MainHandler(tornado.web.RequestHandler):
- def get(self):
- self.render(
- "index.html",
- title = """Preservation of three-dimensional anatomy in phosphatized
- fossil arthropods enriches evolutionary inference""",
- author = """Achim H Schwermann, Tomy dos Santos Rolo, Michael S Caterino,
- Günter Bechly, Heiko Schmied, Tilo Baumbach, Thomas van de Kamp""",
- institute = """Steinmann Institute for Geology, Mineralogy and Paleontology,
- University of Bonn, Bonn, Germany; ANKA/Institute for Photon Science and
- Synchrotron Radiation, Karlsruhe Institute of Technology, Eggenstein-Leopoldshafen,
- Germany; Department of Agricultural and Environmental Sciences, Clemson University,
- Clemson, United States; State Museum of Natural History Stuttgart, Stuttgart,Germany;
- Institute of Crop Science and Resource Conservation, University of Bonn, Bonn, Germany;
- Laboratory for Applications of Synchrotron Radiation, Karlsruhe Institute of Technology,
- Karlsruhe, Germany"""
- )
- if __name__ == "__main__":
- tornado.options.parse_command_line()
- http_server = tornado.httpserver.HTTPServer(Application())
- http_server.listen(options.port)
- tornado.ioloop.IOLoop.instance().start()
|