def parse(self, path): if not os.path.exists(path): raise RuntimeError('cannot find %r' % path) try: data = Format.read(path) except Exception: raise RuntimeError('cannot parse %r' % path) if data: self.merge(data) return self
def write(self, path, value, format=None, **params): value = self.process(value, OUTGOING, True) Format.write(path, value, format, **params)
def write(self, path, format=None, **params): Format.write(path, self.environment, format, **params) return self
def read(self, path, **params): data = Format.read(path, **params) return self.process(data, INCOMING, True)