Warning
This document is for an in-development version of Galaxy. You can alternatively view this page in the latest release if it exists or view the top of the latest release's documentation.
Source code for galaxy.visualization.plugins.utils
"""
Utilities for visualization plugins.
"""
# =============================================================================
[docs]class OpenObject(dict):
# note: not a Bunch
# TODO: move to util.data_structures
"""
A dict that allows assignment and attribute retrieval using the dot
operator.
If an attribute isn't contained in the dict `None` is returned (no
KeyError).
JSON-serializable.
"""
def __getitem__(self, key):
if key not in self:
return None
return super().__getitem__(key)
def __getattr__(self, key):
return self.__getitem__(key)