Beispiel #1
0
    def f_io(structure):

        structure_str = traverse_to_str(structure)
        structure_str = traverse(
            structure_str,
            lambda x: x if not x or len(x) <= 600 else
            ("%s... (%s files)" % (x[:400], len(x.split(",")))),
        )
        dumped = json_utils.dumps(structure_str, indent=2)
        return dumped
Beispiel #2
0
    def f_io(self, structure):

        structure_str = traverse_to_str(structure)
        structure_str = traverse(
            structure_str,
            lambda x: x if not x or len(x) <= 600 else
            ("%s... (%s files)" % (x[:400], len(x.split(",")))),
        )
        dumped = json_utils.dumps(structure_str, indent=2)
        if isinstance(structure_str, dict):
            dumped = self._hjson_optimizer.sub("\g<1>", dumped)
        return dumped
Beispiel #3
0
 def save_task_band(self):
     if self.task.task_band:
         task_outputs = traverse_to_str(self.task.task_outputs)
         self.task.task_band.as_object.write_json(task_outputs)
Beispiel #4
0
 def f_struct(self, structure):
     # return p.pformat(_dump_struct(structure))
     structure_str = traverse_to_str(structure)
     dumped = json_utils.dumps(structure_str, indent=2)
     return dumped