author | ymh <ymh.work@gmail.com> |
Mon, 13 Oct 2014 12:43:47 +0200 | |
changeset 13 | 435d5c15275a |
parent 3 | 1b94e6e9579f |
child 22 | 986ee928a866 |
permissions | -rw-r--r-- |
0 | 1 |
|
2 |
# |
|
3 |
# See LICENCE for detail |
|
4 |
# Copyright (c) 2014 IRI |
|
5 |
# |
|
6 |
||
2
fc1ab0074e29
export config in config file + add static file
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
7 |
import os.path |
0 | 8 |
import sys |
9 |
||
10 |
import psycopg2.extras |
|
11 |
||
12 |
from twisted.application import service |
|
13 |
from twisted.python import log |
|
14 |
from txpostgres import txpostgres |
|
15 |
||
16 |
from annotserver import make_service |
|
13
435d5c15275a
clean client npm and gulp config, change flask root url, reference static url in template, change config management to follow flask convention
ymh <ymh.work@gmail.com>
parents:
3
diff
changeset
|
17 |
import config |
0 | 18 |
from models import get_table_create_stmt |
19 |
from utils import create_connection_pool |
|
20 |
||
21 |
||
22 |
psycopg2.extras.register_uuid() |
|
23 |
||
24 |
||
13
435d5c15275a
clean client npm and gulp config, change flask root url, reference static url in template, change config management to follow flask convention
ymh <ymh.work@gmail.com>
parents:
3
diff
changeset
|
25 |
conn, d = create_connection_pool(config.CONN_STR) |
0 | 26 |
#to do treat error |
27 |
d.addCallback(lambda _: conn.runOperation(get_table_create_stmt())) |
|
28 |
||
29 |
#TOODO Log |
|
30 |
#log.startLogging(sys.stdout) |
|
31 |
||
32 |
||
33 |
application = service.Application("annot-server") |
|
34 |
||
13
435d5c15275a
clean client npm and gulp config, change flask root url, reference static url in template, change config management to follow flask convention
ymh <ymh.work@gmail.com>
parents:
3
diff
changeset
|
35 |
annotserver = make_service(conn) |
0 | 36 |
annotserver.setServiceParent(service.IServiceCollection(application)) |