当前位置: 首页>>代码示例>>Python>>正文


Python TGController.__call__方法代码示例

本文整理汇总了Python中tg.TGController.__call__方法的典型用法代码示例。如果您正苦于以下问题:Python TGController.__call__方法的具体用法?Python TGController.__call__怎么用?Python TGController.__call__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tg.TGController的用法示例。


在下文中一共展示了TGController.__call__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __call__

# 需要导入模块: from tg import TGController [as 别名]
# 或者: from tg.TGController import __call__ [as 别名]
    def __call__(self, environ, start_response):
        """Invoke the Controller"""
        # TGController.__call__ dispatches to the Controller method
        # the request is routed to. This routing information is
        # available in environ['pylons.routes_dict']

        request.identity = request.environ.get('repoze.who.identity')
        tmpl_context.identity = request.identity

        #return TGController.__call__(self, environ, start_response)
        stream = TGController.__call__(self, environ, start_response)
         
        # Disable the injection of tw2.jquery
        #offending_link = tw2.jquery.jquery_js.req().link
        local = tw2.core.core.request_local()

        res = []
        for r in local.get('resources', list()):
            #if r.link != offending_link:
            r.link = url(r.link)
            res.append(r)
        
        local['resources'] = res    
            
        return stream
开发者ID:preinh,项目名称:seisPortal,代码行数:27,代码来源:base.py

示例2: __call__

# 需要导入模块: from tg import TGController [as 别名]
# 或者: from tg.TGController import __call__ [as 别名]
    def __call__(self, environ, start_response):
        """Invoke the Controller"""
        # TGController.__call__ dispatches to the Controller method
        # the request is routed to. This routing information is
        # available in environ['pylons.routes_dict']

        request.identity = request.environ.get('repoze.who.identity')
        tmpl_context.identity = request.identity

        # Include jquery on every page.
        tw2.jquery.jquery_js.req().prepare()

        # Set the theme to 'hot-sneaks'
        tw2.jqplugins.ui.set_ui_theme_name('hot-sneaks')

        if 'login' not in environ['PATH_INFO']:
            for link in ["query.js", "cards.js", "navigation.js"]:
                twc.JSLink(link="javascript/%s" % link).req().prepare()

            tmpl_context.hotkeys_dialog = HotkeysDialog
            tmpl_context.search_dialog = SearchDialog
            tmpl_context.leaderboard_dialog = LeaderboardDialog
            tmpl_context.statistics_dialog = StatisticsDialog
            tmpl_context.user_widget = UserWidget
            if request.identity:
                tmpl_context.add_dialog = AddTagDialog

        return TGController.__call__(self, environ, start_response)
开发者ID:ralphbean,项目名称:fedora-tagger,代码行数:30,代码来源:base.py

示例3: __call__

# 需要导入模块: from tg import TGController [as 别名]
# 或者: from tg.TGController import __call__ [as 别名]
    def __call__(self, environ, start_response):
        """Invoke the Controller"""
        # TGController.__call__ dispatches to the Controller method
        # the request is routed to. This routing information is
        # available in environ['pylons.routes_dict']

        return TGController.__call__(self, environ, start_response)
开发者ID:rwilcox,项目名称:turbogears2_webservices_example,代码行数:9,代码来源:base.py

示例4: __call__

# 需要导入模块: from tg import TGController [as 别名]
# 或者: from tg.TGController import __call__ [as 别名]
    def __call__(self, environ, start_response):
        """Invoke the Controller"""
        # TGController.__call__ dispatches to the Controller method
        # the request is routed to. This routing information is
        # available in environ['pylons.routes_dict']

        tmpl_context.in_production = asbool(config.get('in_production'))
        return TGController.__call__(self, environ, start_response)
开发者ID:ralphbean,项目名称:hanginwit-threebean,代码行数:10,代码来源:base.py

示例5: __call__

# 需要导入模块: from tg import TGController [as 别名]
# 或者: from tg.TGController import __call__ [as 别名]
    def __call__(self, environ, context):
        """Invoke the Controller"""
        # TGController.__call__ dispatches to the Controller method
        # the request is routed to.

        request.identity = request.environ.get('repoze.who.identity')
        tmpl_context.identity = request.identity
        return TGController.__call__(self, environ, context)
开发者ID:enriquebits,项目名称:bookmanizer,代码行数:10,代码来源:base.py

示例6: __call__

# 需要导入模块: from tg import TGController [as 别名]
# 或者: from tg.TGController import __call__ [as 别名]
 def __call__(self, environ, start_response):
     """Invoke the Controller"""
     # TGController.__call__ dispatches to the Controller method
     # the request is routed to. This routing information is
     # available in environ['pylons.routes_dict']
     request.identity = request.environ.get("repoze.who.identity")
     tmpl_context.identity = request.identity
     return TGController.__call__(self, environ, start_response)
开发者ID:SergeyLashin,项目名称:mediacore,代码行数:10,代码来源:root.py

示例7: __call__

# 需要导入模块: from tg import TGController [as 别名]
# 或者: from tg.TGController import __call__ [as 别名]
    def __call__(self, environ, start_response):
        """Invoke the Controller"""
        # TGController.__call__ dispatches to the Controller method
        # the request is routed to. This routing information is
        # available in environ['pylons.routes_dict']

        #tmpl_context.notif = mokshaandtg.widgets.NotificationWidget(id='foo').display()
        tmpl_context.notif = moksha.utils.get_widget('garbage').display()
        # I want to use my own lib/base
        tmpl_context.globs = moksha.lib.base.global_resources()

        return TGController.__call__(self, environ, start_response)
开发者ID:ralphbean,项目名称:moksha-and-tg,代码行数:14,代码来源:base.py

示例8: __call__

# 需要导入模块: from tg import TGController [as 别名]
# 或者: from tg.TGController import __call__ [as 别名]
    def __call__(self, environ, start_response):
        """Invoke the Controller"""
        # TGController.__call__ dispatches to the Controller method
        # the request is routed to. This routing information is
        # available in environ['pylons.routes_dict']

        request.identity = request.environ.get('repoze.who.identity')
        # para acceder mas rapido a este componente
        request.credentials = request.environ.get('repoze.what.credentials')
        request.puede_gestion_conf = False
        request.puede_desarrollo = False
        
        if request.credentials:
            username = request.credentials["repoze.what.userid"]
            usuario = model.Usuario.by_user_name(username)
            request.puede_proyecto = False
            request.puede_rol = False
            request.puede_fase = False
            request.puede_ti = False
            request.puede_busqueda = False
            
            if AlgunPermiso(tipo="Rol").is_met(request.environ):
                request.puede_rol = True

            perms = request.credentials["permissions"]
            if perms.count("crear proyecto") or \
               perms.count("modificar proyecto") or \
               perms.count("eliminar proyecto"):
                request.puede_proyecto = True
            
            if perms.count("modificar fase"):
                request.puede_fase = True
            
            if perms.count("crear tipo item") or \
               perms.count("redefinir tipo item"):
                request.puede_ti = True
            
            if AlgunPermiso(tipo="Usuario").is_met(request.environ):
                request.puede_busqueda = True
                
            if AlgunPermiso(tipo="Tipo").is_met(request.environ):
                request.puede_desarrollo = True
                
            if has_any_permission(u"crear lb", u"abrir-cerrar lb", 
                                  u"consultar lb").is_met(request.environ):
                request.puede_gestion_conf = True
			
        tmpl_context.identity = request.identity
#        session['atras'] = session['actual']
#        session['actual'] = session['adelante']
        
        session.save()
        return TGController.__call__(self, environ, start_response)
开发者ID:jorgeramirez,项目名称:LPM,代码行数:55,代码来源:base.py

示例9: __call__

# 需要导入模块: from tg import TGController [as 别名]
# 或者: from tg.TGController import __call__ [as 别名]
    def __call__(self, environ, start_response):
        """Invoke the Controller"""
        # TGController.__call__ dispatches to the Controller method
        # the request is routed to. This routing information is
        # available in environ['pylons.routes_dict']

        request.identity = request.environ.get('repoze.who.identity')
        tmpl_context.identity = request.identity
        tmpl_context.rst_to_html = rst_to_html
        tmpl_context.gaid = config.get('ga_verifier', None)
        tmpl_context.analyticsid = config.get('analyticsid', None)
        return TGController.__call__(self, environ, start_response)
开发者ID:TurboGears,项目名称:tg2tut,代码行数:14,代码来源:base.py

示例10: __call__

# 需要导入模块: from tg import TGController [as 别名]
# 或者: from tg.TGController import __call__ [as 别名]
    def __call__(self, environ, start_response):
        """Invoke the Controller"""
        # TGController.__call__ dispatches to the Controller method
        # the request is routed to. This routing information is
        # available in environ['pylons.routes_dict']

        request.identity = request.environ.get('repoze.who.identity')
        tmpl_context.identity = request.identity

        tmpl_context.notification_widget = tutorial.widgets.PopupNotification
        tmpl_context.moksha_global_resources = global_resources

        return TGController.__call__(self, environ, start_response)
开发者ID:mokshaproject,项目名称:moksha-turbogears2-hello_world,代码行数:15,代码来源:base.py

示例11: __call__

# 需要导入模块: from tg import TGController [as 别名]
# 或者: from tg.TGController import __call__ [as 别名]
    def __call__(self, environ, start_response):
        """Invoke the Controller"""
        # TGController.__call__ dispatches to the Controller method
        # the request is routed to. This routing information is
        # available in environ['pylons.routes_dict']

        request.identity = request.environ.get('repoze.who.identity')
        tmpl_context.identity = request.identity
        jquery_js.inject()
#        from tw.jquery.ui import ui_tabs_js, jquery_ui_all_js
#        from tw.uitheme import uilightness_css
#        jquery_ui_all_js.inject()
#        uilightness_css.inject()
        return TGController.__call__(self, environ, start_response)
开发者ID:sysnux,项目名称:astportal,代码行数:16,代码来源:base.py

示例12: __call__

# 需要导入模块: from tg import TGController [as 别名]
# 或者: from tg.TGController import __call__ [as 别名]
    def __call__(self, environ, start_response):
        """Invoke the Controller"""
        # TGController.__call__ dispatches to the Controller method
        # the request is routed to. This routing information is
        # available in environ['pylons.routes_dict']

        # Create a container to send widgets to the template. Only those sent
        # in here will have their resources automatically included in the
        # template
        context.w = WidgetBunch()
        context.css = dbsprocketsCss
        try:
            return TGController.__call__(self, environ, start_response)
        finally:
            pass
开发者ID:arianepaola,项目名称:tg2jython,代码行数:17,代码来源:dbmechanic.py

示例13: __call__

# 需要导入模块: from tg import TGController [as 别名]
# 或者: from tg.TGController import __call__ [as 别名]
    def __call__(self, environ, start_response):
        """Invoke the Controller"""
        # TGController.__call__ dispatches to the Controller method
        # the request is routed to. This routing information is
        # available in environ['pylons.routes_dict']

        request.identity = request.environ.get('repoze.who.identity')
        tmpl_context.identity = request.identity

        tmpl_context.menu_widget = MainMenu
        tmpl_context.dialog_widget = ReadmeDialog
        tmpl_context.from_date_widget = FromDateWidget
        tmpl_context.to_date_widget = ToDateWidget
        set_ui_theme_name('excite-bike')

        return TGController.__call__(self, environ, start_response)
开发者ID:ralphbean,项目名称:monroe,代码行数:18,代码来源:base.py

示例14: __call__

# 需要导入模块: from tg import TGController [as 别名]
# 或者: from tg.TGController import __call__ [as 别名]
    def __call__(self, environ, start_response):
        """Invoke the Controller"""
        # TGController.__call__ dispatches to the Controller method
        # the request is routed to. This routing information is
        # available in environ['pylons.routes_dict']

        set_ui_theme_name('hot-sneaks')

        entry = model.ServerHit(
            remote_addr=environ['REMOTE_ADDR'],
            path_info=environ['PATH_INFO'],
            query_string=environ['QUERY_STRING'],
        )
        model.DBSession.add(entry)
        model.DBSession.flush()

        request.identity = request.environ.get('repoze.who.identity')
        tmpl_context.identity = request.identity
        return TGController.__call__(self, environ, start_response)
开发者ID:ralphbean,项目名称:tw2-facemelt-tg2.1,代码行数:21,代码来源:base.py

示例15: __call__

# 需要导入模块: from tg import TGController [as 别名]
# 或者: from tg.TGController import __call__ [as 别名]
    def __call__(self, environ, start_response):
        """Invoke the Controller"""

        request.identity = request.environ.get('repoze.who.identity')
        tmpl_context.identity = request.identity

        # we alias this for easy use in templates
        tmpl_context.auth = eval_and_check_predicates

        # url is already taken
        tmpl_context.get_url = url

        # Add our global widget to the template context, and register it's
        # resources
        tmpl_context.moksha_global_resources = moksha.global_resources

        # TGController.__call__ dispatches to the Controller method
        # the request is routed to. This routing information is
        # available in environ['pylons.routes_dict'], which is currently
        # being set in moksha.wsgiapp
        return TGController.__call__(self, environ, start_response)
开发者ID:lmacken,项目名称:moksha,代码行数:23,代码来源:base.py


注:本文中的tg.TGController.__call__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。