1818from .internal import cookieplone_info , version_info
1919
2020BANNER = """
21- .xxxxxxxxxxxxxx.
22- ;xxxxxxxxxxxxxxxxxxxxxx;
23- ;xxxxxxxxxxxxxxxxxxxxxxxxxxxx;
24- xxxxxxxxxx xxxxxxxxxx
25- xxxxxxxx. .xxxxxxxx
26- xxxxxxx xxxxxxx: xxxxxxx
27- :xxxxxx xxxxxxxxxx xxxxxx:
28- :xxxxx+ xxxxxxxxxxx +xxxxx:
29- .xxxxx. :xxxxxxxxxx .xxxxx.
30- xxxxx+ ;xxxxxxxx +xxxxx
31- xxxxx +xx. xxxxx.
32- xxxxx: .xxxxxxxx :xxxxx
33- xxxxx .xxxxxxxxxx xxxxx
34- xxxxx xxxxxxxxxxx xxxxx
35- xxxxx .xxxxxxxxxx xxxxx
36- xxxxx: .xxxxxxxx :xxxxx
37- .xxxxx ;xx. ... xxxxx.
38- xxxxx+ :xxxxxxxx +xxxxx
39- .xxxxx. :xxxxxxxxxx .xxxxx.
40- :xxxxx+ xxxxxxxxxxx ;xxxxx:
41- :xxxxxx xxxxxxxxxx xxxxxx:
42- xxxxxxx xxxxxxx; xxxxxxx
43- xxxxxxxx. .xxxxxxxx
44- xxxxxxxxxx xxxxxxxxxx
45- ;xxxxxxxxxxxxxxxxxxxxxxxxxxxx+
46- ;xxxxxxxxxxxxxxxxxxxxxx;
47- .xxxxxxxxxxxxxx.
21+ *******
22+ ***************
23+ *** ***
24+ *** *** ***
25+ *** ***** ***
26+ *** *** ***
27+ *** *** ***
28+ *** ***** ***
29+ *** *** *** ***
30+ *** ***** ***
31+ *** *** ***
32+ *** ***
33+ ***************
34+ *******
4835"""
4936
37+ PLONE_LOGOTYPE_BANNER = """
38+ *******
39+ ***************
40+ *** *** ********* *** ***
41+ *** *** *** *********** *** * R *
42+ *** ***** *** *** *** *** ***
43+ *** *** *** *** *** *** **** *** *** ****
44+ *** *** *** *** *** *** ******** ********* ********
45+ *** ***** *** *********** *** *** *** **** *** *** ***
46+ *** *** *** *** ********* *** *** *** *** *** **********
47+ *** ***** *** *** *** *** *** *** *** *********
48+ *** *** *** *** **** *** *** *** *** *** ...
49+ *** *** *** ***** ******** *** *** ********
50+ *************** *** *** **** *** *** ****
51+ *******
52+ """
53+
54+
55+ def choose_banner () -> str :
56+ """Based on the terminal width, decide which banner to use."""
57+ banner = BANNER
58+ try :
59+ terminal_size = os .get_terminal_size ()
60+ except OSError :
61+ return banner
62+ if terminal_size and terminal_size .columns >= 90 :
63+ banner = PLONE_LOGOTYPE_BANNER
64+ return banner
65+
5066
5167def _print (msg : str ):
5268 """Wrapper around rich.print."""
@@ -72,7 +88,8 @@ def print_plone_banner():
7288 """Print Plone banner."""
7389 style : str = "bold"
7490 color : str = "blue"
75- print (BANNER , style , color )
91+ banner = choose_banner ()
92+ print (banner , style , color )
7693
7794
7895def info (msg : str ):
@@ -142,8 +159,9 @@ def table_available_templates(
142159
143160
144161def welcome_screen (templates : list [t .CookieploneTemplate ] | None = None ):
162+ banner = choose_banner ()
145163 items = [
146- Align .center (f"[bold blue]{ BANNER } [/bold blue]" ),
164+ Align .center (f"[bold blue]{ banner } [/bold blue]" ),
147165 ]
148166 if templates :
149167 items .append (
0 commit comments