How to use the awxkit.awxkit.utils.__init__.PseudoNamespace function in awxkit

To help you get started, we’ve selected a few awxkit 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 ansible / awx / awxkit / awxkit / utils / __init__.py View on Github external
def __setitem__(self, key, value):
        if not isinstance(value, PseudoNamespace):
            tuple_converted = False
            if isinstance(value, dict):
                value = PseudoNamespace(value)
            elif isinstance(value, tuple):
                value = list(value)
                tuple_converted = True

            if isinstance(value, list):
                for i, item in enumerate(value):
                    if isinstance(item, dict) and not isinstance(item, PseudoNamespace):
                        value[i] = PseudoNamespace(item)
                if tuple_converted:
                    value = tuple(value)

        super(PseudoNamespace, self).__setitem__(key, value)
github ansible / awx / awxkit / awxkit / utils / __init__.py View on Github external
def __setitem__(self, key, value):
        if not isinstance(value, PseudoNamespace):
            tuple_converted = False
            if isinstance(value, dict):
                value = PseudoNamespace(value)
            elif isinstance(value, tuple):
                value = list(value)
                tuple_converted = True

            if isinstance(value, list):
                for i, item in enumerate(value):
                    if isinstance(item, dict) and not isinstance(item, PseudoNamespace):
                        value[i] = PseudoNamespace(item)
                if tuple_converted:
                    value = tuple(value)

        super(PseudoNamespace, self).__setitem__(key, value)
github ansible / awx / awxkit / awxkit / utils / __init__.py View on Github external
if not isinstance(value, PseudoNamespace):
            tuple_converted = False
            if isinstance(value, dict):
                value = PseudoNamespace(value)
            elif isinstance(value, tuple):
                value = list(value)
                tuple_converted = True

            if isinstance(value, list):
                for i, item in enumerate(value):
                    if isinstance(item, dict) and not isinstance(item, PseudoNamespace):
                        value[i] = PseudoNamespace(item)
                if tuple_converted:
                    value = tuple(value)

        super(PseudoNamespace, self).__setitem__(key, value)
github ansible / awx / awxkit / awxkit / utils / __init__.py View on Github external
if not isinstance(_d, dict):
            _d = {}
        _d.update(loaded)
        super(PseudoNamespace, self).__init__(_d)

        # Convert nested structures into PseudoNamespaces
        for k, v in _d.items():
            tuple_converted = False
            if isinstance(v, tuple):
                self[k] = v = list(v)
                tuple_converted = True

            if isinstance(v, list):
                for i, item in enumerate(v):
                    if isinstance(item, dict):
                        self[k][i] = PseudoNamespace(item)
                if tuple_converted:
                    self[k] = tuple(self[k])
            elif isinstance(v, dict):
                self[k] = PseudoNamespace(v)
github ansible / awx / awxkit / awxkit / utils / __init__.py View on Github external
def __setitem__(self, key, value):
        if not isinstance(value, PseudoNamespace):
            tuple_converted = False
            if isinstance(value, dict):
                value = PseudoNamespace(value)
            elif isinstance(value, tuple):
                value = list(value)
                tuple_converted = True

            if isinstance(value, list):
                for i, item in enumerate(value):
                    if isinstance(item, dict) and not isinstance(item, PseudoNamespace):
                        value[i] = PseudoNamespace(item)
                if tuple_converted:
                    value = tuple(value)

        super(PseudoNamespace, self).__setitem__(key, value)
github ansible / awx / awxkit / awxkit / utils / __init__.py View on Github external
# Convert nested structures into PseudoNamespaces
        for k, v in _d.items():
            tuple_converted = False
            if isinstance(v, tuple):
                self[k] = v = list(v)
                tuple_converted = True

            if isinstance(v, list):
                for i, item in enumerate(v):
                    if isinstance(item, dict):
                        self[k][i] = PseudoNamespace(item)
                if tuple_converted:
                    self[k] = tuple(self[k])
            elif isinstance(v, dict):
                self[k] = PseudoNamespace(v)