From 427eb9d3b406f66ce6d3db23f80bbbe15b74e1b6 Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Sat, 4 Aug 2012 09:22:54 +0200 Subject: [PATCH] allow overwriting of CSS definitions with reuse of standard file --- docgen/base.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docgen/base.py b/docgen/base.py index 106c5a6..9dbff1e 100644 --- a/docgen/base.py +++ b/docgen/base.py @@ -64,9 +64,13 @@ class WordDocument(Base): @Lazy def css(self): - fn = os.path.join(os.path.dirname(__file__), 'word.css') + return self.loadCSS() + + def loadCSS(self, filename='word.css', path=None): + if path is None: + path = os.path.dirname(__file__) + fn = os.path.join(path, filename) f = open(fn, 'r') css = f.read() f.close() return css -