| Conditions | 3 |
| Total Lines | 27 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import os |
||
| 10 | def main(global_config, **settings): |
||
| 11 | """This function returns a Pyramid WSGI application.""" |
||
| 12 | |||
| 13 | # update settings |
||
| 14 | settings["layout.focus_conceptschemes"] = aslist( |
||
| 15 | settings["layout.focus_conceptschemes"], flatten=False |
||
| 16 | ) |
||
| 17 | |||
| 18 | # set up dump location |
||
| 19 | dump_location = settings["atramhasis.dump_location"] |
||
| 20 | if not os.path.exists(dump_location): |
||
| 21 | os.makedirs(dump_location) |
||
| 22 | |||
| 23 | with Configurator(settings=settings) as config: |
||
| 24 | # set default session factory |
||
| 25 | atramhasis_session_factory = SignedCookieSessionFactory( |
||
| 26 | settings["atramhasis.session_factory.secret"] |
||
| 27 | ) |
||
| 28 | config.set_session_factory(atramhasis_session_factory) |
||
| 29 | |||
| 30 | # Set up atramhasis |
||
| 31 | config.include("atramhasis") |
||
| 32 | # Set up atramhasis db |
||
| 33 | config.include("atramhasis:data.db") |
||
| 34 | |||
| 35 | config.scan() |
||
| 36 | return config.make_wsgi_app() |
||
| 37 |