mirror of
https://github.com/lucaspalomodevelop/indico-plugins.git
synced 2026-03-12 23:27:22 +00:00
Use PluginCategory enum
This commit is contained in:
parent
b2a8c54841
commit
9932656558
@ -18,7 +18,7 @@ from __future__ import unicode_literals
|
||||
|
||||
from flask_pluginengine import depends
|
||||
|
||||
from indico.core.plugins import IndicoPlugin
|
||||
from indico.core.plugins import IndicoPlugin, PluginCategory
|
||||
from indico_importer.plugin import ImporterPlugin
|
||||
|
||||
|
||||
@ -27,6 +27,7 @@ class ImporterSourcePluginBase(IndicoPlugin):
|
||||
"""Base class for importer engine plugins"""
|
||||
|
||||
importer_engine_classes = None
|
||||
category = PluginCategory.importers
|
||||
|
||||
def init(self):
|
||||
super(ImporterSourcePluginBase, self).init()
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from indico.core import signals
|
||||
from indico.core.plugins import IndicoPlugin, IndicoPluginBlueprint, plugin_url_rule_to_js
|
||||
from indico.core.plugins import IndicoPlugin, IndicoPluginBlueprint, plugin_url_rule_to_js, PluginCategory
|
||||
from MaKaC.webinterface.pages.conferences import WPConfModifScheduleGraphic
|
||||
from indico.util.i18n import _
|
||||
|
||||
@ -32,7 +32,7 @@ class ImporterPlugin(IndicoPlugin):
|
||||
"""
|
||||
|
||||
hidden = True
|
||||
category = 'import'
|
||||
category = PluginCategory.importers
|
||||
|
||||
def init(self):
|
||||
super(ImporterPlugin, self).init()
|
||||
|
||||
@ -30,4 +30,3 @@ class ImporterInvenioPlugin(ImporterSourcePluginBase):
|
||||
|
||||
importer_engine_classes = (InvenioImporter,)
|
||||
settings_form = SettingsForm
|
||||
category = 'import'
|
||||
|
||||
@ -18,7 +18,7 @@ from __future__ import unicode_literals
|
||||
|
||||
from flask_pluginengine import depends, trim_docstring
|
||||
|
||||
from indico.core.plugins import IndicoPlugin
|
||||
from indico.core.plugins import IndicoPlugin, PluginCategory
|
||||
from indico.util.date_time import now_utc
|
||||
from indico.util.decorators import classproperty
|
||||
from MaKaC.conference import CategoryManager
|
||||
@ -34,7 +34,7 @@ class LiveSyncPluginBase(IndicoPlugin): # pragma: no cover
|
||||
|
||||
#: dict containing the backend(s) provided by the plugin; the keys are unique identifiers
|
||||
backend_classes = None
|
||||
category = 'synchronization'
|
||||
category = PluginCategory.synchronization
|
||||
|
||||
def init(self):
|
||||
super(LiveSyncPluginBase, self).init()
|
||||
|
||||
@ -21,7 +21,7 @@ from flask import request
|
||||
from wtforms.validators import NumberRange
|
||||
from wtforms.fields.html5 import IntegerField
|
||||
|
||||
from indico.core.plugins import IndicoPlugin, wrap_cli_manager
|
||||
from indico.core.plugins import IndicoPlugin, PluginCategory, wrap_cli_manager
|
||||
from indico.core.plugins.views import WPPlugins
|
||||
from indico.util.i18n import _
|
||||
from indico.web.forms.base import IndicoForm
|
||||
@ -55,6 +55,7 @@ class LiveSyncPlugin(IndicoPlugin):
|
||||
settings_form = SettingsForm
|
||||
default_settings = {'excluded_categories': [],
|
||||
'queue_entry_ttl': 0}
|
||||
category = PluginCategory.synchronization
|
||||
|
||||
def init(self):
|
||||
super(LiveSyncPlugin, self).init()
|
||||
|
||||
@ -28,4 +28,3 @@ class LiveSyncDebugPlugin(LiveSyncPluginBase):
|
||||
"""
|
||||
|
||||
backend_classes = {'debug': LiveSyncDebugBackend}
|
||||
category = 'synchronization'
|
||||
|
||||
@ -28,4 +28,3 @@ class InvenioLiveSyncPlugin(LiveSyncPluginBase):
|
||||
"""
|
||||
|
||||
backend_classes = {'invenio': InvenioLiveSyncBackend}
|
||||
category = 'synchronization'
|
||||
|
||||
@ -45,7 +45,6 @@ class ManualPaymentPlugin(PaymentPluginMixin, IndicoPlugin):
|
||||
who then pays manually using e.g. a wire transfer. Marking the registrant
|
||||
as paid is then done manually by a manager of the event.
|
||||
"""
|
||||
category = 'payment'
|
||||
settings_form = PluginSettingsForm
|
||||
event_settings_form = EventSettingsForm
|
||||
default_settings = {'method_name': 'Bank Transfer'}
|
||||
|
||||
@ -44,7 +44,6 @@ class PaypalPaymentPlugin(PaymentPluginMixin, IndicoPlugin):
|
||||
|
||||
Provides a payment method using the PayPal IPN API.
|
||||
"""
|
||||
category = 'payment'
|
||||
settings_form = PluginSettingsForm
|
||||
event_settings_form = EventSettingsForm
|
||||
default_settings = {'method_name': 'PayPal',
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
from flask import session
|
||||
from flask_pluginengine import depends
|
||||
|
||||
from indico.core.plugins import IndicoPlugin
|
||||
from indico.core.plugins import IndicoPlugin, PluginCategory
|
||||
|
||||
from indico_search.forms import SearchForm
|
||||
from indico_search.plugin import SearchPlugin
|
||||
@ -31,7 +31,7 @@ class SearchPluginBase(IndicoPlugin):
|
||||
engine_class = None
|
||||
#: the SearchForm subclass to use
|
||||
search_form = SearchForm
|
||||
category = 'search'
|
||||
category = PluginCategory.search
|
||||
|
||||
def init(self):
|
||||
super(SearchPluginBase, self).init()
|
||||
|
||||
@ -19,7 +19,7 @@ from __future__ import unicode_literals
|
||||
from flask import request
|
||||
from flask_pluginengine import plugins_loaded
|
||||
|
||||
from indico.core.plugins import IndicoPlugin
|
||||
from indico.core.plugins import IndicoPlugin, PluginCategory
|
||||
|
||||
from indico_search.blueprint import blueprint
|
||||
from indico_search.util import render_engine_or_search_template
|
||||
@ -31,7 +31,7 @@ class SearchPlugin(IndicoPlugin):
|
||||
Provides a base for search engine plugins.
|
||||
"""
|
||||
|
||||
category = 'search'
|
||||
category = PluginCategory.search
|
||||
hidden = True
|
||||
_engine_plugin = None # the search engine plugin
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user