From 7fe8c67d73c36e5c1713fefdd03baa0a39d5cf91 Mon Sep 17 00:00:00 2001 From: Markus Zolliker Date: Mon, 9 Feb 2026 15:03:31 +0100 Subject: [PATCH] lz4.py: move logger trash to home --- compress_logger/lz4.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/compress_logger/lz4.py b/compress_logger/lz4.py index 0908b1e..b9037e8 100644 --- a/compress_logger/lz4.py +++ b/compress_logger/lz4.py @@ -16,11 +16,15 @@ COMPRESS = 1 EXPAND = 2 +def get_trash(instrument): + return os.path.expanduser(f'~/sea_logger_trash_{instrument}') + + def treat(instrument, yearlimit): + trash = get_trash(instrument) logbase = '%slogger/' % instdir(instrument) os.chdir(logbase) print('chdir', logbase) - trash = '../loggertrash' os.makedirs(trash, exist_ok=True) for ynum in range(2007, 2040): year = str(ynum) @@ -105,6 +109,6 @@ if __name__ == '__main__': treat(instrument, year) print('if you are sure nothing is lost, you may delete loggertrash:') for instrument in instruments: - tr = instdir(instrument) + 'loggertrash' - print(f' rm -r {tr}') + trash = get_trash(instrument) + print(f' rm -r {trash}')