Deprecate PluginType

This commit is contained in:
Raphael Michel
2016-11-03 11:33:00 +01:00
parent ad35110166
commit 0b167aaa2c
12 changed files with 11 additions and 35 deletions

View File

@@ -30,10 +30,6 @@ Plugin metadata
The plugin metadata lives inside a ``PretixPluginMeta`` class inside your app's
configuration class. The metadata class must define the following attributes:
``type`` (``pretix.base.plugins.PluginType``):
The type of plugin. Currently available: ``RESTRICTION``, ``PAYMENT``,
``ADMINFEATURE``
``name`` (``str``):
The human-readable name of your plugin
@@ -51,24 +47,20 @@ A working example would be::
# file: pretix/plugins/timerestriction/__init__.py
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
from pretix.base.plugins import PluginType
class TimeRestrictionApp(AppConfig):
name = 'pretix.plugins.timerestriction'
verbose_name = _("Time restriction")
class PaypalApp(AppConfig):
name = 'pretix.plugins.paypal'
verbose_name = _("Stripe")
class PretixPluginMeta:
type = PluginType.RESTRICTION
name = _("Restriciton by time")
name = _("PayPal")
author = _("the pretix team")
version = '1.0.0'
description = _("This plugin adds the possibility to restrict the sale " +
"of a given item or variation to a certain timeframe " +
"or change its price during a certain period.")
description = _("This plugin allows you to receive payments via PayPal")
default_app_config = 'pretix.plugins.timerestriction.TimeRestrictionApp'
default_app_config = 'pretix.plugins.paypal.PaypalApp'
The ``AppConfig`` class may implement a property ``compatiblity_errors``, that checks

View File

@@ -5,6 +5,11 @@ from django.apps import apps
class PluginType(Enum):
"""
Plugin type classification. THIS IS DEPRECATED, DO NOT USE ANY MORE.
This is only not removed yet as external plugins might have references
to this enum.
"""
RESTRICTION = 1
PAYMENT = 2
ADMINFEATURE = 3

View File

@@ -3,7 +3,6 @@ from django.utils.functional import cached_property
from django.utils.translation import ugettext_lazy as _
from pretix import __version__ as version
from pretix.base.plugins import PluginType
class BankTransferApp(AppConfig):
@@ -11,7 +10,6 @@ class BankTransferApp(AppConfig):
verbose_name = _("Bank transfer")
class PretixPluginMeta:
type = PluginType.PAYMENT
name = _("Bank transfer")
author = _("the pretix team")
version = version

View File

@@ -3,7 +3,6 @@ from django.utils.functional import cached_property
from django.utils.translation import ugettext_lazy as _
from pretix import __version__ as version
from pretix.base.plugins import PluginType
class CheckinlistsApp(AppConfig):
@@ -11,7 +10,6 @@ class CheckinlistsApp(AppConfig):
verbose_name = _("Check-in lists")
class PretixPluginMeta:
type = PluginType.PAYMENT
name = _("Check-in list exporter")
author = _("the pretix team")
version = version

View File

@@ -3,7 +3,6 @@ from django.utils.functional import cached_property
from django.utils.translation import ugettext_lazy as _
from pretix import __version__ as version
from pretix.base.plugins import PluginType
class PaypalApp(AppConfig):
@@ -11,7 +10,6 @@ class PaypalApp(AppConfig):
verbose_name = _("Stripe")
class PretixPluginMeta:
type = PluginType.PAYMENT
name = _("PayPal")
author = _("the pretix team")
version = version

View File

@@ -2,7 +2,6 @@ from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
from pretix import __version__ as version
from pretix.base.plugins import PluginType
class PretixdroidApp(AppConfig):
@@ -10,7 +9,6 @@ class PretixdroidApp(AppConfig):
verbose_name = _("pretixdroid API")
class PretixPluginMeta:
type = PluginType.ADMINFEATURE
name = _("pretixdroid API")
author = _("the pretix team")
version = version

View File

@@ -3,7 +3,6 @@ from django.utils.functional import cached_property
from django.utils.translation import ugettext_lazy as _
from pretix import __version__ as version
from pretix.base.plugins import PluginType
class ReportsApp(AppConfig):
@@ -11,7 +10,6 @@ class ReportsApp(AppConfig):
verbose_name = _("Report exporter")
class PretixPluginMeta:
type = PluginType.PAYMENT
name = _("Report exporter")
author = _("the pretix team")
version = version

View File

@@ -2,7 +2,6 @@ from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
from pretix import __version__ as version
from pretix.base.plugins import PluginType
class SendMailApp(AppConfig):
@@ -10,7 +9,6 @@ class SendMailApp(AppConfig):
verbose_name = _("Send out emails")
class PretixPluginMeta:
type = PluginType.ADMINFEATURE
name = _("Send out emails")
author = _("the pretix team")
version = version

View File

@@ -2,7 +2,6 @@ from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
from pretix import __version__ as version
from pretix.base.plugins import PluginType
class StatisticsApp(AppConfig):
@@ -10,7 +9,6 @@ class StatisticsApp(AppConfig):
verbose_name = _("Statistics")
class PretixPluginMeta:
type = PluginType.ADMINFEATURE
name = _("Statistics")
author = _("the pretix team")
version = version

View File

@@ -3,7 +3,6 @@ from django.utils.functional import cached_property
from django.utils.translation import ugettext_lazy as _
from pretix import __version__ as version
from pretix.base.plugins import PluginType
class StripeApp(AppConfig):
@@ -11,7 +10,6 @@ class StripeApp(AppConfig):
verbose_name = _("Stripe")
class PretixPluginMeta:
type = PluginType.PAYMENT
name = _("Stripe")
author = _("the pretix team")
version = version

View File

@@ -3,7 +3,6 @@ from django.utils.functional import cached_property
from django.utils.translation import ugettext_lazy as _
from pretix import __version__ as version
from pretix.base.plugins import PluginType
class TicketOutputPdfApp(AppConfig):
@@ -11,7 +10,6 @@ class TicketOutputPdfApp(AppConfig):
verbose_name = _("PDF ticket output")
class PretixPluginMeta:
type = PluginType.PAYMENT
name = _("PDF ticket output")
author = _("the pretix team")
version = version

View File

@@ -1,14 +1,11 @@
from django.apps import AppConfig
from pretix.base.plugins import PluginType
class TestDummyApp(AppConfig):
name = 'tests.testdummy'
verbose_name = '.testdummy'
class PretixPluginMeta:
type = PluginType.RESTRICTION
name = '.testdummy'
version = '1.0.0'