From c5a58fe2be2b05c1d67cd3bf82af262dcce808cc Mon Sep 17 00:00:00 2001 From: Abdelrhman Bassiouny Date: Thu, 4 Apr 2024 16:26:21 +0200 Subject: [PATCH] Revert "[PyCRAMNEEMInterface] tests are passing except for redo pick action." This reverts commit 8266166c24c3f7b37422fef7840cc54b0cc27920. --- src/pycram/cache_manager.py | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/src/pycram/cache_manager.py b/src/pycram/cache_manager.py index 93c4c7673..a8995636b 100644 --- a/src/pycram/cache_manager.py +++ b/src/pycram/cache_manager.py @@ -1,4 +1,3 @@ -import logging import os import pathlib @@ -64,27 +63,17 @@ def generate_description_and_write_to_cache(self, path: str, name: str, extensio :param object_description: The object description of the file. """ description_string = object_description.generate_description_from_file(path, name, extension) - wrote = self.write_to_cache(description_string, cache_path) - if wrote: - while not pathlib.Path(cache_path).exists(): - pass + self.write_to_cache(description_string, cache_path) @staticmethod - def write_to_cache(description_string: str, cache_path: str) -> bool: + def write_to_cache(description_string: str, cache_path: str) -> None: """ Writes the description string to the cache directory. :param description_string: The description string to write to the cache directory. :param cache_path: The path of the file in the cache directory. - Returns: - - True if the description string was written to the cache directory. - """ - try: - with open(cache_path, "w") as file: - file.write(description_string) - return True - except Exception as e: - logging.warning(f"Could not write to cache: {e}") - return False + """ + with open(cache_path, "w") as file: + file.write(description_string) def look_for_file_in_data_dir(self, path_object: pathlib.Path) -> str: """