1 # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
2 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
4 from os.path import abspath, join, exists
5 from shutil import rmtree
6 from waiter.settings import WAITER_ROOT
9 def check_abspath(path):
10 abs_path = abspath(join(WAITER_ROOT, path))
11 if not abs_path.startswith(WAITER_ROOT):
12 raise ValueError('Path not inside WAITER_ROOT.')
16 def clear_cache(path):
17 abs_path = check_abspath(path)