Ñò
Ê¥WJc           @   sÎ  d  Z  d d k Z d d k Z d d k Z d d k l Z d d k Z d d k l Z d d k l	 Z	 d d k
 l Z d d k l Z d d k l Z l Z d d	 k l Z d d
 k l Z d d k l Z d d k l Z d d k l Z l Z d d k Z d d k l Z d d k l  Z  d d k! l" Z" l# Z# l$ Z$ d d k% l& Z& d d k' l( Z( d d k) l* Z* d d k+ l, Z- e i. e/ ƒ Z0 d e f d „  ƒ  YZ1 e1 e ƒ Z d e" f d „  ƒ  YZ2 d „  Z3 d S(   s&   Configuration Helpers for TurboGears 2iÿÿÿÿN(   t   copy(   t	   DictMixin(   t   ugettext(   t
   Translator(   t   config(   t   SessionMiddlewaret   CacheMiddleware(   t   Cascade(   t   RegistryManager(   t   StaticURLParser(   t   asbool(   t   report_libst   StatusCodeRedirect(   t   TGApp(   t   ErrorHandler(   t   Buncht   get_partial_dictt   DottedFileNameFinder(   t   Mapper(   t   RoutesMiddleware(   t   Request(   t   make_middlewaret   PylonsConfigWrapperc           B   sM   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 RS(   sƒ  Wrapper for the Pylons configuration.

    Simple wrapper for the Pylons config object that provides attribute
    style access to the Pylons config dictionary.

    When used in TG, items with keys like "pylons.response_options" will
    be available via config.pylons.response_options as well as
    config['pylons.response_options'].

    This class works by proxying all attribute and dictionary access to
    the underlying Pylons config object, which is an application local
    proxy that allows for multiple Pylons/TG2 applicatoins to live
    in the same process simultaneously, but to always get the right
    config data for the application that's requesting them.

    Sites, with seeking to maximize needs may prefer to use the Pylons
    config stacked object proxy directly, using just dictionary style
    access, particularly whenever config is checked on a per-request basis.

    c         C   s   | |  i  d <d S(   s?   Initialize the object by passing in pylons config to be wrappedt   config_proxyN(   t   __dict__(   t   selft   dict_to_wrap(    (    sn   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/configuration.pyt   __init__7   s    c         C   s   |  i  i ƒ  | S(   N(   R   t   current_conf(   R   t   key(    (    sn   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/configuration.pyt   __getitem__;   s    c         C   s   | |  i  i ƒ  | <d  S(   N(   R   R   (   R   R   t   value(    (    sn   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/configuration.pyt   __setitem__>   s    c         C   sl   y |  i  i | ƒ SWnQ t j
 oE y |  i  i ƒ  | SWqh t j
 o t | |  i  i ƒ  ƒ SXn Xd S(   s$  Our custom attribute getter.

        Tries to get the attribute off the wrapped object first,
        if that does not work, tries dictionary lookup, and finally
        tries to grab all keys that start with the attribute and
        return sub-dictionaries that can be looked up.

        N(   R   t   __getattribute__t   AttributeErrorR   t   KeyErrorR   (   R   R   (    (    sn   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/configuration.pyt   __getattr__A   s    	c         C   s   | |  i  i ƒ  | <d  S(   N(   R   R   (   R   R   R   (    (    sn   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/configuration.pyt   __setattr__R   s    c         C   s:   y |  i  i ƒ  | =Wn t j
 o t | ƒ ‚ n Xd  S(   N(   R   R   R#   R"   (   R   t   name(    (    sn   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/configuration.pyt   __delattr__U   s    c         C   s   |  i  i ƒ  S(   N(   R   t   keys(   R   (    (    sn   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/configuration.pyR(   [   s    (
   t   __name__t
   __module__t   __doc__R   R   R    R$   R%   R'   R(   (    (    (    sn   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/configuration.pyR   !   s   						t	   AppConfigc           B   sæ   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z d
 „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   sW  Class to store application configuration.

    This class should have configuration/setup information
    that is *necessary* for proper application function.
    Deployment specific configuration information should go in
    the config files (e.g. development.ini or deployment.ini).

    AppConfig instances have a number of methods that are meant to be
    overridden by users who wish to have finer grained control over
    the setup of the WSGI envirnment in which their application is run.

    This is the place to configure custom routes, transaction handling,
    error handling, etc.

    c         C   s©   t  ƒ  |  _ t  ƒ  |  _ t  ƒ  |  _ t  ƒ  |  i _ t |  _ d |  _ d |  _	 t |  _
 t |  _ t |  _ t |  _ t |  _ t |  _ g  |  _ g  |  _ d d g |  _ d S(   s#   Creates some configuration defaultst   genshii“  i”  N(   R   t   pathst   render_functionst   sa_autht   translationst   Truet   auto_reload_templatest   Nonet   auth_backendt   default_renderert   serve_statict   stand_alonet   Falset   use_legacy_renderert   use_dotted_templatenamest   use_toscawidgetst   use_transaction_managert   call_on_startupt   call_on_shutdownt   handle_status_codes(   R   (    (    sn   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/configuration.pyR   t   s     											c         C   s·   xm |  i  D]b } t | ƒ o> y | ƒ  Wql t j
 o  } t i d | | f ƒ ql Xq
 t i d | ƒ q
 Wx@ |  i D]5 } t | ƒ o t i | ƒ qz t i d | ƒ qz Wd  S(   Ns#   Error registering %s at startup: %ss!   Unable to register %s for startups"   Unable to register %s for shutdown(   R>   t   callablet	   Exceptiont   logt   debugR?   t   atexitt   register(   R   t   cmdt   error(    (    sn   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/configuration.pyt   setup_startup_and_shutdown›   s    
  
 c         C   s’   t  i i t  i i |  i i ƒ ƒ } t d | d t  i i | d ƒ d t  i i | d ƒ d t  i i | d ƒ g ƒ } | i |  i	 ƒ | |  _	 d  S(   Nt   roott   controllerst   static_filest   publict	   templates(
   t   ost   patht   dirnamet   abspatht   packaget   __file__R   t   joint   updateR.   (   R   RJ   R.   (    (    sn   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/configuration.pyt   setup_paths«   s    $c         C   s6   t  i | | d |  i i d |  i ƒt i |  ƒ d S(   sW  Initialize the config object.

        tg.config is a proxy for pylons.config that allows attribute style
        access, so it's automatically setup when we create the pylons config.

        Besides basic initialization, this method copies all the values
        in base_config into the ``pylons.config`` and ``tg.config`` objects.

        RS   R.   N(   t   pylons_configt   init_appRS   R)   R.   R   RV   (   R   t   global_conft   app_conf(    (    sn   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/configuration.pyt   init_config·   s    

c         C   sH   t  d t d d d t d ƒ } | i d d d d	 d
 ƒ| t d <d S(   s…   Setup the default TG2 routes

        Overide this and setup your own routes maps if you want to use
        custom routes.

        t	   directorys   pylons.pathsRK   t   always_scanRD   s   *urlt
   controllerRJ   t   actiont   routes_placeholders
   routes.mapN(   R   R   t   connect(   R   t   map(    (    sn   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/configuration.pyt   setup_routesÆ   s    c         C   sY   |  i  i i i ƒ  t d <t d } t ƒ  | _ |  i  i i t d <|  i  i i t d <d S(   s£   Add helpers and globals objects to the config.

        Override this method to customize the way that ``app_globals``
        and ``helpers`` are setup.

        s   pylons.app_globalss   pylons.helperss   pylons.hN(   RS   t   libt   app_globalst   GlobalsR   R   t   dotted_filename_findert   helpers(   R   t   g(    (    sn   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/configuration.pyt   setup_helpers_and_globalsÖ   s
    
c         C   s/   h d d 6} | t d <t d i |  i ƒ d S(   s3   This method adds sa_auth information to the config.t   form_pluginR0   N(   R4   R   RV   R0   (   R   t   defaults(    (    sn   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/configuration.pyt   setup_sa_auth_backendä   s    

c         C   s1  d d k  l } d d k l } d d k l } t i d t ƒ o2 | d d d d d	 d
 g d d g ƒ t d _	 n­ t
 i i d d ƒ } | p |  i d d } n t
 i i d d ƒ } | p |  i d d } n | d |  i d d | d d d d d	 d
 g d d g d |  i ƒ t d _	 | |  i _ d S(   sÊ  Setup a renderer and loader for mako templates.

        Override this to customize the way that the mako template
        renderer is setup.  In particular if you want to setup
        a different set of search paths, different encodings, or
        additonal imports, all you need to do is update the
        ``TemplateLookup`` constructor.

        You can also use your own render_mako function instead of the one
        provided by tg.render.

        iÿÿÿÿ(   t   DottedTemplateLookup(   t   TemplateLookup(   t   render_makoR;   t   input_encodings   utf-8t   output_encodingt   importss"   from webhelpers.html import escapet   default_filterst   escapes   pylons.app_globalss&   templating.mako.compiled_templates_dirRN   i    t   directoriest   module_directoryt   filesystem_checksN(   t   tg.dottednamesupportRo   t   mako.lookupRp   t	   tg.renderRq   R   t   getR9   t   mako_lookupt   tgR4   R.   R3   R/   t   mako(   R   Ro   Rp   Rq   t   compiled_dir(    (    sn   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/configuration.pyt   setup_mako_rendererï   s,    			c         C   s[   d d k  l } d d k l } | d |  i i d |  i ƒ } | t d _ | |  i	 _
 d S(   s<   Setup a renderer and loader for the chameleon.genshi engine.iÿÿÿÿ(   t   TemplateLoader(   t   render_chameleon_genshit   search_patht   auto_reloads   pylons.app_globalsN(   t   chameleon.genshi.loaderRƒ   R|   R„   R.   RN   R3   R   t   chameleon_genshi_loaderR/   t   chameleon_genshi(   R   t   ChameleonLoaderR„   t   loader(    (    sn   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/configuration.pyt   setup_chameleongenshi_renderer,  s    c      	   C   sj   d d k  l } d d k l } d „  } | d |  i i d |  i d | ƒ } | t d _ | |  i	 _
 d	 S(
   s¥   Setup a renderer and loader for Genshi templates.

        Override this to customize the way that the internationalization
        filter, template loader

        iÿÿÿÿ(   Rƒ   (   t   render_genshic         S   s   |  i  i d t t ƒ ƒ d S(   sº   Plug-in our i18n function to Genshi, once the template is loaded.

            This function will be called by genshi TemplateLoader after
            loading the template.

            i    N(   t   filterst   insertR   R   (   t   template(    (    sn   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/configuration.pyt   template_loadedB  s    R…   R†   t   callbacks   pylons.app_globalsN(   t   genshi.templateRƒ   R|   R   R.   RN   R3   R   t   genshi_loaderR/   R-   (   R   Rƒ   R   R‘   R‹   (    (    sn   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/configuration.pyt   setup_genshi_renderer8  s    				c      
   C   s“   d d k  l } l } l } d d k l } | d | g  } |  i d D] } | | | ƒ qG ~ ƒ d |  i ƒ t d _	 t
 t d <| |  i _ d	 S(
   s1   Setup a renderer and loader for Jinja2 templates.iÿÿÿÿ(   t   ChoiceLoadert   Environmentt   FileSystemLoader(   t   render_jinjaR‹   RN   R†   s   pylons.app_globalss   pylons.strict_cN(   t   jinja2R–   R—   R˜   R|   R™   R.   R3   R   t
   jinja2_envR2   R/   t   jinja(   R   R–   R—   R˜   R™   t   _[1]RP   (    (    sn   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/configuration.pyt   setup_jinja_rendererS  s    	1
c         C   sv   t  d i ƒ  d |  i i } d |  i i } d „  } h | d 6d d 6} t  d i | ƒ t  i |  i | h  ƒ d S(	   sÇ   Setup template defaults in the buffed plugin.

        This is only used when use_legacy_renderer is set to True
        and it will not get deprecated in the next major TurboGears release.

        s   buffet.template_enginess   %s.templatesc         S   s   |  i  i d t t ƒ ƒ d  S(   Ni    (   RŽ   R   R   R   (   R   (    (    sn   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/configuration.pyR‘   n  s    s   genshi.loader_callbackt   xhtmls   genshi.default_formats   buffet.template_optionsN(   R   t   popRS   R)   RV   t   add_template_engineR6   (   R   t   template_locationR‘   t   options(    (    sn   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/configuration.pyt   setup_default_rendererb  s    	
c         C   sW   h d d 6} | i  t i d h  ƒ ƒ x* | i ƒ  D] \ } } t i | | ƒ q3 Wd  S(   Ns   application/jsons   .jsont   mimetype_lookup(   RV   R   R}   t	   iteritemst	   mimetypest   add_type(   R   t   lookupR   R   (    (    sn   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/configuration.pyt   setup_mimetypes|  s
     c         C   sC   d d k  l } | t d ƒ } | t d _ |  i i i | ƒ d S(   s!   Setup SQLAlchemy database engine.iÿÿÿÿ(   t   engine_from_configs   sqlalchemy.s   pylons.app_globalsN(   t
   sqlalchemyR«   RX   R   t	   sa_engineRS   t   modelt
   init_model(   R   R«   t   engine(    (    sn   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/configuration.pyt   setup_sqlalchemyƒ  s    c            s   ‡  f d †  } | S(   s#  Return a load_environment function.

        The returned load_environment function can be called to configure
        the TurboGears runtime environment for this particular application.
        You can do this dynamically with multiple nested TG applications
        if necessary.

        c            s$  t  |  ƒ }  t  | ƒ } ˆ  i ƒ  ˆ  i ƒ  ˆ  i |  | ƒ ˆ  i ƒ  ˆ  i ƒ  ˆ  i ƒ  ˆ  i d j o ˆ  i ƒ  n d ˆ  i	 j o ˆ  i
 ƒ  n d ˆ  i	 j o ˆ  i ƒ  n d ˆ  i	 j o ˆ  i ƒ  n d ˆ  i	 j o ˆ  i ƒ  n ˆ  i o ˆ  i ƒ  n ˆ  i o ˆ  i ƒ  n d S(   s7   Configure the Pylons environment via ``pylons.config``.R¬   R-   R‰   R€   Rœ   N(   R   RI   RW   R\   Rd   Rk   Rª   R5   Rn   t	   renderersR•   RŒ   R‚   Rž   R:   R¤   t   use_sqlalchemyR±   (   RZ   R[   (   R   (    sn   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/configuration.pyt   load_environment•  s,    






(    (   R   R´   (    (   R   sn   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/configuration.pyt   make_load_environment‹  s    
#c         C   sZ   t  | | t d  } t t d ƒ o t | |  i ƒ } n t | |  i d g ƒ } | S(   s3   Add middleware which handles errors and exceptions.s   pylons.errorwareRD   iô  (   R   R   R
   R   R@   (   R   RZ   t   app(    (    sn   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/configuration.pyt   add_error_middleware»  s
    c         C   s‘   d d k  l } d d k l } | ƒ  d |  i j o t i d ƒ |  i d <n t |  i ƒ } d | j o | d =n | | d | | } | S(   s(  
        Configure authentication and authorization.
        
        :param app: The TG2 application.
        :param skip_authentication: Should authentication be skipped if
            explicitly requested? (used by repoze.who-testutil)
        :type skip_authentication: bool
        
        iÿÿÿÿ(   t   setup_sql_auth(   t   booleanize_predicatest
   log_streamt   autht   password_encryption_methodt   skip_authentication(   t   repoze.what.plugins.quickstartR¸   t   repoze.what.plugins.pylonshqR¹   R0   t   loggingt	   getLoggerR    (   R   R¶   R½   R¸   R¹   t	   auth_args(    (    sn   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/configuration.pyt   add_auth_middlewareÈ  s    
	c         C   s5   t  | t d ƒ } t | t ƒ } t | t ƒ } | S(   s7   Add support for routes dispatch, sessions, and caching.s
   routes.map(   R   R   R   R   (   R   R¶   (    (    sn   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/configuration.pyt   add_core_middlewareå  s    c         C   s+   t  | h |  i d 6t d 6t d 6ƒ } | S(   s&   Configure the ToscaWidgets middleware.s#   toscawidgets.framework.default_views!   toscawidgets.framework.translators(   toscawidgets.middleware.inject_resources(   t   tw_middlewareR6   R   R2   (   R   R¶   (    (    sn   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/configuration.pyt   add_tosca_middlewareì  s
    	
c         C   s*   t  t d d ƒ } t | | g ƒ } | S(   Ns   pylons.pathsRL   (   R	   R   R   (   R   R¶   t
   static_app(    (    sn   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/configuration.pyt   add_static_file_middlewareõ  s    c         C   s2   d t  | i d d ƒ d ƒ j o
 d j  n S(   sP  Veto a commit.

        This hook is called by repoze.tm in case we want to veto a commit
        for some reason. Return True to force a rollback.

        By default we veto if the response's status code is an error code.
        Override this method, or monkey patch the instancemethod, to fine
        tune this behaviour.

        iÈ   i   i    i  N(   t   intt   splitR4   (   R   t   environt   statust   headers(    (    sn   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/configuration.pyt   commit_vetoú  s    c         C   s    d d k  l } | | |  i ƒ S(   s=  Set up the transaction managment middleware.

        To abort a transaction inside a TG2 app::

          import transaction
          transaction.doom()

        By default http error responses also roll back transactions, but this
        behavior can be overridden by overriding base_config.commit_veto.

        iÿÿÿÿ(   t   make_tm(   t	   repoze.tmRÏ   RÎ   (   R   R¶   RÏ   (    (    sn   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/configuration.pyt   add_tm_middleware  s    c            s   ‡ ‡  f d †  } | S(   sØ   Set up middleware that cleans up the sqlalchemy session.

        The default behavior of TG 2 is to clean up the session on every
        request.  Only override this method if you know what you are doing!

        c            s3   z ˆ  |  | ƒ SWd  t  i d ƒ ˆ i i ƒ  Xd  S(   Ns&   Removing DBSession from current thread(   RC   RD   t	   DBSessiont   remove(   RË   t   start_response(   R¶   R   (    sn   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/configuration.pyt   remover  s    (    (   R   R¶   RÕ   (    (   R   R¶   sn   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/configuration.pyt    add_dbsession_remover_middleware  s    c            s   d t ‡ ‡  f d † } | S(   sK  Create a base TG app, with all the standard middleware.

        ``load_environment``
            A required callable, which sets up the basic evironment
            needed for the application.
        ``setup_vars``
            A dictionary with all special values necessary for setting up
            the base wsgi app.

        c            s{  ˆ  |  | ƒ t  ƒ  } | o | | ƒ } n ˆ i | ƒ } ˆ i o ˆ i | ƒ } n ˆ i d j o% | i d ƒ } ˆ i | | ƒ } n ˆ i o ˆ i | ƒ } n ˆ i	 o6 t
 ˆ d ƒ p ˆ i i ˆ _ n ˆ i | ƒ } n t | ƒ } t | ƒ oJ ˆ i d j o$ d ˆ i j o ˆ i i d ƒ n ˆ i |  | ƒ } n t | ƒ } ˆ i o ˆ i | ƒ } n | S(   sg  Create a tg WSGI application and return it.

            ``wrap_app``
                a WSGI middleware component which takes the core turbogears
                application and wraps it -- inside all the WSGI-components
                provided by TG and Pylons. This allows you to work with the
                full environment that your TG application would get before
                anything happens in the application itself.

            ``global_conf``
                The inherited configuration for this application. Normally
                from the [DEFAULT] section of the Paste ini file.

            ``full_stack``
                Whether or not this application provides a full WSGI stack (by
                default, meaning it handles its own exceptions and errors).
                Disable full_stack when this application is "managed" by
                another WSGI middleware.

            ``app_conf``
                The application's local configuration. Normally specified in
                the [app:<name>] section of the Paste ini file (where <name>
                defaults to main).

            R¬   R½   RÒ   i‘  N(   R   RÄ   R<   RÆ   R5   R}   RÃ   R=   RÑ   R³   t   hasattrR®   RÒ   RÖ   t   maybe_make_body_seekableR
   R4   R@   t   appendR·   R   R7   RÈ   (   RZ   t   wrap_appt
   full_stackR[   R¶   R½   (   R´   R   (    sn   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/configuration.pyt   make_base_app1  s4    	



N(   R4   R2   (   R   R´   RÜ   (    (   R   R´   sn   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/configuration.pyt   setup_tg_wsgi_app%  s    K(   R)   R*   R+   R   RI   RW   R\   Rd   Rk   Rn   R‚   RŒ   R•   Rž   R¤   Rª   R±   Rµ   R·   RÃ   RÄ   RÆ   RÈ   RÎ   RÑ   RÖ   RÝ   (    (    (    sn   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/configuration.pyR,   c   s2   	'							=							0									c            s   ‡  f d †  } | S(   Nc            s>   t  i d ƒ o! t i d ƒ t |  ƒ i ƒ  n ˆ  |  | ƒ S(   Nt   make_body_seekables   Making request body seekable(   RX   R}   RC   RD   R   RÞ   (   RË   RÔ   (   R¶   (    sn   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/configuration.pyt   wrapper  s    (    (   R¶   Rß   (    (   R¶   sn   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/configuration.pyRØ   ~  s    (4   R+   RE   RO   RÀ   R    R§   t   UserDictR   t   pylons.i18nR   t   genshi.filtersR   t   pylonsR   RX   t   beaker.middlewareR   R   t   paste.cascadeR   t   paste.registryR   t   paste.urlparserR	   t   paste.deploy.convertersR
   t   pylons.middlewareR   R   R   R   t   tg.errorR   t   tg.utilR   R   R   t   routesR   t   routes.middlewareR   t   webobR   t   tw.apiR   RÅ   RÁ   R)   RC   R   R,   RØ   (    (    (    sn   /afs/athena.mit.edu/user/x/a/xavid/lib/python2.6/site-packages/TurboGears2-2.0.1-py2.6.egg/tg/configuration.pyt   <module>   s<   ?ÿ ÿ 