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}')