(
*items: Optional[Union[Text, str]], style: Optional[str] = None
)
| 92 | |
| 93 | |
| 94 | def smart_join( |
| 95 | *items: Optional[Union[Text, str]], style: Optional[str] = None |
| 96 | ) -> Union[Text, str]: |
| 97 | text = Text() |
| 98 | for idx, item in enumerate(items): |
| 99 | if item: |
| 100 | if isinstance(item, Text): |
| 101 | text.append(item) |
| 102 | else: |
| 103 | text.append(item, style=style) |
| 104 | if idx < len(items) - 1: |
| 105 | text.append(", ", style="default") |
| 106 | return text if str(text) != "" else "" |
| 107 | |
| 108 | |
| 109 | def error_and_exit(message: str, status: int = 1): |
no outgoing calls