More pep8 fixes. A tiny bit of refactoring.
This commit is contained in:
@ -2,19 +2,20 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Fenrir TTY screen reader
|
||||
# By Chrys, Storm Dragon, and contributers.
|
||||
# By Chrys, Storm Dragon, and contributors.
|
||||
|
||||
from fenrirscreenreader.core import debug
|
||||
import re
|
||||
|
||||
from fenrirscreenreader.core import debug
|
||||
|
||||
class TableManager():
|
||||
|
||||
class TableManager:
|
||||
def __init__(self):
|
||||
self.headLine = ''
|
||||
self.defaultSeparators = ['+', ';', '|', ' ']
|
||||
self.headLine = ""
|
||||
self.defaultSeparators = ["+", ";", "|", " "]
|
||||
self.noOfHeadLineColumns = 0
|
||||
self.headColumnSep = ''
|
||||
self.rowColumnSep = ''
|
||||
self.headColumnSep = ""
|
||||
self.rowColumnSep = ""
|
||||
|
||||
def initialize(self, environment):
|
||||
self.env = environment
|
||||
@ -25,9 +26,9 @@ class TableManager():
|
||||
def reset_table_mode(self):
|
||||
self.set_head_line()
|
||||
|
||||
def set_head_column_sep(self, columnSep=''):
|
||||
def set_head_column_sep(self, columnSep=""):
|
||||
self.headColumnSep = columnSep
|
||||
if columnSep == '':
|
||||
if columnSep == "":
|
||||
self.noOfHeadLineColumns = 0
|
||||
else:
|
||||
self.coun_no_of_head_columns()
|
||||
@ -36,18 +37,18 @@ class TableManager():
|
||||
pass
|
||||
|
||||
def search_for_head_column_sep(self, headLine):
|
||||
if ' ' in headLine:
|
||||
return ' '
|
||||
return ''
|
||||
if " " in headLine:
|
||||
return " "
|
||||
return ""
|
||||
|
||||
def set_row_column_sep(self, columnSep=''):
|
||||
def set_row_column_sep(self, columnSep=""):
|
||||
self.rowColumnSep = columnSep
|
||||
|
||||
def set_head_line(self, headLine=''):
|
||||
def set_head_line(self, headLine=""):
|
||||
self.set_head_column_sep()
|
||||
self.set_row_column_sep()
|
||||
if headLine != '':
|
||||
if headLine != "":
|
||||
sep = self.search_for_head_column_sep(headLine)
|
||||
if sep != '':
|
||||
if sep != "":
|
||||
self.headLine = headLine
|
||||
self.set_head_column_sep(sep)
|
||||
|
Reference in New Issue
Block a user