aboutsummaryrefslogtreecommitdiff
path: root/clesana
blob: 13c8ba7799030300eb53f3470a75495d13f5e864 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env python3

import sys

import lesana
import cherrypy

import cherry_lesana as cl

from pkg_resources import resource_filename

def main():
    # TODO: read config from a file or something
    config = {
        '/': {
            'tools.staticdir.root': resource_filename(
                'cherry_lesana',
                'data',
                )
            },
        '/static': {
            'tools.staticdir.on': True,
            'tools.staticdir.dir': 'static',
            }
        }
    # TODO: properly read command line args
    try:
        collection = lesana.Collection(sys.argv[1])
    except IndexError:
        collection = None
    app = cl.App(collection)
    cherrypy.quickstart(app, '/', config)

if __name__ == '__main__':
   main()