parameters: (self, key=None, format='pretty')
docstring: Return construction variables serialized to a string.
  
          Args:
            key (optional): if None, format the whole dict of variables.
              Else format the value of `key` (Default value = None)
            format (str, optional): specify the format to serialize to.
              `"pretty"` generates a pretty-printed string,
              `"json"` a JSON-formatted string.
              (Default value = `"pretty"`)
docstring_summary: Return construction variables serialized to a string.
docstring_tokens: Return construction variables serialized to a string .
function: def Dump(self, key=None, format='pretty'):
          """ Return construction variables serialized to a string.
  
          Args:
            key (optional): if None, format the whole dict of variables.
              Else format the value of `key` (Default value = None)
            format (str, optional): specify the format to serialize to.
              `"pretty"` generates a pretty-printed string,
              `"json"` a JSON-formatted string.
              (Default value = `"pretty"`)
  
          """
          if key:
              cvars = self.Dictionary(key)
          else:
              cvars = self.Dictionary()
  
          fmt = format.lower()
  
          if fmt == 'pretty':
              import pprint
              pp = pprint.PrettyPrinter(indent=2)
  
              # TODO: pprint doesn't do a nice job on path-style values
              # if the paths contain spaces (i.e. Windows), because the
              # algorithm tries to break lines on spaces, while breaking
              # on the path-separator would be more "natural". Is there
              # a better way to format those?
              return pp.pformat(cvars)
  
          elif fmt == 'json':
              import json
              def non_serializable(obj):
                  return str(type(obj).__qualname__)
              return json.dumps(cvars, indent=4, default=non_serializable)
          else:
              raise ValueError("Unsupported serialization format: %s." % fmt)
function_tokens: def Dump ( self , key = None , format = 'pretty' ) : if key : cvars = self . Dictionary ( key ) else : cvars = self . Dictionary ( ) fmt = format . lower ( ) if fmt == 'pretty' : import pprint pp = pprint . PrettyPrinter ( indent = 2 ) # TODO: pprint doesn't do a nice job on path-style values # if the paths contain spaces (i.e. Windows), because the # algorithm tries to break lines on spaces, while breaking # on the path-separator would be more "natural". Is there # a better way to format those? return pp . pformat ( cvars ) elif fmt == 'json' : import json def non_serializable ( obj ) : return str ( type ( obj ) . __qualname__ ) return json . dumps ( cvars , indent = 4 , default = non_serializable ) else : raise ValueError ( "Unsupported serialization format: %s." % fmt )