From ceda003b53e63b7f0472ef7ef5d1413ef8c9b1c7 Mon Sep 17 00:00:00 2001 From: craig-warren Date: Tue, 19 Sep 2023 11:03:09 +0100 Subject: [PATCH] Remove unused funcs --- gprMax/hash_cmds_file.py | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/gprMax/hash_cmds_file.py b/gprMax/hash_cmds_file.py index 641c7e9b..f717f9f9 100644 --- a/gprMax/hash_cmds_file.py +++ b/gprMax/hash_cmds_file.py @@ -396,32 +396,3 @@ def parse_hash_commands(scene): scene.add(user_obj) return scene - - -class Capturing(list): - """Context manager to capture standard output stream.""" - - # https://stackoverflow.com/questions/16571150/how-to-capture-stdout-output-from-a-python-function-call - - def __enter__(self): - self._stdout = sys.stdout - sys.stdout = self._stringio = StringIO() - return self - - def __exit__(self, *args): - self.extend(self._stringio.getvalue().splitlines()) - del self._stringio # free up some memory - sys.stdout = self._stdout - - -def user_libs_fn_to_scene_obj(f, *args, **kwargs): - """Function to convert library functions in the toolboxes directory - into geometry objects which can be added to the scene. - """ - - with Capturing() as str_cmds: - f(*args, **kwargs) - - user_objects = get_user_objects(str_cmds, checkessential=False) - - return user_objects