From 86b52ed60b78b6c27cfb38d2186914ee728ec6af Mon Sep 17 00:00:00 2001 From: SNoiraud Date: Fri, 15 Jul 2016 16:18:30 +0200 Subject: [PATCH] 2016: Website reports should accept any StyleSheet --- gramps/gen/const.py | 3 ++- gramps/plugins/webstuff/webstuff.py | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gramps/gen/const.py b/gramps/gen/const.py index 138df4891..6c1cd0cdd 100644 --- a/gramps/gen/const.py +++ b/gramps/gen/const.py @@ -119,9 +119,10 @@ THUMB_DIR = os.path.join(HOME_DIR, "thumb") THUMB_NORMAL = os.path.join(THUMB_DIR, "normal") THUMB_LARGE = os.path.join(THUMB_DIR, "large") USER_PLUGINS = os.path.join(VERSION_DIR, "plugins") +USER_CSS = os.path.join(HOME_DIR, "css") # dirs checked/made for each Gramps session USER_DIRLIST = (USER_HOME, HOME_DIR, VERSION_DIR, ENV_DIR, TEMP_DIR, THUMB_DIR, - THUMB_NORMAL, THUMB_LARGE, USER_PLUGINS) + THUMB_NORMAL, THUMB_LARGE, USER_PLUGINS, USER_CSS) #------------------------------------------------------------------------- diff --git a/gramps/plugins/webstuff/webstuff.py b/gramps/plugins/webstuff/webstuff.py index 2a92d9798..ba87f3e96 100644 --- a/gramps/plugins/webstuff/webstuff.py +++ b/gramps/plugins/webstuff/webstuff.py @@ -23,7 +23,7 @@ # python modules #------------------------------------------------ import os -from gramps.gen.const import VERSION_DIR, IMAGE_DIR, DATA_DIR +from gramps.gen.const import VERSION_DIR, IMAGE_DIR, DATA_DIR, USER_CSS from gramps.gen.const import GRAMPS_LOCALE as glocale _ = glocale.translation.sgettext @@ -176,6 +176,12 @@ def load_on_reg(dbstate, uistate, plugin): ['marker', 0, 'marker', path_img("gramps-geo-mainmap.png"), None, [], [] ], ] + # If we add css user files, we must restart gramps to use them. + list_files = os.listdir(USER_CSS) + for cssfile in list_files: + CSS_FILES.append([cssfile, 1, cssfile.replace('.css', ''), + os.path.join(USER_CSS,cssfile), + None, [], [] ]) return CSS_FILES def process_list(data):