当前位置: 首页>>代码示例>>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;未经允许,请勿转载。