forked from nextgis/nextgisweb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
__init__.py
98 lines (81 loc) · 2.86 KB
/
__init__.py
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# -*- coding: utf-8 -*-
import codecs
from ConfigParser import ConfigParser
from pyramid.config import Configurator
from pyramid.paster import setup_logging
from pyramid.authentication import AuthTktAuthenticationPolicy
from pyramid.authorization import ACLAuthorizationPolicy
from sqlalchemy import engine_from_config
from .models import (
DBSession,
Base,
)
from .component import Component, load_all
from .env import Env, setenv
def pkginfo():
components = (
'core',
'pyramidcomp',
'auth',
'security',
'spatial_ref_sys',
'layer_group',
'layer',
'feature_layer',
'feature_description',
'feature_photo',
'style',
'marker_library',
'webmap',
'layer_group.root',
'file_storage',
'vector_layer',
'postgis_layer',
'raster_layer',
'raster_style',
'wmsclient',
'file_upload',
)
return dict(
components=dict(map(
lambda (i): (i, "nextgisweb.%s" % i),
components)
)
)
def main(global_config, **settings):
""" This function returns a Pyramid WSGI application. """
if 'logging' in settings:
setup_logging(settings['logging'])
cfg = ConfigParser()
cfg.readfp(codecs.open(settings['config'], 'r', 'utf-8'))
env = Env(cfg)
env.initialize()
setenv(env)
config = env.pyramid.make_app(settings)
return config.make_wsgi_app()
def amd_packages():
return (
# Сторонние пакеты
('dojo', 'nextgisweb:amd_packages/contrib/dojo'),
('dijit', 'nextgisweb:amd_packages/contrib/dijit'),
('dojox', 'nextgisweb:amd_packages/contrib/dojox'),
('cbtree', 'nextgisweb:amd_packages/contrib/cbtree'),
('xstyle', 'nextgisweb:amd_packages/contrib/xstyle'),
('put-selector', 'nextgisweb:amd_packages/contrib/put-selector'),
('dgrid', 'nextgisweb:amd_packages/contrib/dgrid'),
# Пакеты nextgisweb
('ngw', 'nextgisweb:amd_packages/ngw'),
('security', 'nextgisweb:amd_packages/security'),
('layer_group', 'nextgisweb:amd_packages/layer_group'),
('layer', 'nextgisweb:amd_packages/layer'),
('style', 'nextgisweb:amd_packages/style'),
('feature_layer', 'nextgisweb:amd_packages/feature_layer'),
('feature_description', 'nextgisweb:amd_packages/feature_description'),
('feature_photo', 'nextgisweb:amd_packages/feature_photo'),
('webmap', 'nextgisweb:amd_packages/webmap'),
('vector_layer', 'nextgisweb:amd_packages/vector_layer'),
('postgis_layer', 'nextgisweb:amd_packages/postgis_layer'),
('raster_layer', 'nextgisweb:amd_packages/raster_layer'),
('raster_style', 'nextgisweb:amd_packages/raster_style'),
('wmsclient', 'nextgisweb:amd_packages/wmsclient'),
)