當前位置: 首頁>>代碼示例>>Python>>正文


Python modules.ModuleHolder類代碼示例

本文整理匯總了Python中indico.modules.ModuleHolder的典型用法代碼示例。如果您正苦於以下問題:Python ModuleHolder類的具體用法?Python ModuleHolder怎麽用?Python ModuleHolder使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了ModuleHolder類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: getVars

    def getVars(self):
        vars = wcomponents.WTemplated.getVars(self)
        minfo = info.HelperMaKaCInfo.getMaKaCInfoInstance()

        vars['body'] = self._escapeChars(self._page)
        vars["isFrontPage"] = self._isFrontPage
        vars["isRoomBooking"] = self._isRoomBooking

        vars["sideMenu"] = None
        if self._sideMenu:
            vars["sideMenu"] = self._sideMenu.getHTML()

        upcoming = ModuleHolder().getById('upcoming_events')

        # if this is the front page, include the
        # upcoming event information (if there are any)
        if self._isFrontPage:
            upcoming_list = upcoming.getUpcomingEventList()
            if upcoming_list:
                vars["upcomingEvents"] = WUpcomingEvents(self._timezone, upcoming_list).getHTML(vars)
            else:
                vars["upcomingEvents"] = ''

        vars["navigation"] = ""
        if self._navigation:
            vars["navigation"] = self._navigation.getHTML(vars)

        vars["timezone"] = self._timezone
        vars["isNewsActive"] = minfo.isNewsActive()

        return vars
開發者ID:VishrutMehta,項目名稱:indico,代碼行數:31,代碼來源:main.py

示例2: 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

示例3: _getAnswer

 def _getAnswer(self):
     newsModule = ModuleHolder().getById("news")
     ni = news.NewsItem(self._title, self._content, self._type)
     newsModule.addNewsItem(ni)
     tz = (
         self.getAW().getUser().getTimezone()
     )  # this is an admin service so user is always logged in (or _checkProtection detects it before)
     return ni.fossilize(INewsItemFossil, tz=tz)
開發者ID:vstitches,項目名稱:indico,代碼行數:8,代碼來源:news.py

示例4: delete_offline_events

def delete_offline_events(dbi, logger):
    logger.info("Checking which offline events should be deleted")
    offline_events_module = ModuleHolder().getById("offlineEvents")
    events = offline_events_module.getOfflineEventIndex()
    for conf_requests in events.itervalues():
        for req in conf_requests:
            if req.status == "Generated" and req.creationTime and \
               nowutc() - req.creationTime > timedelta(seconds=MAX_OFFLINE_WEBPAGE_LIFE):
                logger.info("Deleting offline req {0}".format(req.id))
                offline_events_module.removeOfflineFile(req)
                logger.info("Deleted offline req {0}".format(req.id))
開發者ID:Ictp,項目名稱:indico,代碼行數:11,代碼來源:janitor.py

示例5: _getAnswer

 def _getAnswer(self):
     newsModule=ModuleHolder().getById("news")
     item=newsModule.getNewsItemById(self._id)
     if item:
         item.setTitle(self._title)
         item.setType(self._type)
         item.setContent(self._content)
         tz = self.getAW().getUser().getTimezone() #this is an admin service so user is always logged in (or _checkProtection detects it before)
         return item.fossilize(INewsItemFossil, tz=tz)
     else:
         raise Exception("News item does not exist")
開發者ID:Ictp,項目名稱:indico,代碼行數:11,代碼來源:news.py

示例6: removeOldCSSTemplates

def removeOldCSSTemplates(dbi, withRBDB, prevVersion):
    """
    Removing old CSS Templates from events
    """

    mod = ModuleHolder().getById('cssTpls')

    del mod._cssTpls['template1.css']
    del mod._cssTpls['template2.css']
    del mod._cssTpls['top_menu.css']

    mod._p_changed = 1
    dbi.commit()
開發者ID:vstitches,項目名稱:indico,代碼行數:13,代碼來源:migrate.py

示例7: _getTabContent

    def _getTabContent( self, params ):
        tz = timezone(timezoneUtils.DisplayTZ(self._getAW()).getDisplayTZ())
        wc = WUpdateNews()
        newsModule = ModuleHolder().getById("news")

        newslist = fossilize(newsModule.getNewsItemsList(), INewsItemFossil, tz=tz)
        newsTypesList = newsModule.getNewsTypesAsDict()
        recentDays = newsModule.getRecentDays()

        pars = {"newslist": newslist,
                "newsTypesList": newsTypesList,
                "recentDays": recentDays }

        return wc.getHTML( pars )
開發者ID:k3njiy,項目名稱:indico,代碼行數:14,代碼來源:admins.py

示例8: getVars

 def getVars( self ):
     vars = wcomponents.WTemplated.getVars( self )
     module = ModuleHolder().getById("upcoming_events")
     vars["cacheTTL"] = module.getCacheTTL().seconds/60
     vars["numberItems"] = module.getNumberItems()
     return vars
開發者ID:k3njiy,項目名稱:indico,代碼行數:6,代碼來源:admins.py

示例9: isNew

 def isNew(self):
     newsModule = ModuleHolder().getById("news")
     return self.getCreationDate() + \
            timedelta(days=newsModule.getRecentDays()) > nowutc()
開發者ID:NIIF,項目名稱:indico,代碼行數:4,代碼來源:news.py

示例10: _handleGet

 def _handleGet(self):
     newsModule = ModuleHolder().getById("news")
     return newsModule.getRecentDays()
開發者ID:Ictp,項目名稱:indico,代碼行數:3,代碼來源:news.py


注:本文中的indico.modules.ModuleHolder類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。