config: support outputing a pickle of the configuration tree
This commit is contained in:
@@ -228,6 +228,12 @@ class SimObjectVector(VectorParamValue):
|
||||
for obj in v.descendants():
|
||||
yield obj
|
||||
|
||||
def get_config_as_dict(self):
|
||||
a = []
|
||||
for v in self:
|
||||
a.append(v.get_config_as_dict())
|
||||
return a
|
||||
|
||||
class VectorParamDesc(ParamDesc):
|
||||
# Convert assigned value to appropriate type. If the RHS is not a
|
||||
# list or tuple, it generates a single-element list.
|
||||
@@ -964,6 +970,9 @@ class Time(ParamValue):
|
||||
def ini_str(self):
|
||||
return str(self)
|
||||
|
||||
def get_config_as_dict(self):
|
||||
return str(self)
|
||||
|
||||
# Enumerated types are a little more complex. The user specifies the
|
||||
# type as Enum(foo) where foo is either a list or dictionary of
|
||||
# alternatives (typically strings, but not necessarily so). (In the
|
||||
|
||||
Reference in New Issue
Block a user