Пример #1
0
 def delete_file(self, paths):
     try:
         paths, errors = self.webreview.delete(paths)
         if errors:
             raise base.Error(errors)
         return paths
     except webreview.RpcError as e:
         raise base.Error(e.message)
Пример #2
0
 def write_files(self, paths_to_rendered_doc):
     try:
         paths_to_rendered_doc, errors = self.webreview.write(
             paths_to_rendered_doc)
         if errors:
             raise base.Error(errors)
         return paths_to_rendered_doc
     except webreview.RpcError as e:
         raise base.Error(e.message)
Пример #3
0
 def read_file(self, path):
     try:
         paths_to_contents, errors = self.webreview.read([path])
         if path not in paths_to_contents:
             raise IOError('{} not found.'.format(path))
         if errors:
             raise base.Error(errors)
         return paths_to_contents[path]
     except webreview.RpcError as e:
         raise base.Error(e.message)