Skip to content

Commit 532f0cb

Browse files
committed
sponsorship message
1 parent b6aae7c commit 532f0cb

File tree

1 file changed

+12
-40
lines changed

1 file changed

+12
-40
lines changed

rich/__main__.py

Lines changed: 12 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,8 @@ def iter_last(values: Iterable[T]) -> Iterable[Tuple[bool, T]]:
207207

208208

209209
if __name__ == "__main__": # pragma: no cover
210+
from rich.panel import Panel
211+
210212
console = Console(
211213
file=io.StringIO(),
212214
force_terminal=True,
@@ -227,47 +229,17 @@ def iter_last(values: Iterable[T]) -> Iterable[Tuple[bool, T]]:
227229
c = Console(record=True)
228230
c.print(test_card)
229231

230-
print(f"rendered in {pre_cache_taken}ms (cold cache)")
231-
print(f"rendered in {taken}ms (warm cache)")
232-
233-
from rich.panel import Panel
234-
235232
console = Console()
236-
237-
sponsor_message = Table.grid(padding=1)
238-
sponsor_message.add_column(style="green", justify="right")
239-
sponsor_message.add_column(no_wrap=True)
240-
241-
sponsor_message.add_row(
242-
"Textualize",
243-
"[u blue link=https://github.com/textualize]https://github.com/textualize",
244-
)
245-
sponsor_message.add_row(
246-
"Twitter",
247-
"[u blue link=https://twitter.com/willmcgugan]https://twitter.com/willmcgugan",
248-
)
249-
250-
intro_message = Text.from_markup(
251-
"""\
252-
We hope you enjoy using Rich!
253-
254-
Rich is maintained with [red]:heart:[/] by [link=https://www.textualize.io]Textualize.io[/]
255-
256-
- Will McGugan"""
257-
)
258-
259-
message = Table.grid(padding=2)
260-
message.add_column()
261-
message.add_column(no_wrap=True)
262-
message.add_row(intro_message, sponsor_message)
263-
233+
console.print(f"[dim]rendered in [not dim]{pre_cache_taken}ms[/] (cold cache)")
234+
console.print(f"[dim]rendered in [not dim]{taken}ms[/] (warm cache)")
235+
console.print()
264236
console.print(
265237
Panel.fit(
266-
message,
267-
box=box.ROUNDED,
268-
padding=(1, 2),
269-
title="[b red]Thanks for trying out Rich!",
270-
border_style="bright_blue",
271-
),
272-
justify="center",
238+
"[b magenta]Hope you enjoy using Rich![/]\n\n"
239+
"Please consider sponsoring me if you get value from my work.\n\n"
240+
"Even the price of a ☕ can brighten my day!\n\n"
241+
"https://github.com/sponsors/willmcgugan",
242+
border_style="red",
243+
title="Help ensure Rich is maintained",
244+
)
273245
)

0 commit comments

Comments
 (0)