PyBOMBS (Python Build Overlay Managed Bundle System) is the GNU Radio install management system for resolving dependencies and pulling in out-of-tree projects.
def load(self, fd):
"""Load contents of a file descriptor and return a dictionary."""
if yaml.version_info[0] >= 0 and yaml.version_info[1] >= 16 and yaml.version_info[2] >= 5:
yl = self._load(fd)
def sanitize(data):
def strip(cs):
if isinstance(cs,yaml.comments.CommentedSeq):
cs = cs.copy()
if isinstance(cs,yaml.comments.CommentedMap):
cs = OrderedDict(cs)
if isinstance(cs,list):
for idx in range(len(cs)):
cs[idx] = strip(cs[idx])
if isinstance(cs,OrderedDict):
keys = list(cs.keys())
for k in keys:
cs[k] = strip(cs[k])
return cs
sanitized = strip(data)
if isinstance(data,yaml.comments.CommentedSeq):
for idx in range(len(sanitized)):
for ind in range(len(sanitized[idx])):
sanitized[idx][ind] = tuple(sanitized[idx][ind])
sanitized[idx] = OrderedDict(sanitized[idx])
if len(sanitized) == 1:
sanitized = sanitized[0]
return sanitized
return sanitize(yl)
else:
return self._load(fd)
I've been getting failures with pybombs 2.3.3 and ruamel.yaml 0.16.5
Config file:
With the following hack, was able to get back to functional, but haven't been able to put anymore testing into it.
pybombs/config_file.py -> AbstractYaml -> def load(self,fd)