# Path: greenqueue/utils.py
# def load_class(path):
#     """
#     Load class from path.
#     """
# 
#     try:
#         mod_name, klass_name = path.rsplit('.', 1)
#         mod = import_module(mod_name)
#     except AttributeError as e:
#         raise ImproperlyConfigured(u'Error importing %s: "%s"' % (mod_name, e))
# 
#     try:
#         klass = getattr(mod, klass_name)
#     except AttributeError:
#         raise ImproperlyConfigured('Module "%s" does not define a "%s" class' % (mod_name, klass_name))
# 
#     return klass
# 
# Path: greenqueue/settings.py
# GREENQUEUE_BIND_ADDRESS = getattr(settings, 'GREENQUEUE_BIND_ADDRESS', 'ipc:///tmp/greenqueue.sock')
# GREENQUEUE_TASK_MODULES = getattr(settings, 'GREENQUEUE_TASK_MODULES', [])
# GREENQUEUE_BACKEND = getattr(settings, 'GREENQUEUE_BACKEND', 'greenqueue.backends.sync.SyncService')
# GREENQUEUE_WORKER_MANAGER = getattr(settings, 'GREENQUEUE_WORKER_MANAGER', 'greenqueue.worker.sync.SyncManager')
# GREENQUEUE_RESULTS_BACKEND = getattr(settings, "GREENQUEUE_RESULTS_BACKEND", "greenqueue.storage.backends.model.StorageBackend")
# GREENQUEUE_IGNORE_RESULT = getattr(settings, "GREENQUEUE_IGNORE_RESULT", True)
# GREENQUEUE_BACKEND_POOLSIZE = getattr(settings, 'GREENQUEUE_BACKEND_POOLSIZE', 2)
# GREENQUEUE_BACKEND_TASKBUFF = getattr(settings, 'GREENQUEUE_BACKEND_TASKBUFF', 5)
# GREENQUEUE_RABBITMQ_USERNAME = getattr(settings, 'GREENQUEUE_RABBITMQ_USERNAME', None)
# GREENQUEUE_RABBITMQ_PASSWORD = getattr(settings, 'GREENQUEUE_RABBITMQ_PASSWORD', None)
# GREENQUEUE_RABBITMQ_HOSTNAME = getattr(settings, 'GREENQUEUE_RABBITMQ_HOSTNAME', 'localhost')
# GREENQUEUE_RABBITMQ_PORT = getattr(settings, 'GREENQUEUE_RABBITMQ_PORT', 5672)
# GREENQUEUE_RABBITMQ_VHOST = getattr(settings, 'GREENQUEUE_RABBITMQ_VHOST', '/')
# GREENQUEUE_RABBITMQ_QUEUE = getattr(settings, 'GREENQUEUE_RABBITMQ_QUEUE', 'greenqueue')
# GREENQUEUE_RABBITMQ_ROUTING_KEY = getattr(settings, 'GREENQUEUE_RABBITMQ_ROUTING_KEY', GREENQUEUE_RABBITMQ_QUEUE)
# GREENQUEUE_RABBITMQ_EXCHANGE = getattr(settings, 'GREENQUEUE_RABBITMQ_EXCHANGE', '')


from .utils import load_class
from . import settings
# -*- coding: utf-8 -*-

from __future__ import absolute_import



def load_backend_class():
    """
    Load a default backend class instance."
    """
    return load_class(settings.GREENQUEUE_BACKEND)


def load_worker_class():
    """
    Load a default worker class intance.
    """

# Path: greenqueue/utils.py
# def load_class(path):
#     """
#     Load class from path.
#     """
# 
#     try:
#         mod_name, klass_name = path.rsplit('.', 1)
#         mod = import_module(mod_name)
#     except AttributeError as e:
#         raise ImproperlyConfigured(u'Error importing %s: "%s"' % (mod_name, e))
# 
#     try:
#         klass = getattr(mod, klass_name)
#     except AttributeError:
#         raise ImproperlyConfigured('Module "%s" does not define a "%s" class' % (mod_name, klass_name))
# 
#     return klass
# 
# Path: greenqueue/settings.py
# GREENQUEUE_BIND_ADDRESS = getattr(settings, 'GREENQUEUE_BIND_ADDRESS', 'ipc:///tmp/greenqueue.sock')
# GREENQUEUE_TASK_MODULES = getattr(settings, 'GREENQUEUE_TASK_MODULES', [])
# GREENQUEUE_BACKEND = getattr(settings, 'GREENQUEUE_BACKEND', 'greenqueue.backends.sync.SyncService')
# GREENQUEUE_WORKER_MANAGER = getattr(settings, 'GREENQUEUE_WORKER_MANAGER', 'greenqueue.worker.sync.SyncManager')
# GREENQUEUE_RESULTS_BACKEND = getattr(settings, "GREENQUEUE_RESULTS_BACKEND", "greenqueue.storage.backends.model.StorageBackend")
# GREENQUEUE_IGNORE_RESULT = getattr(settings, "GREENQUEUE_IGNORE_RESULT", True)
# GREENQUEUE_BACKEND_POOLSIZE = getattr(settings, 'GREENQUEUE_BACKEND_POOLSIZE', 2)
# GREENQUEUE_BACKEND_TASKBUFF = getattr(settings, 'GREENQUEUE_BACKEND_TASKBUFF', 5)
# GREENQUEUE_RABBITMQ_USERNAME = getattr(settings, 'GREENQUEUE_RABBITMQ_USERNAME', None)
# GREENQUEUE_RABBITMQ_PASSWORD = getattr(settings, 'GREENQUEUE_RABBITMQ_PASSWORD', None)
# GREENQUEUE_RABBITMQ_HOSTNAME = getattr(settings, 'GREENQUEUE_RABBITMQ_HOSTNAME', 'localhost')
# GREENQUEUE_RABBITMQ_PORT = getattr(settings, 'GREENQUEUE_RABBITMQ_PORT', 5672)
# GREENQUEUE_RABBITMQ_VHOST = getattr(settings, 'GREENQUEUE_RABBITMQ_VHOST', '/')
# GREENQUEUE_RABBITMQ_QUEUE = getattr(settings, 'GREENQUEUE_RABBITMQ_QUEUE', 'greenqueue')
# GREENQUEUE_RABBITMQ_ROUTING_KEY = getattr(settings, 'GREENQUEUE_RABBITMQ_ROUTING_KEY', GREENQUEUE_RABBITMQ_QUEUE)
# GREENQUEUE_RABBITMQ_EXCHANGE = getattr(settings, 'GREENQUEUE_RABBITMQ_EXCHANGE', '')


# Path: greenqueue/shortcuts.py
from .utils import load_class
from . import settings

# -*- coding: utf-8 -*-

from __future__ import absolute_import



def load_backend_class():
    """
    Load a default backend class instance."
    """
    return load_class(settings.GREENQUEUE_BACKEND)


def load_worker_class():
    """
    Load a default worker class intance.
    """

    return load_class(settings.GREENQUEUE_WORKER_MANAGER)