Remove unused function
As far as I know, the function produced incorrect results. I don't need it anways, so I'm just throwing it out.
This commit is contained in:
parent
37b84adab5
commit
148f2d2667
1 changed files with 0 additions and 31 deletions
|
|
@ -246,37 +246,6 @@ class AttributedText:
|
|||
) -> Any:
|
||||
return self._at(pos).get(name, default)
|
||||
|
||||
# "find all separate blocks with this property"
|
||||
def find_all(self, name: str) -> List[Tuple[Any, int, int]]:
|
||||
blocks = []
|
||||
pos = 0
|
||||
block = None
|
||||
|
||||
for chunk in self._chunks:
|
||||
if name in chunk.attributes:
|
||||
attribute = chunk.attributes[name]
|
||||
start = pos
|
||||
stop = pos + len(chunk)
|
||||
|
||||
if block is None:
|
||||
block = (attribute, start, stop)
|
||||
continue
|
||||
|
||||
block_attr, block_start, _ = block
|
||||
|
||||
if block_attr == attribute:
|
||||
block = (attribute, block_start, stop)
|
||||
else:
|
||||
blocks.append(block)
|
||||
block = (attribute, start, stop)
|
||||
|
||||
pos += len(chunk)
|
||||
|
||||
if block is not None:
|
||||
blocks.append(block)
|
||||
|
||||
return blocks
|
||||
|
||||
def split_by(self, attribute_name: str) -> List[Tuple["AttributedText", Any]]:
|
||||
blocks = []
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue