lz4.py: move logger trash to home

This commit is contained in:
2026-02-09 15:03:31 +01:00
parent 539f423555
commit 7fe8c67d73

View File

@@ -16,11 +16,15 @@ COMPRESS = 1
EXPAND = 2 EXPAND = 2
def get_trash(instrument):
return os.path.expanduser(f'~/sea_logger_trash_{instrument}')
def treat(instrument, yearlimit): def treat(instrument, yearlimit):
trash = get_trash(instrument)
logbase = '%slogger/' % instdir(instrument) logbase = '%slogger/' % instdir(instrument)
os.chdir(logbase) os.chdir(logbase)
print('chdir', logbase) print('chdir', logbase)
trash = '../loggertrash'
os.makedirs(trash, exist_ok=True) os.makedirs(trash, exist_ok=True)
for ynum in range(2007, 2040): for ynum in range(2007, 2040):
year = str(ynum) year = str(ynum)
@@ -105,6 +109,6 @@ if __name__ == '__main__':
treat(instrument, year) treat(instrument, year)
print('if you are sure nothing is lost, you may delete loggertrash:') print('if you are sure nothing is lost, you may delete loggertrash:')
for instrument in instruments: for instrument in instruments:
tr = instdir(instrument) + 'loggertrash' trash = get_trash(instrument)
print(f' rm -r {tr}') print(f' rm -r {trash}')