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


Python assets.PluginEnvironment類代碼示例

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


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

示例1: WPLiveSyncAdmin

class WPLiveSyncAdmin(WPAdminPlugins):

    def __init__(self, rh, templateClass):
        WPAdminPlugins.__init__(self, rh, 'livesync', '')
        self._templateClass = templateClass
        info = HelperMaKaCInfo.getMaKaCInfoInstance()
        self._plugin_asset_env = PluginEnvironment('livesync', os.path.dirname(__file__), '/livesync')
        self._plugin_asset_env.debug = info.isDebugActive()
        self._plugin_asset_env.register('livesync_js', Bundle('js/livesync.js',
                                                              filters='rjsmin',
                                                              output="livesync__%(version)s.min.js"))
        self._plugin_asset_env.register('livesync_css', Bundle('livesync.css',
                                                               filters='cssmin',
                                                               output="livesync__%(version)s.min.css"))
    def getJSFiles(self):
        return WPAdminPlugins.getJSFiles(self) + \
            self._plugin_asset_env['livesync_js'].urls()

    def getCSSFiles(self):
        return WPAdminPlugins.getCSSFiles(self) + \
            self._plugin_asset_env['livesync_css'].urls()

    def _getPageContent(self, params):
        return wcomponents.WTabControl(self._tabCtrl, self._getAW()).getHTML(
            self._templateClass.forModule(
                indico.ext.livesync).getHTML(params))
開發者ID:jbenito3,項目名稱:indico,代碼行數:26,代碼來源:chrome.py

示例2: includeTimetableCSSFiles

 def includeTimetableCSSFiles(cls, obj, params={}):
     """
     Includes additional Css files.
     """
     asset_env = PluginEnvironment('importer', os.path.dirname(__file__), 'importer')
     asset_env.register('importer_css', Bundle('css/importer.css',
                                               filters='cssmin',
                                               output="importer__%(version)s.min.css"))
     params['paths'].extend(asset_env['importer_css'].urls())
開發者ID:Json-Andriopoulos,項目名稱:indico,代碼行數:9,代碼來源:components.py

示例3: includeMainJSFiles

    def includeMainJSFiles(self, obj, params={}):
        """
        Includes additional javascript file.
        """
        asset_env = PluginEnvironment('search', os.path.dirname(__file__), 'search')

        asset_env.register('search', Bundle('js/search.js',
                                                           filters='rjsmin',
                                                           output="search__%(version)s.min.js"))
        params['paths'].extend(asset_env['search'].urls())
開發者ID:Json-Andriopoulos,項目名稱:indico,代碼行數:10,代碼來源:chrome.py

示例4: __init__

class WPCollaborationBase:

    def __init__(self):
        info = HelperMaKaCInfo.getMaKaCInfoInstance()
        self._plugin_asset_env = PluginEnvironment('Collaboration', os.path.dirname(__file__), '/Collaboration')
        self._plugin_asset_env.debug = info.isDebugActive()
        self._plugin_asset_env.register('collaboration', Bundle('js/Collaboration.js',
                                                                    'js/bookings.js',
                                                                    filters='rjsmin',
                                                                    output="Collaboration_%(version)s.min.js"))
開發者ID:jbenito3,項目名稱:indico,代碼行數:10,代碼來源:pages.py

示例5: includeTimetableJSFiles

    def includeTimetableJSFiles(cls, obj, params={}):
        """
        Includes additional javascript file.
        """
        asset_env = PluginEnvironment('importer', os.path.dirname(__file__), 'importer')

        asset_env.register('importer_js', Bundle('js/importer.js',
                                                 filters='rjsmin',
                                                 output="importer__%(version)s.min.js"))
        params['paths'].extend(asset_env['importer_js'].urls())
開發者ID:Json-Andriopoulos,項目名稱:indico,代碼行數:10,代碼來源:components.py

示例6: WPConfModifChat

class WPConfModifChat(WPConferenceModifBase):

    def __init__(self, rh, conf):
        WPConferenceModifBase.__init__(self, rh, conf)
        self._conf = conf
        self._tabs = {}  # list of Indico's Tab objects
        self._tabNames = rh._tabs
        self._activeTabName = rh._activeTabName
        self._aw = rh.getAW()

        self._tabCtrl = wcomponents.TabControl()

        info = HelperMaKaCInfo.getMaKaCInfoInstance()
        self._plugin_asset_env = PluginEnvironment('InstantMessaging', os.path.dirname(__file__), 'InstantMessaging')
        self._plugin_asset_env.debug = info.isDebugActive()
        self._plugin_asset_env.register('instant_messaging_js', Bundle('js/InstantMessaging.js',
                                                                       filters='rjsmin',
                                                                       output="InstantMessaging_%(version)s.min.js"))
        self._plugin_asset_env.register('instant_messaging_css', Bundle('css/im.css',
                                                                        filters='cssmin',
                                                                        output="InstantMessaging_%(version)s.min.css"))

    def getJSFiles(self):
        return WPConferenceModifBase.getJSFiles(self) + \
            self._plugin_asset_env['instant_messaging_js'].urls()

    def getCSSFiles(self):
        return WPConferenceModifBase.getCSSFiles(self) + \
            self._plugin_asset_env['instant_messaging_css'].urls()

    def _createTabCtrl(self):
        for tabName in self._tabNames:
            url = urlHandlers.UHConfModifChat.getURL(self._conf, tab=tabName)
            self._tabs[tabName] = self._tabCtrl.newTab(tabName, tabName, url)

        self._setActiveTab()

    def _setActiveSideMenuItem(self):
        if self._pluginsDictMenuItem.has_key('InstantMessaging'):
            self._pluginsDictMenuItem['Instant Messaging'].setActive(True)

    def _setActiveTab(self):
        self._tabs[self._activeTabName].setActive()

    def _getTitle(self):
        return WPConferenceModifBase._getTitle(self) + " - " + _("Chat management")

    def _getPageContent(self, params):
        if len(self._tabNames) > 0:
            self._createTabCtrl()
            wc = WConfModifChat.forModule(InstantMessaging, self._conf,
                                          self._activeTabName, self._tabNames, self._aw)
            return wcomponents.WTabControl(self._tabCtrl, self._getAW()).getHTML(wc.getHTML({}))
        else:
            return _("No available plugins, or no active plugins")
開發者ID:Ictp,項目名稱:indico,代碼行數:55,代碼來源:pages.py

示例7: includeTimetableCSSFiles

 def includeTimetableCSSFiles(cls, obj, params={}):
     """
     Includes additional Css files.
     """
     info = HelperMaKaCInfo.getMaKaCInfoInstance()
     asset_env = PluginEnvironment('ictp_xlsimporter', os.path.dirname(__file__), '/ictp_xlsimporter')
     asset_env.debug = info.isDebugActive()
     asset_env.register('ictp_xlsimporter_css', Bundle('css/ictp_xlsimporter.css',
                                               filters='cssmin',
                                               output="ictp_xlsimporter__%(version)s.min.css"))
     params['paths'].extend(asset_env['ictp_xlsimporter_css'].urls())
開發者ID:Ictp,項目名稱:ictp_xlsimporter,代碼行數:11,代碼來源:components.py

示例8: includeTimetableJSFiles

 def includeTimetableJSFiles(cls, obj, params={}):
     """
     Includes additional javascript file.
     """
     info = HelperMaKaCInfo.getMaKaCInfoInstance()
     asset_env = PluginEnvironment('ictp_addons', os.path.dirname(__file__), '/ictp_addons')
     asset_env.debug = info.isDebugActive()
     asset_env.register('ictp_addons_js', Bundle('js/ictp_addons.js',
                                              filters='rjsmin',
                                              output="ictp_addons__%(version)s.min.js"))
     params['paths'].extend(asset_env['ictp_addons_js'].urls())
開發者ID:Ictp,項目名稱:ictp_addons,代碼行數:11,代碼來源:components.py

示例9: includeMainJSFiles

    def includeMainJSFiles(self, obj, params={}):
        """
        Includes additional javascript file.
        """
        info = HelperMaKaCInfo.getMaKaCInfoInstance()
        asset_env = PluginEnvironment('search', os.path.dirname(__file__), '/search')
        asset_env.debug = info.isDebugActive()

        asset_env.register('search', Bundle('js/search.js',
                                                           filters='rjsmin',
                                                           output="search__%(version)s.min.js"))
        params['paths'].extend(asset_env['search'].urls())
開發者ID:jbenito3,項目名稱:indico,代碼行數:12,代碼來源:chrome.py

示例10: __init__

class WPCollaborationBase:

    def __init__(self):
        self._plugin_asset_env = PluginEnvironment('Collaboration', os.path.dirname(__file__), 'Collaboration')
        self._plugin_asset_env.register('collaboration_js', Bundle('js/Collaboration.js', 'js/bookings.js',
                                                                   filters='rjsmin',
                                                                   output="Collaboration_%(version)s.min.js"))
        self._plugin_asset_env.register('collaboration_css', Bundle('css/Style.css',
                                                                    filters='cssmin',
                                                                    output="Collaboration_%(version)s.min.css"))

    def getJSFiles(self):
        return self._includeJSPackage("Display") + self._plugin_asset_env['collaboration_js'].urls()

    def getCSSFiles(self):
        return self._plugin_asset_env['collaboration_css'].urls()
開發者ID:marksteward,項目名稱:indico,代碼行數:16,代碼來源:pages.py

示例11: __init__

 def __init__(self, rh, templateClass):
     WPAdminPlugins.__init__(self, rh, 'livesync', '')
     self._templateClass = templateClass
     info = HelperMaKaCInfo.getMaKaCInfoInstance()
     self._plugin_asset_env = PluginEnvironment('livesync', os.path.dirname(__file__), '/livesync')
     self._plugin_asset_env.debug = info.isDebugActive()
     self._plugin_asset_env.register('livesync', Bundle('js/livesync.js',
                                                        filters='rjsmin',
                                                        output="livesync__%(version)s.min.js"))
開發者ID:VishrutMehta,項目名稱:indico,代碼行數:9,代碼來源:chrome.py

示例12: __init__

 def __init__(self, rh, templateClass):
     WPAdminPlugins.__init__(self, rh, 'livesync', '')
     self._templateClass = templateClass
     self._plugin_asset_env = PluginEnvironment('livesync', os.path.dirname(__file__), 'livesync')
     self._plugin_asset_env.register('livesync_js', Bundle('js/livesync.js',
                                                           filters='rjsmin',
                                                           output="livesync__%(version)s.min.js"))
     self._plugin_asset_env.register('livesync_css', Bundle('css/livesync.css',
                                                            filters='cssmin',
                                                            output="livesync__%(version)s.min.css"))
開發者ID:Json-Andriopoulos,項目名稱:indico,代碼行數:10,代碼來源:chrome.py

示例13: __init__

    def __init__(self, rh, conf):
        WPConferenceModifBase.__init__(self, rh, conf)
        self._conf = conf
        self._tabs = {} # list of Indico's Tab objects
        self._tabNames = rh._tabs
        self._activeTabName = rh._activeTabName
        self._aw = rh.getAW()

        self._tabCtrl = wcomponents.TabControl()

        info = HelperMaKaCInfo.getMaKaCInfoInstance()
        self._plugin_asset_env = PluginEnvironment('InstantMessaging', os.path.dirname(__file__), '/InstantMessaging')
        self._plugin_asset_env.debug = info.isDebugActive()
        self._plugin_asset_env.register('instant_messaging', Bundle('js/InstantMessaging.js',
                                                                    filters='rjsmin',
                                                                    output="InstantMessaging_%(version)s.min.js"))
開發者ID:VishrutMehta,項目名稱:indico,代碼行數:16,代碼來源:pages.py

示例14: __init__

    def __init__(self, rh, conf):
        WPConferenceModifBase.__init__(self, rh, conf)
        self._conf = conf
        self._tabs = {}  # list of Indico's Tab objects
        self._tabNames = rh._tabs
        self._activeTabName = rh._activeTabName
        self._aw = rh.getAW()

        self._tabCtrl = wcomponents.TabControl()

        self._plugin_asset_env = PluginEnvironment("InstantMessaging", os.path.dirname(__file__), "InstantMessaging")
        self._plugin_asset_env.register(
            "instant_messaging_js",
            Bundle("js/InstantMessaging.js", filters="rjsmin", output="InstantMessaging_%(version)s.min.js"),
        )
        self._plugin_asset_env.register(
            "instant_messaging_css",
            Bundle("css/im.css", filters="cssmin", output="InstantMessaging_%(version)s.min.css"),
        )
開發者ID:pferreir,項目名稱:indico-backup,代碼行數:19,代碼來源:pages.py


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