diff options
| author | Zach DeCook <zachdecook@librem.one> | 2022-12-23 17:24:07 -0500 |
|---|---|---|
| committer | Zach DeCook <zachdecook@librem.one> | 2022-12-23 17:24:07 -0500 |
| commit | f62aa8b56139a758dbe1cd7b093d980c260cea18 (patch) | |
| tree | c92842a6d8c9531c365b06c3d996a706fab8bd9e /gemtext.py | |
| parent | 7f7c524cf1cd6188d8704af3d211ce2c0a8b4e6f (diff) | |
| download | browset-f62aa8b56139a758dbe1cd7b093d980c260cea18.tar.gz | |
Browset: Fully recreate gemtext widget on entry
Diffstat (limited to 'gemtext.py')
| -rw-r--r-- | gemtext.py | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/gemtext.py b/gemtext.py index 62640a3..66a2ad6 100644 --- a/gemtext.py +++ b/gemtext.py @@ -4,17 +4,11 @@ from textual.containers import Container class Gemtext(Static): """Gemtext widget.""" - items = [] - #def compose(self) -> ComposeResult: - # yield Container(id="content") def __init__(self, txt, id): super().__init__(id=id) - self.update(txt) - def update(self, txt): - #S = self.query("Static") - #if S: - # S.last().remove() + self.addlines(txt) + def addlines(self, txt): for line in txt.split('\n'): if line.startswith("=>"): path = line[2:].lstrip().split(' ')[0] |
