# Path: ratatosk/backend.py

# 
# Path: ratatosk/utils.py
# def fullclassname(o):
#     return o.__module__ + "." + o.__name__
# 
# Path: ratatosk/log.py
# def get_logger():
#     logger = logging.getLogger('ratatosk-interface')
#     if not logger.handlers:
#         setup_logging()
#     return logger


import sys
import os
import logging
import luigi
from types import GeneratorType
from ratatosk import backend
from ratatosk.utils import fullclassname
from ratatosk.log import get_logger
    """
    Load an :class:`.IHandler` handler object. The
    handler_obj.load_type() defines whether
    :func:`._load_module_function` or :func:`._load_module_class` is
    to be used.
    """
    if handler_obj.load_type() == "function":
        return _load_module_function(handler_obj)
    elif handler_obj.load_type() == "class":
        return _load_module_class(handler_obj)
    else:
        raise Exception, "Unknown load_type {}".format(handler_obj.load_type())
        
def register(handler_obj, default_handler=None):
    """Register a module function represented as string in
    to a backend handler.
    
    :param handler_obj: the handler object to register
    :param default_handler: the default handler to fall back on

    :return: None
    """
    if not handler_obj:
        logging.warn("No handler object provided; skipping")
        return
    if not isinstance(handler_obj, IHandler):
        raise ValueError, "handler object must implement the IHandler interface"
    hdl = _load(handler_obj)
    if not hdl:
        return

# Path: ratatosk/backend.py

# 
# Path: ratatosk/utils.py
# def fullclassname(o):
#     return o.__module__ + "." + o.__name__
# 
# Path: ratatosk/log.py
# def get_logger():
#     logger = logging.getLogger('ratatosk-interface')
#     if not logger.handlers:
#         setup_logging()
#     return logger


# Path: ratatosk/handler.py
import sys
import os
import logging
import luigi
from types import GeneratorType
from ratatosk import backend
from ratatosk.utils import fullclassname
from ratatosk.log import get_logger

    """
    Load an :class:`.IHandler` handler object. The
    handler_obj.load_type() defines whether
    :func:`._load_module_function` or :func:`._load_module_class` is
    to be used.
    """
    if handler_obj.load_type() == "function":
        return _load_module_function(handler_obj)
    elif handler_obj.load_type() == "class":
        return _load_module_class(handler_obj)
    else:
        raise Exception, "Unknown load_type {}".format(handler_obj.load_type())
        
def register(handler_obj, default_handler=None):
    """Register a module function represented as string in
    to a backend handler.
    
    :param handler_obj: the handler object to register
    :param default_handler: the default handler to fall back on

    :return: None
    """
    if not handler_obj:
        logging.warn("No handler object provided; skipping")
        return
    if not isinstance(handler_obj, IHandler):
        raise ValueError, "handler object must implement the IHandler interface"
    hdl = _load(handler_obj)
    if not hdl:
        return

    if handler_obj.label() in backend.__handlers__: