本文整理汇总了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))
示例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())
示例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())
示例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"))
示例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())
示例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")
示例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())
示例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())
示例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())
示例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()
示例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"))
示例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"))
示例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"))
示例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"),
)