unify lineends
This commit is contained in:
parent
ceed614b9a
commit
f56e57dfe2
@ -159,20 +159,36 @@ class attributeManager():
|
|||||||
def trackHighlights(self, oldAttr, newAttr, text, lenght):
|
def trackHighlights(self, oldAttr, newAttr, text, lenght):
|
||||||
result = ''
|
result = ''
|
||||||
currCursor = None
|
currCursor = None
|
||||||
if oldAttr == newAttr:
|
#if oldAttr == newAttr:
|
||||||
return result, currCursor
|
# return result, currCursor
|
||||||
if len(newAttr) == 0:
|
if len(newAttr) == 0:
|
||||||
|
print('len')
|
||||||
return result, currCursor
|
return result, currCursor
|
||||||
if len(oldAttr) != len(newAttr):
|
if len(oldAttr) != len(newAttr):
|
||||||
|
print('ON len')
|
||||||
return result, currCursor
|
return result, currCursor
|
||||||
|
|
||||||
textLines = text.split('\n')
|
textLines = text.split('\n')
|
||||||
|
|
||||||
if len(textLines) - 1 != len(newAttr):
|
if len(textLines) != len(newAttr):
|
||||||
|
print(len(textLines), len(newAttr))
|
||||||
return result, currCursor
|
return result, currCursor
|
||||||
|
print(len(textLines), len(newAttr))
|
||||||
background = []
|
background = []
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
allAttrib = [line for line in newAttr]
|
||||||
|
print(allAttrib)
|
||||||
|
#from collections import Counter
|
||||||
|
#import random
|
||||||
|
|
||||||
|
#tups = [ (1,2), (3,4), (5,6), (1,2), (3,4) ]
|
||||||
|
#lst = Counter(tups).most_common()
|
||||||
|
#highest_count = max([i[1] for i in lst])
|
||||||
|
#values = [i[0] for i in lst if i[1] == highest_count]
|
||||||
|
#random.shuffle(values)
|
||||||
|
#print(values[0])
|
||||||
|
|
||||||
bgStat = Counter(newAttr).most_common(3)
|
bgStat = Counter(newAttr).most_common(3)
|
||||||
#for i in bgStat:
|
#for i in bgStat:
|
||||||
# print(i)
|
# print(i)
|
||||||
|
@ -196,6 +196,7 @@ class driver(screenDriver):
|
|||||||
allText = ''
|
allText = ''
|
||||||
allAttrib = []
|
allAttrib = []
|
||||||
i = 0
|
i = 0
|
||||||
|
print(rows)
|
||||||
for y in range(rows):
|
for y in range(rows):
|
||||||
lineText = ''
|
lineText = ''
|
||||||
lineAttrib = []
|
lineAttrib = []
|
||||||
@ -254,7 +255,9 @@ class driver(screenDriver):
|
|||||||
'default', # fontsize
|
'default', # fontsize
|
||||||
'default') # fontfamily
|
'default') # fontfamily
|
||||||
lineAttrib.append(charAttrib)
|
lineAttrib.append(charAttrib)
|
||||||
allText += lineText + '\n'
|
allText += lineText
|
||||||
|
if y + 1 < rows:
|
||||||
|
allText += '\n'
|
||||||
allAttrib.append(lineAttrib)
|
allAttrib.append(lineAttrib)
|
||||||
return str(allText), allAttrib
|
return str(allText), allAttrib
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user