Project

General

Profile

Revision 0f56fff9

ID0f56fff9b58e9d405450d8f3e8411b4179737243
Parent 0e24cd14
Child 6c664a14

Added by Francois POIROTTE over 14 years ago

Migration des settings de deploiement depuis vigi*_cfg.py vers le fichier INI correspondant.
Ajout d'un patch pour PasteDeploy qui permet de gérer les échapements dans l'interpolation.
Ticket associé: http://trac.pythonpaste.org/pythonpaste/ticket/379

git-svn-id: https://vigilo-dev.si.c-s.fr/svn@654 b22e2e97-25c9-44ff-b637-2e5ceca36478

View differences:

vigiboard/config/middleware.py
4 4

  
5 5
from vigiboard.config.app_cfg import base_config
6 6
from vigiboard.config.environment import load_environment
7
from vigiboard.config.vigiboard_cfg import vigiboard_config
8
from paste.cascade import Cascade
9
from paste.urlparser import StaticURLParser
10 7

  
11 8
__all__ = ['make_app']
12 9

  
......
20 17
    Set vigiboard up with the settings found in the PasteDeploy configuration
21 18
    file used.
22 19
    
23
    :param global_conf: The global settings for vigiboard (those
24
        defined under the ``[DEFAULT]`` section).
25
    :type global_conf: dict
26
    :param full_stack: Should the whole TG2 stack be set up?
27
    :type full_stack: str or bool
28
    :return: The vigiboard application with all the relevant middleware
29
        loaded.
30
    
31 20
    This is the PasteDeploy factory for the vigiboard application.
32 21
    
33
    ``app_conf`` contains all the application-specific settings (those defined
34
    under ``[app:main]``.
22
    C{app_conf} contains all the application-specific settings (those defined
23
    under ``[app:main]``).
35 24
    
36
   
25
    @param global_conf: The global settings for vigiboard (those
26
        defined under the ``[DEFAULT]`` section).
27
    @type global_conf: C{dict}
28
    @param full_stack: Should the whole TG2 stack be set up?
29
    @type full_stack: C{str} or C{bool}
30
    @return: The vigiboard application with all the relevant middleware
31
        loaded.
37 32
    """
38
    # chargement de la config
39
    for i in vigiboard_config:
40
        app_conf[i] = vigiboard_config[i]
41

  
42
    # on cré l'application de base
43 33
    app = make_base_app(global_conf, full_stack=True, **app_conf)
44 34

  
45
    # on rajoute le path public de l'application
46
    import vigiboard
47
    app = Cascade([
48
        StaticURLParser(global_conf['here'] + '/' + app_conf['appname']  + '/public'),
49
        StaticURLParser(vigiboard.__file__.rsplit('/',1)[0] + '/public'),app]
50
        )
51
    
35
    # Wrap your base TurboGears 2 application with custom middleware here
36

  
52 37
    return app
53 38

  

Also available in: Unified diff