dynamically add new css and js folders to prevent human error

master
Aevann 2023-09-26 19:17:42 +03:00
parent bdfa1c115e
commit 1574887f1d
1 changed files with 7 additions and 2 deletions

View File

@ -8,14 +8,19 @@ import gevent_inotifyx as inotify
from files.helpers.config.const import *
ASSET_DIR = 'files/assets'
ASSET_SUBDIRS = ['/css', '/js', '/js/vendor']
ASSET_URL = '/assets/'
ASSET_CACHE = defaultdict(lambda: None)
ASSET_SUBDIRS = ['/css', '/js']
if IS_DKD():
ASSET_SUBDIRS.extend(['/events/DKD/js'])
elif IS_FISTMAS():
ASSET_SUBDIRS.extend(['/events/fistmas/css', '/events/fistmas/css/themes', '/events/fistmas/js', '/events/fistmas/js/vendor'])
ASSET_SUBDIRS.extend(['/events/fistmas/css', '/events/fistmas/js'])
new_dirs = []
for directory in ASSET_SUBDIRS:
new_dirs += [x[0].split(ASSET_DIR)[1] for x in os.walk(f'{ASSET_DIR}{directory}')]
ASSET_SUBDIRS = new_dirs
def assetcache_build(asset_dir, subdirs):
for subdir in subdirs: