def get_options(cls): """ Schema for options validation and assignment of default values. """ return { 'host': Or(str, lambda x: is_context(x)), 'port': Or(Use(int), lambda x: is_context(x)), Optional('timeout', default=5): Use(int), Optional('interval', default=0.01): Use(float) }
def configuration_schema(self): """ Schema for options validation and assignment of default values. """ overrides = { 'host': Or(str, lambda x: is_context(x)), 'port': Or(Use(int), lambda x: is_context(x)), Optional('timeout', default=5): Use(int), Optional('interval', default=0.01): Use(float) } return self.inherit_schema(overrides, super(HTTPClientConfig, self))
def get_options(cls): """ Schema for options validation and assignment of default values. """ return { 'hosts': Or(*make_iterables([str, ContextValue])), 'ports': Or(*make_iterables([int, ContextValue])), Optional('message_pattern', default=zmq.PAIR): Or(zmq.PAIR, zmq.REQ, zmq.SUB, zmq.PULL), Optional('connect_at_start', default=True): bool }
def get_options(cls): """ Schema for options validation and assignment of default values. """ return { Optional('host', default='localhost'): str, Optional('port', default=0): Use(int), Optional('message_pattern', default=zmq.PAIR): Or(zmq.PAIR, zmq.REP, zmq.PUB, zmq.PUSH) }
def get_options(cls): """ Schema for options validation and assignment of default values. """ return { Optional("host", default="localhost"): str, Optional("port", default=0): Use(int), Optional("message_pattern", default=zmq.PAIR): Or(zmq.PAIR, zmq.REP, zmq.PUB, zmq.PUSH), }
def configuration_schema(self): """ Schema for options validation and assignment of default values. """ overrides = { Optional('host', default='localhost'): str, Optional('port', default=0): Use(int), Optional('message_pattern', default=zmq.PAIR): Or(zmq.PAIR, zmq.REP, zmq.PUB, zmq.PUSH) } return self.inherit_schema(overrides, super(ZMQServerConfig, self))
def configuration_schema(self): """ Schema for options validation and assignment of default values. """ overrides = { 'hosts': Or(*make_iterables([str, ContextValue])), 'ports': Or(*make_iterables([int, ContextValue])), Optional('message_pattern', default=zmq.PAIR): Or(zmq.PAIR, zmq.REQ, zmq.SUB, zmq.PULL), Optional('connect_at_start', default=True): bool } return self.inherit_schema(overrides, super(ZMQClientConfig, self))
def get_options(cls): """ Schema for options validation and assignment of default values. """ return { "host": Or(str, lambda x: is_context(x)), Optional("port", default=None): Or(None, Use(int), lambda x: is_context(x)), Optional("protocol", default="http"): str, Optional("timeout", default=5): Use(int), Optional("interval", default=0.01): Use(float), }
def get_options(cls): """ Schema for options validation and assignment of default values. """ return { Optional('host', default='localhost'): str, Optional('port', default=0): Use(int), Optional('request_handler', default=HTTPRequestHandler): lambda v: issubclass(v, http_server.BaseHTTPRequestHandler), Optional('handler_attributes', default={}): dict, Optional('timeout', default=5): Use(int) }
def configuration_schema(self): """ Schema for options validation and assignment of default values. """ overrides = { Optional('host', default='localhost'): str, Optional('port', default=0): Use(int), Optional('request_handler', default=HTTPRequestHandler): lambda v: issubclass(v, http_server.BaseHTTPRequestHandler), Optional('handler_attributes', default={}): dict, Optional('timeout', default=5): Use(int) } return self.inherit_schema(overrides, super(HTTPServerConfig, self))
def get_options(cls): """ Schema for options validation and assignment of default values. """ return { Optional("host", default="localhost"): str, Optional("port", default=0): Use(int), Optional("request_handler", default=HTTPRequestHandler): lambda v: issubclass(v, http_server.BaseHTTPRequestHandler), Optional("handler_attributes", default={}): dict, Optional("timeout", default=5): Use(int), Optional("interval", default=0.01): Use(float), }
def get_options(cls): return { Optional("start_raises", default=False): bool, Optional("stop_raises", default=False): bool, }