Esempio n. 1
0
 def write_atomic(self, name, obj, force=False):
     """Write the given object to the given metadata file, by creating a
     temporary file and then moving it, in order to prevent corruption
     of the existing file if the proces of writing is interupted."""
     self.write_raw_atomic(name,
                           martian.json_dumps_safe(obj, indent=4),
                           force)
Esempio n. 2
0
 def write(self, name, obj=None, force=False):
     """Write the given object to the given metadata file as json."""
     self.write_raw(name, martian.json_dumps_safe(obj or '', indent=4),
                    force)