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


Python wcomponents.WTemplated类代码示例

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


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

示例1: blockingRequestProcessed

    def blockingRequestProcessed(roomBlocking):
        """
        Notifies (e-mails) blocking creator about approval/rejection of his
        blocking request for a room
        """

        emails = []
        # ---- Email creator and contact ----

        to = roomBlocking.block.createdByUser.getEmail()

        if roomBlocking.active == True:
            verb = 'ACCEPTED'
        else:
            verb = 'REJECTED'
        subject = "Room blocking %s" % verb
        wc = WTemplated('RoomBookingEmail_2BlockingCreatorRequestProcessed')
        text = wc.getHTML({
            'block': roomBlocking.block,
            'roomBlocking': roomBlocking,
            'verb': verb
        })
        fromAddr = Config.getInstance().getSupportEmail()
        mailData = {
            "fromAddr": fromAddr,
            "toList": [to],
            "subject": subject,
            "body": text
        }
        emails.append(mailData)
        return emails
开发者ID:aninhalacerda,项目名称:indico,代码行数:31,代码来源:roomblocking.py

示例2: requestConfirmation

    def requestConfirmation(owner, block, roomBlockings):
        """
        Notifies (e-mails) room owner about blockings he has to approve.
        Expects only blockings for rooms owned by the specified owner
        """

        emails = []
        # ---- Email creator and contact ----

        to = owner.getEmail()

        subject = "Confirm room blockings"
        wc = WTemplated('RoomBookingEmail_2ResponsibleConfirmBlocking')
        text = wc.getHTML({
            'owner': owner,
            'block': block,
            'roomBlockings': roomBlockings
        })
        fromAddr = Config.getInstance().getNoReplyEmail()
        mailData = {
            "fromAddr": fromAddr,
            "toList": [to],
            "subject": subject,
            "body": text
        }
        emails.append(mailData)
        return emails
开发者ID:aninhalacerda,项目名称:indico,代码行数:27,代码来源:roomblocking.py

示例3: _getBody

 def _getBody( self, params ):
     wc = WTemplated('LaTeXError')
     conf = self._error.params['conf']
     return wc.getHTML({
         'report_id': self._error.report_id,
         'is_manager': conf.canModify(self._getAW()),
         'log': open(self._error.log_file, 'r').read(),
         'source_code': open(self._error.source_file, 'r').read()
         })
开发者ID:MichelCordeiro,项目名称:indico,代码行数:9,代码来源:errors.py

示例4: getVars

 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,代码行数:7,代码来源:oauth.py

示例5: getVars

    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,代码行数:27,代码来源:rooms.py

示例6: getVars

 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,代码行数:7,代码来源:oauth.py

示例7: getVars

    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,代码行数:7,代码来源:chrome.py

示例8: getVars

    def getVars(self):
        vars = WTemplated.getVars(self)

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

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

示例9: getVars

 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,代码行数:8,代码来源:mappers.py

示例10: getVars

    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,代码行数:9,代码来源:pages.py

示例11: getVars

 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,代码行数:9,代码来源:errors.py

示例12: getVars

 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,代码行数:9,代码来源:errors.py

示例13: getVars

    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,代码行数:10,代码来源:pages.py

示例14: getVars

    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,代码行数:11,代码来源:chrome.py

示例15: getVars

    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,代码行数:12,代码来源:chrome.py


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