platypush/context/__init__.py
def register_backends(bus=None, global_scope=False, **kwargs):
    """ Initialize the backend objects based on the configuration and returns
        a name -> backend_instance map.
    Params:
        bus -- If specific (it usually should), the messages processed by the
            backends will be posted on this bus.

        kwargs -- Any additional key-value parameters required to initialize the backends
        """

    global main_bus
    if bus:
        main_bus = bus

    if global_scope:
        global backends
    else:
        backends = {}

    for (name, cfg) in Config.get_backends().items():
        module = importlib.import_module('platypush.backend.' + name)

        # e.g. backend.pushbullet main class: PushbulletBackend
        cls_name = ''
        for token in module.__name__.title().split('.')[2:]:
            cls_name += token.title()
        cls_name += 'Backend'

        try:
            b = getattr(module, cls_name)(bus=bus, **cfg, **kwargs)
            backends[name] = b
        except AttributeError as e:
            logger.warning('No such class in {}: {}'.format(
                module.__name__, cls_name))
            raise RuntimeError(e)

    return backends
 Initialize the backend objects based on the configuration and returns
        a name -> backend_instance map.
    Params:
        bus -- If specific (it usually should), the messages processed by the
            backends will be posted on this bus.

        kwargs -- Any additional key-value parameters required to initialize the backends
        
Initialize the backend objects based on the configuration and returns
a name -> backend_instance map.
Params:
bus -- If specific (it usually should), the messages processed by the
backends will be posted on this bus.

- Any additional key-value parameters required to initialize the backends
Initialize the backend objects based on the configuration and returns a name - > backend_instance map . Params : bus -- If specific ( it usually should ) the messages processed by the backends will be posted on this bus . - Any additional key - value parameters required to initialize the backends
def register_backends(bus=None, global_scope=False, **kwargs):
    global main_bus
    if bus:
        main_bus = bus
    if global_scope:
        global backends
    else:
        backends = {}
    for (name, cfg) in Config.get_backends().items():
        module = importlib.import_module('platypush.backend.' + name)
        cls_name = ''
        for token in module.__name__.title().split('.')[2:]:
            cls_name += token.title()
        cls_name += 'Backend'
        try:
            b = getattr(module, cls_name)(bus=bus, **cfg, **kwargs)
            backends[name] = b
        except AttributeError as e:
            logger.warning('No such class in {}: {}'.format(
                module.__name__, cls_name))
            raise RuntimeError(e)
    return backends
def register_backends ( bus = None , global_scope = False , ** kwargs ) : global main_bus if bus : main_bus = bus if global_scope : global backends else : backends = { } for ( name , cfg ) in Config . get_backends ( ) . items ( ) : module = importlib . import_module ( 'platypush.backend.' + name ) cls_name = '' for token in module . __name__ . title ( ) . split ( '.' ) [ 2 : ] : cls_name += token . title ( ) cls_name += 'Backend' try : b = getattr ( module , cls_name ) ( bus = bus , ** cfg , ** kwargs ) backends [ name ] = b except AttributeError as e : logger . warning ( 'No such class in {}: {}' . format ( module . __name__ , cls_name ) ) raise RuntimeError ( e ) return backends
Initialize the backend objects based on the configuration and returns
a name -> backend_instance map.
Initialize the backend objects based on the configuration and returns a name - > backend_instance map .
""" Initialize the backend objects based on the configuration and returns
        a name -> backend_instance map.
    Params:
        bus -- If specific (it usually should), the messages processed by the
            backends will be posted on this bus.

        kwargs -- Any additional key-value parameters required to initialize the backends
        """ # e.g. backend.pushbullet main class: PushbulletBackend
bus
global_scope