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


Python WCSPageTemplateBase.getVars方法代码示例

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


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

示例1: getVars

# 需要导入模块: from MaKaC.plugins.Collaboration.base import WCSPageTemplateBase [as 别名]
# 或者: from MaKaC.plugins.Collaboration.base.WCSPageTemplateBase import getVars [as 别名]
    def getVars(self):
        vars = WCSPageTemplateBase.getVars(self)

        vars["EventTitle"] = self._conf.getTitle()
        vars["EventDescription"] = unescape_html(strip_ml_tags(self._conf.getDescription())).strip()

        defaultStartDate = self._conf.getAdjustedStartDate() - timedelta(
            0, 0, 0, 0, self._EVOOptions["defaultMinutesBefore"].getValue()
        )
        nowStartDate = getAdjustedDate(
            nowutc() - timedelta(0, 0, 0, 0, self._EVOOptions["allowedPastMinutes"].getValue() / 2), self._conf
        )
        vars["DefaultStartDate"] = formatDateTime(max(defaultStartDate, nowStartDate))

        defaultEndDate = self._conf.getAdjustedEndDate() + timedelta(
            0, 0, 0, 0, self._EVOOptions["defaultMinutesAfter"].getValue()
        )
        nowEndDate = nowStartDate + timedelta(0, 0, 0, 0, self._EVOOptions["extraMinutesAfter"].getValue())
        vars["DefaultEndDate"] = formatDateTime(max(defaultEndDate, nowEndDate))

        communities = self._EVOOptions["communityList"].getValue()  # a dict communityId : communityName
        communityItems = communities.items()  # a list of tuples (communityId, communityName)
        communityItems.sort(key=lambda t: t[1])  # we sort by the second member of the tuple (the name)
        vars["Communities"] = communityItems

        return vars
开发者ID:pferreir,项目名称:indico-backup,代码行数:28,代码来源:pages.py

示例2: getVars

# 需要导入模块: from MaKaC.plugins.Collaboration.base import WCSPageTemplateBase [as 别名]
# 或者: from MaKaC.plugins.Collaboration.base.WCSPageTemplateBase import getVars [as 别名]
    def getVars(self):
        vars = WCSPageTemplateBase.getVars( self )

        resultGetOrphans = getOrphans()
        if resultGetOrphans["success"] == True:
            orphans = resultGetOrphans["result"]
        else:
            raise RecordingManagerException(resultGetOrphans["result"])

        vars["Orphans"] = orphans
        talks = getTalks(self._conf, sort = True)
        vars["Talks"] = talks
        vars["Conference"] = self._conf
        previewURL = CollaborationTools.getOptionValue("RecordingManager", "micalaPreviewURL")
        if self._rh.use_https():
            previewURL = previewURL.replace("http","https")
        vars["PreviewURL"] = previewURL

        langPrimary = CollaborationTools.getOptionValue("RecordingManager", "languageCodePrimary")
        langSecondary = CollaborationTools.getOptionValue("RecordingManager", "languageCodeSecondary")
        langDict = CollaborationTools.getOptionValue("RecordingManager", "languageDictionary")
        (vars["FlagLanguageDataOK"], vars["LanguageErrorMessages"]) = \
            self._checkLanguageData(langPrimary, langSecondary, langDict)
        vars["LanguageCodePrimary"]   = langPrimary
        vars["LanguageCodeSecondary"] = langSecondary
        vars["LanguageDictionary"]    = langDict
        vars["LanguageCodes"]         = sorted(CollaborationTools.getOptionValue("RecordingManager", "languageDictionary").keys())

        return vars
开发者ID:aninhalacerda,项目名称:indico,代码行数:31,代码来源:pages.py

示例3: getVars

# 需要导入模块: from MaKaC.plugins.Collaboration.base import WCSPageTemplateBase [as 别名]
# 或者: from MaKaC.plugins.Collaboration.base.WCSPageTemplateBase import getVars [as 别名]
    def getVars(self):
        variables = WCSPageTemplateBase.getVars(self)

        variables["Booking"] = self._booking
        variables["PhoneNumbers"] = getVidyoOptionValue("phoneNumbers")

        return variables
开发者ID:vstitches,项目名称:indico,代码行数:9,代码来源:pages.py

示例4: getVars

# 需要导入模块: from MaKaC.plugins.Collaboration.base import WCSPageTemplateBase [as 别名]
# 或者: from MaKaC.plugins.Collaboration.base.WCSPageTemplateBase import getVars [as 别名]
    def getVars(self):
        variables = WCSPageTemplateBase.getVars(self)

        bookingClass = CollaborationTools.getCSBookingClass(self._pluginId)
        variables["CanBeNotified"] = bookingClass._canBeNotifiedOfEventDateChanges

        return variables
开发者ID:marksteward,项目名称:indico,代码行数:9,代码来源:pages.py

示例5: getVars

# 需要导入模块: from MaKaC.plugins.Collaboration.base import WCSPageTemplateBase [as 别名]
# 或者: from MaKaC.plugins.Collaboration.base.WCSPageTemplateBase import getVars [as 别名]
    def getVars(self):
        vars = WCSPageTemplateBase.getVars( self )

        vars["IsSingleBooking"] = not CollaborationTools.getCSBookingClass(self._pluginId)._allowMultiple
        vars["Conference"] = self._conf

        isLecture = self._conf.getType() == 'simple_event'
        vars["IsLecture"] = isLecture

        underTheLimit = self._conf.getNumberOfContributions() <= self._RecordingRequestOptions["contributionLoadLimit"].getValue()
        manager = self._conf.getCSBookingManager()
        user = self._rh._getUser()
        isManager = user.isAdmin() or RCCollaborationAdmin.hasRights(user=user) or RCCollaborationPluginAdmin.hasRights(user=user, plugins=['RecordingRequest'])
        booking = manager.getSingleBooking('RecordingRequest')
        initialChoose = booking is not None and booking._bookingParams['talks'] == 'choose'
        initialDisplay = (self._conf.getNumberOfContributions() > 0 and underTheLimit) or (booking is not None and initialChoose)


        vars["InitialChoose"] = initialChoose
        vars["DisplayTalks"] = initialDisplay
        vars["isManager"] = isManager

        talks, rRoomFullNames, rRoomNames, recordingAbleTalks, recordingUnableTalks = getCommonTalkInformation(self._conf)
        nRecordingCapable = len(recordingAbleTalks)

        vars["HasRecordingCapableTalks"] = nRecordingCapable > 0
        vars["NTalks"] = len(talks)

        # list of "locationName:roomName" strings
        vars["RecordingCapableRooms"] = rRoomFullNames
        vars["NRecordingCapableContributions"] = nRecordingCapable

        # we check if the event itself is recoring capable (depends on event's room)
        confLocation = self._conf.getLocation()
        confRoom = self._conf.getRoom()
        if confLocation and confRoom and (confLocation.getName() + ":" + confRoom.getName() in rRoomNames):
            topLevelRecordingCapable = True
        else:
            topLevelRecordingCapable = False

        # Finally, this event is recoring capable if the event itself
        # or one of its talks are capable or user is admin, collaboration
        # manager or recording plugin manager
        vars["RecordingCapable"] = topLevelRecordingCapable or nRecordingCapable > 0 or isManager

        recordingAbleTalks.sort(key = Contribution.contributionStartDateForSort)
        talks.sort(key = Contribution.contributionStartDateForSort)

        fossil_args = dict(tz=self._conf.getTimezone(),
                           units='(hours)_minutes',
                           truncate=True)

        vars["Contributions"] = fossilize(talks, IContributionRRFossil, **fossil_args)
        vars["ContributionsAble"] = fossilize(recordingAbleTalks, IContributionRRFossil, **fossil_args)
        vars["ContributionsUnable"] = fossilize(recordingUnableTalks, IContributionRRFossil, **fossil_args)

        vars["PostingUrgency"] = postingUrgency
        vars["linkToEA"] = collaborationUrlHandlers.UHCollaborationElectronicAgreement.getURL(self._conf)
        vars["agreementName"] = CollaborationTools.getOptionValue("RecordingRequest", "AgreementName")
        return vars
开发者ID:VishrutMehta,项目名称:indico,代码行数:62,代码来源:pages.py

示例6: getVars

# 需要导入模块: from MaKaC.plugins.Collaboration.base import WCSPageTemplateBase [as 别名]
# 或者: from MaKaC.plugins.Collaboration.base.WCSPageTemplateBase import getVars [as 别名]
    def getVars(self):
        vars = WCSPageTemplateBase.getVars( self )

        vars["Booking"] = self._booking
        vars["ListOfPhoneBridgeNumbersURL"] = getEVOOptionValueByName("phoneBridgeNumberList")

        return vars
开发者ID:bubbas,项目名称:indico,代码行数:9,代码来源:pages.py

示例7: getVars

# 需要导入模块: from MaKaC.plugins.Collaboration.base import WCSPageTemplateBase [as 别名]
# 或者: from MaKaC.plugins.Collaboration.base.WCSPageTemplateBase import getVars [as 别名]
    def getVars(self):
        vars=WCSPageTemplateBase.getVars( self )
        
        vars["Conference"] = self._conf
        vars["IsSingleBooking"] = not CollaborationTools.getCSBookingClass(self._pluginName)._allowMultiple
        
        isLecture = self._conf.getType() == 'simple_event'
        vars["IsLecture"] = isLecture
        
        underTheLimit = self._conf.getNumberOfContributions() <= self._WebcastRequestOptions["contributionLoadLimit"].getValue()
        booking = self._conf.getCSBookingManager().getSingleBooking('WebcastRequest')
        initialChoose = booking is not None and booking._bookingParams['talks'] == 'choose'
        initialDisplay = (self._conf.getNumberOfContributions() > 0 and underTheLimit) or (booking is not None and initialChoose)
        
        vars["DisplayTalks"] = initialDisplay
        vars["InitialChoose"] = initialChoose
        
        talks, webcastCapableRooms, webcastAbleTalks = getCommonTalkInformation(self._conf)
        nTalks = len(talks)
        nWebcastCapable = len(webcastAbleTalks)
        
        vars["HasWebcastCapableTalks"] = nWebcastCapable > 0
        vars["NTalks"] = nTalks
        
        #list of "locationName:roomName" strings
        vars["WebcastCapableRooms"] = webcastCapableRooms

        vars["NWebcastCapableContributions"] = nWebcastCapable
        
        #we see if the event itself is webcast capable (depends on event's room)
        confLocation = self._conf.getLocation()
        confRoom = self._conf.getRoom()
        if confLocation and confRoom and (confLocation.getName() + ":" + confRoom.getName() in webcastCapableRooms):
            topLevelWebcastCapable = True
        else:
            topLevelWebcastCapable = False
        
        #Finally, this event is webcast capable if the event itself or one of its talks are
        vars["WebcastCapable"] = topLevelWebcastCapable or nWebcastCapable > 0
        
        if initialDisplay:
            webcastAbleTalks.sort(key = Contribution.contributionStartDateForSort)
                
            vars["Contributions"] = fossilize(webcastAbleTalks, IContributionWithSpeakersFossil,
                                                                tz = self._conf.getTimezone(),
                                                                units = '(hours)_minutes',
                                                                truncate = True)
        else:
            vars["Contributions"] = []
        
        
        vars["LectureOptions"] = lectureOptions
        vars["TypesOfEvents"] = typeOfEvents
        vars["PostingUrgency"] = postingUrgency
        vars["WebcastPurpose"] = webcastPurpose
        vars["IntendedAudience"] = intendedAudience
        vars["SubjectMatter"] = subjectMatter
        vars["ConsentFormURL"] = self._WebcastRequestOptions["ConsentFormURL"].getValue()
        
        return vars
开发者ID:davidmorrison,项目名称:indico,代码行数:62,代码来源:pages.py

示例8: getVars

# 需要导入模块: from MaKaC.plugins.Collaboration.base import WCSPageTemplateBase [as 别名]
# 或者: from MaKaC.plugins.Collaboration.base.WCSPageTemplateBase import getVars [as 别名]
    def getVars(self):
        vars = WCSPageTemplateBase.getVars(self)
        vars["EventTitle"] = self._conf.getTitle()
        vars["EventDescription"] = unescape_html(strip_ml_tags(self._conf.getDescription())).strip()

        vars["DefaultStartDate"] = formatDateTime(self._conf.getAdjustedStartDate())
        vars["DefaultEndDate"] = formatDateTime(self._conf.getAdjustedEndDate())

        vars["DefaultWebExUser"] = ""
        vars["DefaultWebExPass"] = ""
        vars["TimeZone"] = self._conf.getTimezone()
        sessions = "<select name='session' id='session' onchange='updateSessionTimes()'><option value=''>None</option>"
        count = 0
        sessionList = self._conf.getSessionList()
        for session in sessionList:
            count = count + 1
            sessions = sessions + "<option value='%s'>%s</option>" % (str(session.getId()), session.getTitle())
        sessions += "</select>"
        vars["SessionList"] = sessions

        return vars
开发者ID:pferreir,项目名称:indico-backup,代码行数:23,代码来源:pages.py

示例9: getVars

# 需要导入模块: from MaKaC.plugins.Collaboration.base import WCSPageTemplateBase [as 别名]
# 或者: from MaKaC.plugins.Collaboration.base.WCSPageTemplateBase import getVars [as 别名]
    def getVars(self):
        vars = WCSPageTemplateBase.getVars(self)

        vars["Conference"] = self._conf
        vars["IsSingleBooking"] = not CollaborationTools.getCSBookingClass(self._pluginId)._allowMultiple

        isLecture = self._conf.getType() == "simple_event"
        vars["IsLecture"] = isLecture

        underTheLimit = (
            self._conf.getNumberOfContributions() <= self._WebcastRequestOptions["contributionLoadLimit"].getValue()
        )
        manager = self._conf.getCSBookingManager()
        user = self._rh._getUser()
        isManager = (
            user.isAdmin()
            or RCCollaborationAdmin.hasRights(user=user)
            or RCCollaborationPluginAdmin.hasRights(user=user, plugins=["WebcastRequest"])
        )
        booking = manager.getSingleBooking("WebcastRequest")
        initialChoose = booking is not None and booking._bookingParams["talks"] == "choose"
        initialDisplay = (self._conf.getNumberOfContributions() > 0 and underTheLimit) or (
            booking is not None and initialChoose
        )

        vars["DisplayTalks"] = initialDisplay
        vars["InitialChoose"] = initialChoose
        vars["isManager"] = isManager

        talks, wcRoomFullNames, wcRoomNames, webcastAbleTalks, webcastUnableTalks = getCommonTalkInformation(self._conf)
        nWebcastCapable = len(webcastAbleTalks)

        vars["HasWebcastCapableTalks"] = nWebcastCapable > 0
        vars["NTalks"] = len(talks)

        # list of "locationName:roomName" strings
        vars["WebcastCapableRooms"] = wcRoomFullNames
        vars["NWebcastCapableContributions"] = nWebcastCapable

        # we see if the event itself is webcast capable (depends on event's room)
        confLocation = self._conf.getLocation()
        confRoom = self._conf.getRoom()
        if confLocation and confRoom and (confLocation.getName() + ":" + confRoom.getName() in wcRoomNames):
            topLevelWebcastCapable = True
        else:
            topLevelWebcastCapable = False

        # Finally, this event is webcast capable if the event itself or
        # or one of its talks are capable or user is admin, collaboration
        # manager or webcast plugin manager
        vars["WebcastCapable"] = topLevelWebcastCapable or nWebcastCapable > 0 or isManager

        if initialDisplay:
            webcastAbleTalks.sort(key=Contribution.contributionStartDateForSort)

            fossil_args = dict(tz=self._conf.getTimezone(), units="(hours)_minutes", truncate=True)

            vars["Contributions"] = fossilize(talks, IContributionWRFossil, **fossil_args)
            vars["ContributionsAble"] = fossilize(webcastAbleTalks, IContributionWRFossil, **fossil_args)
            vars["ContributionsUnable"] = fossilize(webcastUnableTalks, IContributionWRFossil, **fossil_args)
        else:
            vars["Contributions"] = []
            vars["ContributionsAble"] = []
            vars["ContributionsUnable"] = []

        vars["Audiences"] = CollaborationTools.getOptionValue("WebcastRequest", "webcastAudiences")
        vars["linkToEA"] = collaborationUrlHandlers.UHCollaborationElectronicAgreement.getURL(self._conf)
        vars["agreementName"] = CollaborationTools.getOptionValue("WebcastRequest", "AgreementName")
        return vars
开发者ID:arturodr,项目名称:indico,代码行数:71,代码来源:pages.py


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