@@ -238,8 +238,8 @@ def apply_configuration(
238
238
reattach = True
239
239
break
240
240
if run .status .is_finished ():
241
- _print_finished_message (run )
242
- exit (_get_run_exit_code (run ))
241
+ print_finished_message (run )
242
+ exit (get_run_exit_code (run ))
243
243
time .sleep (1 )
244
244
if not reattach :
245
245
console .print (
@@ -439,7 +439,7 @@ def apply_args(
439
439
):
440
440
super ().apply_args (conf , args , unknown )
441
441
if args .ports :
442
- conf .ports = list (merge_ports (conf .ports , args .ports ).values ())
442
+ conf .ports = list (_merge_ports (conf .ports , args .ports ).values ())
443
443
444
444
445
445
class TaskConfigurator (RunWithPortsConfigurator ):
@@ -475,17 +475,17 @@ def apply_args(self, conf: ServiceConfiguration, args: argparse.Namespace, unkno
475
475
self .interpolate_run_args (conf .commands , unknown )
476
476
477
477
478
- def merge_ports (conf : List [PortMapping ], args : List [PortMapping ]) -> Dict [int , PortMapping ]:
479
- unique_ports_constraint ([pm .container_port for pm in conf ])
480
- unique_ports_constraint ([pm .container_port for pm in args ])
478
+ def _merge_ports (conf : List [PortMapping ], args : List [PortMapping ]) -> Dict [int , PortMapping ]:
479
+ _unique_ports_constraint ([pm .container_port for pm in conf ])
480
+ _unique_ports_constraint ([pm .container_port for pm in args ])
481
481
ports = {pm .container_port : pm for pm in conf }
482
482
for pm in args : # override conf
483
483
ports [pm .container_port ] = pm
484
- unique_ports_constraint ([pm .local_port for pm in ports .values () if pm .local_port is not None ])
484
+ _unique_ports_constraint ([pm .local_port for pm in ports .values () if pm .local_port is not None ])
485
485
return ports
486
486
487
487
488
- def unique_ports_constraint (ports : List [int ]):
488
+ def _unique_ports_constraint (ports : List [int ]):
489
489
used_ports = set ()
490
490
for i in ports :
491
491
if i in used_ports :
@@ -514,7 +514,7 @@ def _print_service_urls(run: Run) -> None:
514
514
console .print ()
515
515
516
516
517
- def _print_finished_message (run : Run ):
517
+ def print_finished_message (run : Run ):
518
518
if run .status == RunStatus .DONE :
519
519
console .print ("[code]Done[/]" )
520
520
return
@@ -542,7 +542,7 @@ def _print_finished_message(run: Run):
542
542
console .print (f"[error]{ message } [/]" )
543
543
544
544
545
- def _get_run_exit_code (run : Run ) -> int :
545
+ def get_run_exit_code (run : Run ) -> int :
546
546
if run .status == RunStatus .DONE :
547
547
return 0
548
548
return 1
0 commit comments