1
0
mirror of https://github.com/ihabunek/toot.git synced 2024-11-03 04:17:21 -05:00

Cleanup formatting

This commit is contained in:
Ivan Habunek 2023-11-04 07:26:45 +01:00
parent 06167a5bc9
commit a9ef96c31b
No known key found for this signature in database
GPG Key ID: F5F0623FF5EBCB3D
3 changed files with 8 additions and 23 deletions

View File

@ -1,16 +1,14 @@
"""
richtext
"""
from typing import List, Tuple
import re import re
import urwid import urwid
import unicodedata import unicodedata
from .constants import PALETTE
from bs4 import BeautifulSoup from bs4 import BeautifulSoup
from bs4.element import NavigableString, Tag from bs4.element import NavigableString, Tag
from .stubs.urwidgets import TextEmbed, Hyperlink, parse_text, has_urwidgets from toot.tui.constants import PALETTE
from urwid.util import decompose_tagmarkup from toot.tui.stubs.urwidgets import TextEmbed, Hyperlink, parse_text, has_urwidgets
from toot.utils import urlencode_url from toot.utils import urlencode_url
from typing import List, Tuple
from urwid.util import decompose_tagmarkup
class ContentParser: class ContentParser:

View File

@ -4,12 +4,7 @@ import urwid
class Hyperlink(urwid.WidgetWrap): class Hyperlink(urwid.WidgetWrap):
def __init__( def __init__(self, uri, attr, text):
self,
uri,
attr,
text,
):
pass pass
def render(self, size, focus): def render(self, size, focus):

View File

@ -4,9 +4,7 @@ import urwid
class TextEmbed(urwid.Text): class TextEmbed(urwid.Text):
def get_text( def get_text(self):
self,
):
return None return None
def render(self, size, focus): def render(self, size, focus):
@ -19,11 +17,5 @@ class TextEmbed(urwid.Text):
pass pass
def parse_text( def parse_text(text, patterns, repl, *repl_args, **repl_kwargs):
text,
patterns,
repl,
*repl_args,
**repl_kwargs,
):
return None return None