Esempio n. 1
0
 def dump(self, path, formatter, *args, **kwargs):
     fmt = find_formatter(formatter, path)
     transfer_kwargs, kwargs = split_transfer_kwargs(kwargs)
     with self.open(path, "w", _yield_path=True,
                    **transfer_kwargs) as lpath:
         return fmt.dump(lpath, *args, **kwargs)
Esempio n. 2
0
 def load(self, path, formatter, *args, **kwargs):
     _, kwargs = split_transfer_kwargs(kwargs)
     path = self._unscheme(path)
     return find_formatter(path, "load",
                           formatter).load(path, *args, **kwargs)
Esempio n. 3
0
 def dump(self, path, formatter, *args, **kwargs):
     _, kwargs = split_transfer_kwargs(kwargs)
     path = self._unscheme(path)
     return find_formatter(path, "dump",
                           formatter).dump(path, *args, **kwargs)
Esempio n. 4
0
File: remote.py Progetto: Nollde/law
 def load(self, path, formatter, *args, **kwargs):
     fmt = find_formatter(path, "load", formatter)
     transfer_kwargs, kwargs = split_transfer_kwargs(kwargs)
     with self.open(path, "r", _yield_path=True,
                    **transfer_kwargs) as lpath:
         return fmt.load(lpath, *args, **kwargs)