How to use the omniduct.duct.Duct.__init_with_kwargs__ function in omniduct

To help you get started, we’ve selected a few omniduct examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github airbnb / omniduct / omniduct / caches / base.py View on Github external
def __init__(self, **kwargs):
        Duct.__init_with_kwargs__(self, kwargs)
        self._init(**kwargs)
github airbnb / omniduct / omniduct / restful / base.py View on Github external
def __init__(self, server_protocol='http', assume_json=False, endpoint_prefix='', **kwargs):
        """
        Args:
            server_protocol (str): The protocol to use when connecting to the
                remote host (default: `'http'`).
            assume_json (bool): Assume that responses will be JSON when calling
                instances of this class (default: `False`).
            endpoint_prefix (str): The base_url path relative to the host at
                which the API is accessible (default: `''`).
            **kwargs (dict): Additional keyword arguments passed on to
                subclasses.
        """
        Duct.__init_with_kwargs__(self, kwargs, port=80)

        self.server_protocol = server_protocol
        self.assume_json = assume_json
        self.endpoint_prefix = endpoint_prefix

        self._init(**kwargs)
github airbnb / omniduct / omniduct / filesystems / base.py View on Github external
def __init__(self, cwd=None, home=None, read_only=False, global_writes=False, **kwargs):
        """
        cwd (None, str): The path prefix to use as the current working directory
            (if None, the user's home directory is used where that makes sense).
        home (None, str): The path prefix to use as the current users' home
            directory. If not specified, it will default to an implementation-
            specific value (often '/').
        read_only (bool): Whether the filesystem should only be able to perform
            read operations.
        global_writes (bool): Whether to allow writes outside of the user's home
            folder.
        **kwargs (dict): Additional keyword arguments to passed on to subclasses.
        """
        Duct.__init_with_kwargs__(self, kwargs, port=self.DEFAULT_PORT)
        self._path_cwd = cwd
        self.__path_home = home
        self.read_only = read_only
        self.global_writes = global_writes
        self._init(**kwargs)
github airbnb / omniduct / omniduct / databases / base.py View on Github external
def __init__(
        self, session_properties=None, templates=None, template_context=None, default_format_opts=None,
        **kwargs
    ):
        """
        session_properties (dict): A mapping of default session properties
            to values. Interpretation is left up to implementations.
        templates (dict): A dictionary of name to template mappings. Additional
            templates can be added using `.template_add`.
        template_context (dict): The default template context to use when
            rendering templates.
        default_format_opts (dict): The default formatting options passed to
            cursor formatter.
        """
        Duct.__init_with_kwargs__(self, kwargs, port=self.DEFAULT_PORT)

        self.session_properties = session_properties or {}
        self._templates = templates or {}
        self._template_context = template_context or {}
        self._sqlalchemy_engine = None
        self._sqlalchemy_metadata = None
        self._default_format_opts = default_format_opts or {}

        self._init(**kwargs)