From e0b64f70a1edee3875872848a2c7555f48740ed7 Mon Sep 17 00:00:00 2001 From: AnonymouX47 Date: Sat, 31 Aug 2024 11:01:38 +0100 Subject: [PATCH] docs: Correct and Update examples in docstrings --- src/urwidgets/hyperlink.py | 6 +++--- src/urwidgets/text_embed.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/urwidgets/hyperlink.py b/src/urwidgets/hyperlink.py index 561fb52..698b476 100644 --- a/src/urwidgets/hyperlink.py +++ b/src/urwidgets/hyperlink.py @@ -69,19 +69,19 @@ class Hyperlink(urwid.WidgetWrap): >>> >>> # Raw URI >>> link = Hyperlink(url) - >>> canv = link.render(len(url)) + >>> canv = link.render(()) >>> print(canv.text[0].decode()) https://urwid.org >>> >>> # Clipped (with an ellipsis appended) when the render width (maxcols) is >>> # shorter than the link text - >>> canv = link.render(len(url) - 4) + >>> canv = link.render((len(url) - 4,)) >>> print(canv.text[0].decode()) https://urwid… >>> >>> # URI with custom text >>> hyperlink = Hyperlink(url, text="Urwid Website") - >>> canv = hyperlink.render(hyperlink.pack()[:1]) + >>> canv = hyperlink.render(()) >>> print(canv.text[0].decode()) Urwid Website diff --git a/src/urwidgets/text_embed.py b/src/urwidgets/text_embed.py index 7f25d1a..4cc1520 100644 --- a/src/urwidgets/text_embed.py +++ b/src/urwidgets/text_embed.py @@ -114,7 +114,7 @@ class TextEmbed(urwid.Text): ... ] ... ) >>> - >>> canv = text_embed.render(text_embed.pack()[:1]) + >>> canv = text_embed.render(()) >>> # The hyperlinks (`This` and `https://urwid.org`) should be highlighted >>> # on mouse hover and clickable (in the terminal), if supported. >>> print(canv.text[0].decode()) @@ -573,7 +573,7 @@ def parse_text( ] >>> >>> text_widget = TextEmbed(markup) - >>> canv = text_widget.render(text_widget.pack()[:1]) + >>> canv = text_widget.render(()) >>> # The hyperlinks (`This` and `https://urwid.org`) should be highlighted >>> # on mouse hover and clickable (in the terminal), if supported. >>> print(canv.text[0].decode())