本文整理汇总了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
示例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
示例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()
})
示例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
示例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
示例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
示例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
示例8: getVars
def getVars(self):
vars = WTemplated.getVars(self)
newsModule = ModuleHolder().getById("news")
vars["news"] = newsModule.getNewsItemsList()
vars["tz"] = self._tz
return vars
示例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
示例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
示例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
示例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
示例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
示例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
示例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