MCPcopy
hub / github.com/pirxthepilot/wtfis / smart_join

Function smart_join

wtfis/utils.py:94–106  ·  view source on GitHub ↗
(
    *items: Optional[Union[Text, str]], style: Optional[str] = None
)

Source from the content-addressed store, hash-verified

92
93
94def 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
109def error_and_exit(message: str, status: int = 1):

Callers 11

test_smart_join_1Method · 0.90
test_smart_join_2Method · 0.90
test_smart_join_3Method · 0.90
resolutions_panelMethod · 0.90
_gen_shodan_servicesMethod · 0.90
_gen_vt_sectionMethod · 0.90
_gen_geoasn_sectionMethod · 0.90
_gen_shodan_sectionMethod · 0.90
_gen_urlhaus_sectionMethod · 0.90
whois_panelMethod · 0.90

Calls

no outgoing calls

Tested by 3

test_smart_join_1Method · 0.72
test_smart_join_2Method · 0.72
test_smart_join_3Method · 0.72