本文整理匯總了Python中MaKaC.plugins.Collaboration.base.WJSBase.getVars方法的典型用法代碼示例。如果您正苦於以下問題:Python WJSBase.getVars方法的具體用法?Python WJSBase.getVars怎麽用?Python WJSBase.getVars使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類MaKaC.plugins.Collaboration.base.WJSBase
的用法示例。
在下文中一共展示了WJSBase.getVars方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: getVars
# 需要導入模塊: from MaKaC.plugins.Collaboration.base import WJSBase [as 別名]
# 或者: from MaKaC.plugins.Collaboration.base.WJSBase import getVars [as 別名]
def getVars(self):
vars = WJSBase.getVars( self )
roomsWithH323IP = []
if self._conf:
vars["ConferenceId"] = self._conf.getId()
# Code to get a list of H.323 Videoconference-able rooms
# by querying Indico's RB database
location = self._conf.getLocation()
if location and location.getName():
locationName = location.getName()
if Config.getInstance().getIsRoomBookingActive():
attr_name = getCERNMCUOptionValueByName('H323_IP_att_name')
for room, ip in Room.find_with_attribute(attr_name):
if validIP(ip):
roomsWithH323IP.append(RoomWithH323(locationName, room.full_name, ip))
else:
vars["ConferenceId"] = ""
roomsWithH323IP.sort(key=lambda r: (r.getLocation(), r.getName()))
vars["RoomsWithH323IP"] = roomsWithH323IP
return vars
示例2: getVars
# 需要導入模塊: from MaKaC.plugins.Collaboration.base import WJSBase [as 別名]
# 或者: from MaKaC.plugins.Collaboration.base.WJSBase import getVars [as 別名]
def getVars(self):
vars = WJSBase.getVars( self )
if self._conf:
vars["ConferenceId"] = self._conf.getId()
vars["NumberOfContributions"] = self._conf.getNumberOfContributions()
# these 2 vars are used to see if contrib dates shown should include day or just time
vars["ConfStartDate"] = Conversion.datetime(self._conf.getAdjustedStartDate())
vars["IsMultiDayEvent"] = not isSameDay(self._conf.getStartDate(), self._conf.getEndDate(), self._conf.getTimezone())
location = ""
if self._conf.getLocation() and self._conf.getLocation().getName():
location = self._conf.getLocation().getName().strip()
vars["ConfLocation"] = location
room = ""
if self._conf.getRoom() and self._conf.getRoom().getName():
room = self._conf.getRoom().getName().strip()
vars["ConfRoom"] = room
else:
# this is so that template can still be rendered in indexes page...
# if necessary, we should refactor the Extra.js code so that it gets the
# conference data from the booking, now that the booking has the conference inside
vars["ConferenceId"] = ""
vars["NumberOfContributions"] = 0
vars["ConfStartDate"] = ""
vars["IsMultiDayEvent"] = False
vars["ConfLocation"] = ""
vars["ConfRoom"] = ""
return vars
示例3: getVars
# 需要導入模塊: from MaKaC.plugins.Collaboration.base import WJSBase [as 別名]
# 或者: from MaKaC.plugins.Collaboration.base.WJSBase import getVars [as 別名]
def getVars(self):
variables = WJSBase.getVars(self)
variables["LoggedInUser"] = self._user.fossilize(IAvatarFossil)
variables["MaxNameLength"] = VidyoTools.maxRoomNameLength(self._conf.getId())
return variables
示例4: getVars
# 需要導入模塊: from MaKaC.plugins.Collaboration.base import WJSBase [as 別名]
# 或者: from MaKaC.plugins.Collaboration.base.WJSBase import getVars [as 別名]
def getVars(self):
vars = WJSBase.getVars(self)
vars["AllowedStartMinutes"] = self._EVOOptions["allowedPastMinutes"].getValue()
vars["MinStartDate"] = formatDateTime(getMinStartDate(self._conf))
vars["MaxEndDate"] = formatDateTime(getMaxEndDate(self._conf))
vars["ExtraMinutesBefore"] = self._EVOOptions["extraMinutesBefore"].getValue()
vars["ExtraMinutesAfter"] = self._EVOOptions["extraMinutesAfter"].getValue()
vars["PossibleToCreateOrModify"] = getAdjustedDate(nowutc(), self._conf) < getMaxEndDate(self._conf)
vars["GeneralSettingsURL"] = urlHandlers.UHConferenceModification.getURL(self._conf)
return vars
示例5: getVars
# 需要導入模塊: from MaKaC.plugins.Collaboration.base import WJSBase [as 別名]
# 或者: from MaKaC.plugins.Collaboration.base.WJSBase import getVars [as 別名]
def getVars(self):
vars = WJSBase.getVars( self )
if self._conf:
vars["ConferenceId"] = self._conf.getId()
else:
# this is so that template can still be rendered in indexes page...
# if necessary, we should refactor the Extra.js code so that it gets the
# conference data from the booking, now that the booking has the conference inside
vars["ConferenceId"] = ""
return vars
示例6: getVars
# 需要導入模塊: from MaKaC.plugins.Collaboration.base import WJSBase [as 別名]
# 或者: from MaKaC.plugins.Collaboration.base.WJSBase import getVars [as 別名]
def getVars(self):
vars = WJSBase.getVars( self )
vars["AllowedStartMinutes"] = self._EVOOptions["allowedPastMinutes"].getValue()
if self._conf:
vars["MinStartDate"] = formatDateTime(getMinStartDate(self._conf), format = "EEE d/M H:mm")
vars["MaxEndDate"] = formatDateTime(getMaxEndDate(self._conf), format = "EEE d/M H:mm")
else:
vars["MinStartDate"] = ''
vars["MaxEndDate"] = ''
return vars
示例7: getVars
# 需要導入模塊: from MaKaC.plugins.Collaboration.base import WJSBase [as 別名]
# 或者: from MaKaC.plugins.Collaboration.base.WJSBase import getVars [as 別名]
def getVars(self):
vars = WJSBase.getVars( self )
roomsWithH323IP = []
if self._conf:
vars["ConferenceId"] = self._conf.getId()
# Code to get a list of H.323 Videoconference-able rooms
# by querying Indico's RB database
location = self._conf.getLocation()
if location and location.getName():
locationName = location.getName()
# TODO: get list of room from a plugin option instead of querying the RB DB everytime
try:
minfo = info.HelperMaKaCInfo.getMaKaCInfoInstance()
if minfo.getRoomBookingModuleActive():
Logger.get("CERNMCU").info("Connecting with Room Booking DB to get the list of all rooms with a H323 IP")
CrossLocationDB.connect()
Logger.get("CERNMCU").info("Connection successful")
attName = getCERNMCUOptionValueByName("H323_IP_att_name")
try:
returnedRooms = CrossLocationQueries.getRooms( location = locationName,
customAtts = [{"name":attName, "allowEmpty":False,
"filter": (lambda ip: validIP(ip))}] )
if not isinstance(returnedRooms, list):
if returnedRooms:
returnedRooms = [returnedRooms]
else:
returnedRooms = []
for room in returnedRooms:
roomsWithH323IP.append(RoomWithH323(locationName, room.getFullName(), room.customAtts[attName]))
except AttributeError:
#CrossLocationQueries.getRooms fails because it does not handle location names that are not in the DB
pass
except Exception, e:
Logger.get("CERNMCU").warning("Location: " + locationName + "Problem with CrossLocationQueries when retrieving the list of all rooms with a H323 IP: " + str(e))
except MaKaCError, e:
Logger.get("CERNMCU").warning("Location: " + locationName + "MaKaCError when retrieving the list of all rooms with a H323 IP: " + e.getMsg())
except Exception, e:
Logger.get("CERNMCU").warning("Location: " + locationName + "Exception when retrieving the list of all rooms with a H323 IP: " + str(e))