Skip to content

Commit

Permalink
fixed "verbose" argument (#6289)
Browse files Browse the repository at this point in the history
Signed-off-by: bigcat88 <[email protected]>
  • Loading branch information
bigcat88 authored Dec 31, 2024
1 parent b7572b2 commit 02eef72
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,9 @@ async def run(server_instance, address='', port=8188, verbose=True, call_on_star
addresses = []
for addr in address.split(","):
addresses.append((addr, port))
await asyncio.gather(server_instance.start_multi_address(addresses, call_on_start), server_instance.publish_loop())
await asyncio.gather(
server_instance.start_multi_address(addresses, call_on_start, verbose), server_instance.publish_loop()
)


def hijack_progress(server_instance):
Expand Down
8 changes: 5 additions & 3 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ async def publish_loop(self):
async def start(self, address, port, verbose=True, call_on_start=None):
await self.start_multi_address([(address, port)], call_on_start=call_on_start)

async def start_multi_address(self, addresses, call_on_start=None):
async def start_multi_address(self, addresses, call_on_start=None, verbose=True):
runner = web.AppRunner(self.app, access_log=None)
await runner.setup()
ssl_ctx = None
Expand All @@ -818,7 +818,8 @@ async def start_multi_address(self, addresses, call_on_start=None):
keyfile=args.tls_keyfile)
scheme = "https"

logging.info("Starting server\n")
if verbose:
logging.info("Starting server\n")
for addr in addresses:
address = addr[0]
port = addr[1]
Expand All @@ -834,7 +835,8 @@ async def start_multi_address(self, addresses, call_on_start=None):
else:
address_print = address

logging.info("To see the GUI go to: {}://{}:{}".format(scheme, address_print, port))
if verbose:
logging.info("To see the GUI go to: {}://{}:{}".format(scheme, address_print, port))

if call_on_start is not None:
call_on_start(scheme, self.address, self.port)
Expand Down

0 comments on commit 02eef72

Please sign in to comment.