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


Python WTemplated.getVars方法代码示例

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


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

示例1: getVars

# 需要导入模块: from MaKaC.webinterface.wcomponents import WTemplated [as 别名]
# 或者: from MaKaC.webinterface.wcomponents.WTemplated import getVars [as 别名]
 def getVars(self):
     wvars = WTemplated.getVars(self)
     wvars['user'] = self._avatar
     wvars['currentUser'] = self._rh._getUser()
     wvars["tokens"] = Catalog.getIdx('user_oauth_access_token').get(self._avatar.getId(), [])
     wvars["formatTimestamp"] = lambda ts: format_datetime(ts, format='d/M/yyyy H:mm')
     return wvars
开发者ID:pferreir,项目名称:indico-backup,代码行数:9,代码来源:oauth.py

示例2: getVars

# 需要导入模块: from MaKaC.webinterface.wcomponents import WTemplated [as 别名]
# 或者: from MaKaC.webinterface.wcomponents.WTemplated import getVars [as 别名]
    def getVars(self):
        ph = PluginsHolder()

        tplVars = WTemplated.getVars(self)
        tplVars["epayment_htdocs"] = UHEPaymentHtdocs.getURL()
        tplVars["currency_data"] = ph.getPluginType('EPayment').getOption("customCurrency").getValue()
        return tplVars
开发者ID:VishrutMehta,项目名称:indico,代码行数:9,代码来源:chrome.py

示例3: getVars

# 需要导入模块: from MaKaC.webinterface.wcomponents import WTemplated [as 别名]
# 或者: from MaKaC.webinterface.wcomponents.WTemplated import getVars [as 别名]
    def getVars(self):
        wvars = WTemplated.getVars(self)
        wvars['standalone'] = self._standalone
        room = wvars['room']

        wvars['attrs'] = {attr.attribute.name: attr for attr in room.attributes
                          if not attr.attribute.is_hidden or rb_is_admin(session.user)}

        wvars['owner_name'] = room.owner.full_name

        wvars['bookable_hours'] = room.bookable_hours.all()
        wvars['nonbookable_periods'] = room.nonbookable_periods.all()

        # URLs
        wvars['stats_url'] = UH.UHRoomBookingRoomStats.getURL(room)
        wvars['delete_room_url'] = url_for('rooms_admin.delete_room', room)
        wvars['modify_room_url'] = url_for('rooms_admin.modify_room', room)
        if not self._standalone:
            wvars['conference'] = self._rh._conf

        room_mapper = RoomMapperHolder().match({'placeName': self._rh._location.name}, exact=True)
        if room_mapper:
            wvars['show_on_map'] = room_mapper[0].getMapURL(self._rh._room.name)
        else:
            wvars['show_on_map'] = UH.UHRoomBookingMapOfRooms.getURL(roomID=self._rh._room.id)

        return wvars
开发者ID:dbourillot,项目名称:indico,代码行数:29,代码来源:rooms.py

示例4: getVars

# 需要导入模块: from MaKaC.webinterface.wcomponents import WTemplated [as 别名]
# 或者: from MaKaC.webinterface.wcomponents.WTemplated import getVars [as 别名]
 def getVars(self):
     vars = WTemplated.getVars( self )
     vars['user'] = self._avatar
     vars['currentUser'] = self._rh._getUser()
     vars["tokens"] = Catalog.getIdx('user_oauth_request_token').get(self._avatar.getId(), [])
     vars["formatTimestamp"] = lambda ts: format_datetime(utctimestamp2date(ts), format='d/M/yyyy H:mm')
     return vars
开发者ID:iason-andr,项目名称:indico,代码行数:9,代码来源:oauth.py

示例5: getVars

# 需要导入模块: from MaKaC.webinterface.wcomponents import WTemplated [as 别名]
# 或者: from MaKaC.webinterface.wcomponents.WTemplated import getVars [as 别名]
 def getVars(self):
     wvars = WTemplated.getVars(self)
     wvars['name'] = self._roomMapper.getName()
     wvars['description'] = self._roomMapper.getDescription()
     wvars['url'] = self._roomMapper.getBaseMapURL()
     wvars['placeName'] = self._roomMapper.getPlaceName()
     wvars['regexps'] = self._roomMapper.getRegularExpressions()
     return wvars
开发者ID:pferreir,项目名称:indico-backup,代码行数:10,代码来源:mappers.py

示例6: getVars

# 需要导入模块: from MaKaC.webinterface.wcomponents import WTemplated [as 别名]
# 或者: from MaKaC.webinterface.wcomponents.WTemplated import getVars [as 别名]
    def getVars(self):
        vars = WTemplated.getVars(self)

        newsModule = ModuleHolder().getById("news")
        vars["news"] = newsModule.getNewsItemsList()
        vars["tz"] = self._tz

        return vars
开发者ID:MichelCordeiro,项目名称:indico,代码行数:10,代码来源:news.py

示例7: getVars

# 需要导入模块: from MaKaC.webinterface.wcomponents import WTemplated [as 别名]
# 或者: from MaKaC.webinterface.wcomponents.WTemplated import getVars [as 别名]
 def getVars( self ):
     from MaKaC.conference import Conference
     vars = WTemplated.getVars( self )
     vars["area"]= i18nformat(""" _("Authorisation") - """)
     vars["msg"] = _("The access to this page has been restricted by its owner and you are not authorised to view it")
     vars["contactInfo"] = ""
     if isinstance(self._rh._target, Conference):
         vars["contactInfo"] = self._rh._target.as_new.no_access_contact
     return vars
开发者ID:OmeGak,项目名称:indico,代码行数:11,代码来源:errors.py

示例8: getVars

# 需要导入模块: from MaKaC.webinterface.wcomponents import WTemplated [as 别名]
# 或者: from MaKaC.webinterface.wcomponents.WTemplated import getVars [as 别名]
    def getVars( self ):
        vars = WTemplated.getVars( self )

        vars["Conference"] = self._conf

        try:
            vars["Chatrooms"] = DBHelpers.getShowableRooms(self._conf)
        except Exception, e:
            vars["Chatrooms"] = None
开发者ID:bubbas,项目名称:indico,代码行数:11,代码来源:pages.py

示例9: getVars

# 需要导入模块: from MaKaC.webinterface.wcomponents import WTemplated [as 别名]
# 或者: from MaKaC.webinterface.wcomponents.WTemplated import getVars [as 别名]
 def getVars( self ):
     vars = WTemplated.getVars( self )
     vars["msg"] = self._msg
     redirectURL = ""
     if hasattr(self._rh, "_redirectURL"):
         redirectURL = self._rh._redirectURL
     vars["redirectURL"] = quoteattr(redirectURL)
     vars["url"] = quoteattr( str( urlHandlers.UHConfEnterModifKey.getURL(self._rh._target) ) )
     return vars
开发者ID:MichelCordeiro,项目名称:indico,代码行数:11,代码来源:errors.py

示例10: getVars

# 需要导入模块: from MaKaC.webinterface.wcomponents import WTemplated [as 别名]
# 或者: from MaKaC.webinterface.wcomponents.WTemplated import getVars [as 别名]
    def getVars(self):
        wvars = WTemplated.getVars(self)

        wvars["body_title"] = self._getTitle()
        wvars["Conference"] = self._conf

        try:
            wvars["Chatrooms"] = DBHelpers.getShowableRooms(self._conf)
        except Exception, e:
            wvars["Chatrooms"] = None
开发者ID:jbenito3,项目名称:indico,代码行数:12,代码来源:pages.py

示例11: getVars

# 需要导入模块: from MaKaC.webinterface.wcomponents import WTemplated [as 别名]
# 或者: from MaKaC.webinterface.wcomponents.WTemplated import getVars [as 别名]
    def getVars(self):
        tplVars = WTemplated.getVars(self)

        smanager = SyncManager.getDBInstance()

        tplVars["trackData"], tplVars["lastAgentTS"] = self._calculateTrackData(smanager)
        tplVars["agents"] = smanager.getAllAgents()
        tplVars["currentTS"] = int_timestamp(nowutc())
        tplVars["granularity"] = smanager.getGranularity()

        return tplVars
开发者ID:aninhalacerda,项目名称:indico,代码行数:13,代码来源:chrome.py

示例12: getVars

# 需要导入模块: from MaKaC.webinterface.wcomponents import WTemplated [as 别名]
# 或者: from MaKaC.webinterface.wcomponents.WTemplated import getVars [as 别名]
    def getVars(self):
        tplVars = WTemplated.getVars(self)

        smanager = SyncManager.getDBInstance()

        tplVars['trackData'], tplVars['lastAgentTS'] = \
                              self._calculateTrackData(smanager)
        tplVars['agents'] = smanager.getAllAgents()
        tplVars['currentTS'] = int_timestamp(nowutc())
        tplVars['granularity'] = smanager.getGranularity()

        return tplVars
开发者ID:bubbas,项目名称:indico,代码行数:14,代码来源:chrome.py

示例13: getVars

# 需要导入模块: from MaKaC.webinterface.wcomponents import WTemplated [as 别名]
# 或者: from MaKaC.webinterface.wcomponents.WTemplated import getVars [as 别名]
 def getVars(self):
     minfo = HelperMaKaCInfo.getMaKaCInfoInstance()
     apiMode = minfo.getAPIMode()
     vars = WTemplated.getVars(self)
     vars['avatar'] = self._avatar
     vars['apiKey'] = self._avatar.getAPIKey()
     vars['isAdmin'] = self._rh._getUser().isAdmin()
     vars['signingEnabled'] = apiMode in (API_MODE_SIGNED, API_MODE_ONLYKEY_SIGNED, API_MODE_ALL_SIGNED)
     vars['persistentAllowed'] = minfo.isAPIPersistentAllowed()
     vars['apiPersistentEnableAgreement'] = minfo.getAPIPersistentEnableAgreement()
     vars['apiPersistentDisableAgreement'] = minfo.getAPIPersistentDisableAgreement()
     return vars
开发者ID:bubbas,项目名称:indico,代码行数:14,代码来源:api.py

示例14: getVars

# 需要导入模块: from MaKaC.webinterface.wcomponents import WTemplated [as 别名]
# 或者: from MaKaC.webinterface.wcomponents.WTemplated import getVars [as 别名]
 def getVars( self ):
     vars = WTemplated.getVars( self )
     vars["loginURL"] = ""
     if self._rh._getUser() is None:
         vars["loginURL"] = str(urlHandlers.UHSignIn.getURL(returnURL=self._rh.getCurrentURL()))
     vars["msg"] = self._msg
     redirectURL = ""
     if hasattr(self._rh, "_redirectURL"):
         redirectURL = self._rh._redirectURL
     vars["redirectURL"] = quoteattr(redirectURL)
     vars["url"] = quoteattr( str( urlHandlers.UHConfEnterModifKey.getURL(self._rh._target) ) )
     return vars
开发者ID:aninhalacerda,项目名称:indico,代码行数:14,代码来源:errors.py

示例15: getVars

# 需要导入模块: from MaKaC.webinterface.wcomponents import WTemplated [as 别名]
# 或者: from MaKaC.webinterface.wcomponents.WTemplated import getVars [as 别名]
    def getVars(self):
        wvars = WTemplated.getVars(self)
        wvars['standalone'] = self._standalone
        room = wvars['room']

        wvars['attrs'] = {attr.attribute.name: attr for attr in room.attributes
                          if not attr.attribute.is_hidden or rb_is_admin(session.user)}

        wvars['owner_name'] = room.owner.full_name

        wvars['bookable_hours'] = room.bookable_hours.all()
        wvars['nonbookable_periods'] = room.nonbookable_periods.all()

        # URLs
        wvars['stats_url'] = UH.UHRoomBookingRoomStats.getURL(room)
        wvars['delete_room_url'] = url_for('rooms_admin.delete_room', room)
        wvars['modify_room_url'] = url_for('rooms_admin.modify_room', room)
        if not self._standalone:
            wvars['conference'] = self._rh._conf

        wvars['show_on_map'] = room.map_url if room.map_url else url_for('rooms.roomBooking-mapOfRooms', room)

        return wvars
开发者ID:fph,项目名称:indico,代码行数:25,代码来源:rooms.py


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