from glob import glob
import shutil
import os

loggerdir = os.path.expanduser('~/sea/logger/')
gzloggerdir = os.path.expanduser('~/sea/gzlogger/')

for year in range(2006,2018): # do not yet remove loggers for 2018
    for gdir in glob(gzloggerdir + str(year) + '/*.gz'):
        vdir = gdir.replace('/gzlogger/', '/logger/')
        if vdir[-3:] == '.gz':
            vdir = vdir[:-3]
            if os.path.isdir(vdir):
                shutil.rmtree(vdir)
    for special in ['/device_layout.*', '/default_list*']:
        for vdir in glob(loggerdir + str(year) + special):
            print vdir
            shutil.rmtree(vdir)

