loading of CSS file controllable by subclass
This commit is contained in:
		
							parent
							
								
									08c0ecadbf
								
							
						
					
					
						commit
						6579752dce
					
				
					 1 changed files with 6 additions and 1 deletions
				
			
		|  | @ -65,7 +65,12 @@ class WordDocument(Base): | ||||||
| 
 | 
 | ||||||
|     @Lazy |     @Lazy | ||||||
|     def css(self): |     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') |         f = open(fn, 'r') | ||||||
|         css = f.read() |         css = f.read() | ||||||
|         f.close() |         f.close() | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue