diff --git a/portail_citoyen_announces/transports.py b/portail_citoyen_announces/transports.py index d3830ee..bca6744 100644 --- a/portail_citoyen_announces/transports.py +++ b/portail_citoyen_announces/transports.py @@ -42,10 +42,14 @@ def get_transports(): if __TRANSPORTS is None: transports = [] for class_path in app_settings.transport_modes: + if not isinstance(class_path, basestring): + class_path, kwargs = class_path + else: + kwargs = {} module_path, class_name = class_path.rsplit('.', 1) try: module = import_module(module_path) - transports.append(getattr(module, class_name)()) + transports.append(getattr(module, class_name)(**kwargs)) except (ImportError, AttributeError), e: raise ImportError('Unable to load transport class %s' % class_path, e) __TRANSPORTS = transports