From 83b3e075f4849df74a2d74eab3b41bb2904ebdff Mon Sep 17 00:00:00 2001 From: chrys Date: Sat, 10 Mar 2018 17:31:31 +0100 Subject: [PATCH] merge bleed --- src/fenrir/core/tableManager.py | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/src/fenrir/core/tableManager.py b/src/fenrir/core/tableManager.py index b9b61cff..60a31cf4 100644 --- a/src/fenrir/core/tableManager.py +++ b/src/fenrir/core/tableManager.py @@ -9,8 +9,38 @@ import re class tableManager(): def __init__(self): - pass + self.headLine = '' + self.defaultSeparators = ['+',';','|',' '] + self.noOfHeadLineColumns = 0 + self.headColumnSep = '' + self.rowColumnSep = '' def initialize(self, environment): self.env = environment def shutdown(self): pass + def resetTableMode(self): + self.setHeadLine() + def setHeadColumnSep(self, columnSep = ''): + self.headColumnSep = columnSep + if columnSep == '': + self.noOfHeadLineColumns = 0 + else: + self.counNoOfHeadColumns() + def counNoOfHeadColumns(self): + pass + def searchForHeadColumnSep(self, headLine): + if ' ' in headLine: + return ' ' + return '' + def setRowColumnSep(self, columnSep = ''): + self.rowColumnSep = columnSep + + def setHeadLine(self, headLine = ''): + self.setHeadColumnSep() + self.setRowColumnSep() + if headLine != '': + sep = self.searchForHeadColumnSep(headLine) + if sep != '': + self.headLine = headLine + self.setHeadColumnSep(sep) +