30 lines
1.0 KiB
Python
30 lines
1.0 KiB
Python
# -*- mode: python; python-indent-offset: 4; tab-width: 0; encoding: utf-8-unix -*-
|
|
# This should be execed in config.py
|
|
import sys
|
|
import os
|
|
import atexit
|
|
|
|
@atexit.register
|
|
def atexit_cleanup():
|
|
lDels = [os.path.join(config.datadir, 'cookies'),
|
|
os.path.join(config.datadir, 'history.sqlite'),
|
|
]
|
|
bidir = os.path.join(config.datadir, 'webengine')
|
|
lDels += [os.path.join(bidir, 'Cookies'),
|
|
os.path.join(bidir, 'Cookies-journal'),
|
|
os.path.join(bidir, 'Favicons'),
|
|
os.path.join(bidir, 'Favicons-journal'),
|
|
os.path.join(bidir, 'History'),
|
|
os.path.join(bidir, 'History-journal'),
|
|
os.path.join(bidir, 'Network Persistent State'),
|
|
os.path.join(bidir, 'TransportSecurity'),
|
|
os.path.join(bidir, 'Visited Links'),
|
|
]
|
|
i = 0
|
|
for elt in lDels:
|
|
if os.path.exists(elt):
|
|
os.unlink(elt)
|
|
i += 1
|
|
sys.stderr.write(f"Cleaned up {i} files\n")
|
|
|