Reads data from the JSON file. Returns: Dict[str, Any]: The data stored in the JSON file.
(self)
| 155 | return int(str(uuid.uuid4().int)[:18]) |
| 156 | |
| 157 | def _read_data(self) -> Dict[str, Any]: |
| 158 | """Reads data from the JSON file. |
| 159 | |
| 160 | Returns: |
| 161 | Dict[str, Any]: The data stored in the JSON file. |
| 162 | """ |
| 163 | with self.lock, open(self.filename, "r") as db_file: |
| 164 | return json.load(db_file) |
| 165 | |
| 166 | def _write_data(self, data: Dict[str, Any]) -> None: |
| 167 | """Writes the given data into the JSON file. |