예제 #1
0
    def __init__(self, config):
        """Constructor."""

        # Call mother's init
        Dispatcher.__init__(self)

        # Get config
        try:
            # Remote address for gateway
            self.url = config['url']
        except KeyError as error:
            raise DispatcherError("Config option not found: %s" % error)
예제 #2
0
    def __init__(self, config):
        # Call mother's init
        Dispatcher.__init__(self)

        # Get config
        try:
            # Result of "dispatch" attempts
            self.result = config['result']
        except KeyError as error:
            raise DispatcherError("Config option not found: %s" % error)

        if self.result.lower() not in self.OPTIONS:
            raise DispatcherError("Invalid value %r for option 'result'. "
                                  "Must be one of: " + ", ".join(self.OPTIONS),
                                  self.result)
        else:
            self.result = self.result.lower()
예제 #3
0
    def __init__(self, config):
        """Constructor."""

        # Call mother's init
        Dispatcher.__init__(self)

        # Get config
        try:
            # Remote address for gateway
            self.url = config['url']
            # Username for WebService
            self.username = config['username']
            # Password for WebService
            self.password = config['password']
            # Our phonenumber
            self.sender = config['sender']
        except KeyError as error:
            raise DispatcherError("Config option not found: %s" % error)

        # Initiate connector to Boost
        try:
            self.service = SOAPProxy(self.url)
        except Exception as error:
            raise DispatcherError("Failed to initialize SOAPProxy: %s" % error)
예제 #4
0
    def __init__(self, _config):
        """Constructor."""

        # Call mother's init
        Dispatcher.__init__(self)