Restructure our python module. A lot.

This commit is contained in:
Raphael Michel
2015-02-14 17:55:13 +01:00
parent cf18f3e200
commit 077413f41c
117 changed files with 193 additions and 163 deletions

View File

@@ -0,0 +1,23 @@
try: # NOQA
from enum import Enum
except ImportError: # NOQA
from flufl.enum import Enum # remove this dependency when support for python <=3.3 is dropped
from django.apps import apps
class PluginType(Enum):
RESTRICTION = 1
def get_all_plugins() -> "List[class]":
"""
Returns the PretixPluginMeta classes of all plugins found in the installed Django apps.
"""
plugins = []
for app in apps.get_app_configs():
if hasattr(app, 'PretixPluginMeta'):
meta = app.PretixPluginMeta
meta.module = app.name
plugins.append(meta)
return plugins