From 148f2d2667392a1f5436920a87e7f1c8f9029b73 Mon Sep 17 00:00:00 2001 From: Joscha Date: Fri, 7 Jun 2019 19:30:21 +0000 Subject: [PATCH] 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. --- cheuph/markup.py | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/cheuph/markup.py b/cheuph/markup.py index a3834ea..87b865c 100644 --- a/cheuph/markup.py +++ b/cheuph/markup.py @@ -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 = []