smsframework/Gateway.py
def receiver_blueprint_for(self, name):
        """ Get a Flask blueprint for the named provider that handles incoming messages & status reports

            Note: this requires Flask microframework.

            :rtype: flask.blueprints.Blueprint
            :returns: Flask Blueprint, fully functional
            :raises KeyError: provider not found
            :raises NotImplementedError: Provider does not implement a receiver
        """
        # Get the provider & blueprint
        provider = self.get_provider(name)
        bp = provider.make_receiver_blueprint()

        # Register a Flask handler that initializes `g.provider`
        # This is the only way for the blueprint to get the current IProvider instance
        from flask.globals import g  # local import as the user is not required to use receivers at all

        @bp.before_request
        def init_g():
            g.provider = provider

        # Finish
        return bp
def receiver_blueprint_for(self, name):
        """ Get a Flask blueprint for the named provider that handles incoming messages & status reports

            Note: this requires Flask microframework.

            :rtype: flask.blueprints.Blueprint
            :returns: Flask Blueprint, fully functional
            :raises KeyError: provider not found
            :raises NotImplementedError: Provider does not implement a receiver
        """
        # Get the provider & blueprint
        provider = self.get_provider(name)
        bp = provider.make_receiver_blueprint()

        # Register a Flask handler that initializes `g.provider`
        # This is the only way for the blueprint to get the current IProvider instance
        from flask.globals import g  # local import as the user is not required to use receivers at all

        @bp.before_request
        def init_g():
            g.provider = provider

        # Finish
        return bp
Get a Flask blueprint for the named provider that handles incoming messages & status reports

            Note: this requires Flask microframework.

            :rtype: flask.blueprints.Blueprint
            :returns: Flask Blueprint, fully functional
            :raises KeyError: provider not found
            :raises NotImplementedError: Provider does not implement a receiver