Skip to content

Commit e837b65

Browse files
committed
update print_banner
Signed-off-by: shaangill025 <gill.shaanjots@gmail.com>
1 parent c3a82d2 commit e837b65

1 file changed

Lines changed: 32 additions & 26 deletions

File tree

aries_cloudagent/config/logging.py

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -113,47 +113,53 @@ def print_banner(
113113

114114
# Inbound transports
115115
banner.print_subtitle("Inbound Transports")
116-
banner.print_spacer()
117-
banner.print_list(
118-
[
119-
f"{transport.scheme}://{transport.host}:{transport.port}"
120-
for transport in inbound_transports.values()
121-
]
122-
)
123-
banner.print_spacer()
124-
125-
external_in_transports = set().union(
126-
*(
127-
transport
128-
for transport in inbound_transports.values()
129-
if transport.is_external
130-
)
131-
)
116+
internal_in_transports = [
117+
f"{transport.scheme}://{transport.host}:{transport.port}"
118+
for transport in inbound_transports.values()
119+
if not transport.is_external
120+
]
121+
if internal_in_transports:
122+
banner.print_spacer()
123+
banner.print_list(internal_in_transports)
124+
banner.print_spacer()
125+
external_in_transports = [
126+
f"{transport.scheme}://{transport.host}:{transport.port}"
127+
for transport in inbound_transports.values()
128+
if transport.is_external
129+
]
132130
if external_in_transports:
133131
banner.print_spacer()
134-
banner.print_list([f"{external_in_transports}"])
132+
banner.print_subtitle(" External Plugin")
133+
banner.print_spacer()
134+
banner.print_list(external_in_transports)
135135
banner.print_spacer()
136136

137137
# Outbound transports
138-
schemes = set().union(
139-
*(transport.schemes for transport in outbound_transports.values())
138+
banner.print_subtitle("Outbound Transports")
139+
internal_schemes = set().union(
140+
*(
141+
transport.schemes
142+
for transport in outbound_transports.values()
143+
if not transport.is_external
144+
)
140145
)
141-
if schemes:
142-
banner.print_subtitle("Outbound Transports")
146+
if internal_schemes:
143147
banner.print_spacer()
144-
banner.print_list([f"{scheme}" for scheme in sorted(schemes)])
148+
banner.print_list([f"{scheme}" for scheme in sorted(internal_schemes)])
145149
banner.print_spacer()
146150

147-
external_out_transports = set().union(
151+
external_schemes = set().union(
148152
*(
149-
transport
153+
transport.schemes
150154
for transport in outbound_transports.values()
151155
if transport.is_external
152156
)
153157
)
154-
if external_out_transports:
158+
if external_schemes:
159+
banner.print_spacer()
160+
banner.print_subtitle(" External Plugin")
155161
banner.print_spacer()
156-
banner.print_list([f"{external_out_transports}"])
162+
banner.print_list([f"{scheme}" for scheme in sorted(external_schemes)])
157163
banner.print_spacer()
158164

159165
# DID info

0 commit comments

Comments
 (0)