loading of CSS file controllable by subclass

This commit is contained in:
Helmut Merz 2012-03-08 11:54:44 +01:00
parent 08c0ecadbf
commit 6579752dce

View file

@ -65,7 +65,12 @@ 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()