Ejemplo n.º 1
0
 def _unserialize(self):
     """Load file content to string"""
     if not self._text:
         try:
             self._text = self.path.read_text()
         except IOError as e:
             raise exc.ContentSerializeError(self, self.path, str(e))
Ejemplo n.º 2
0
 def _unserialize(self):
     """Load yaml to dictionary"""
     try:
         self._as_dict = yaml.load(self.path)
     except ScannerError as e:
         raise exc.ContentSerializeError(self, self.path, e.problem)
Ejemplo n.º 3
0
 def _unserialize(self) -> None:
     """Load json to dictionary"""
     try:
         self._as_dict = ujson.load(self._path.open())
     except ValueError as e:
         raise exc.ContentSerializeError(self, self.path, str(e))