@@ -76,11 +76,10 @@ async def info(cls) -> None:
7676 @classmethod
7777 async def start (cls ) -> None :
7878 """Create and/or start an exegol container to finally spawn an interactive shell"""
79- logger .info ("Starting exegol" )
8079 # Check if the first positional parameter have been supplied
8180 cls .__interactive_mode = not bool (ParametersManager ().containertag )
8281 if not cls .__interactive_mode :
83- logger .info ("Arguments supplied with the command, skipping interactive mode" )
82+ logger .info ("Skipping interactive mode (arguments supplied) " )
8483 container = await cls .__loadOrCreateContainer ()
8584 assert container is not None and type (container ) is ExegolContainer
8685 if not container .isNew ():
@@ -113,7 +112,6 @@ async def upgrade(cls) -> None:
113112 async def exec (cls ) -> None :
114113 """Create and/or start an exegol container to execute a specific command.
115114 The execution can be seen in console output or be relayed in the background as a daemon."""
116- logger .info ("Starting exegol" )
117115 if ParametersManager ().tmp :
118116 container = await cls .__createTmpContainer (ParametersManager ().selector )
119117 if not ParametersManager ().daemon :
@@ -129,7 +127,7 @@ async def exec(cls) -> None:
129127 @classmethod
130128 async def stop (cls ) -> None :
131129 """Stop an exegol container"""
132- logger .info ("Stopping exegol " )
130+ logger .info ("Stopping container(s) " )
133131 container = await cls .__loadOrCreateContainer (multiple = True , must_exist = True , filters = [ExegolContainer .Filters .STARTED ])
134132 assert container is not None and type (container ) is list
135133 for c in container :
@@ -165,7 +163,7 @@ async def build(cls) -> None:
165163 async def update (cls ) -> None :
166164 """Update python wrapper (git installation required) and Pull a docker exegol image"""
167165 if ParametersManager ().offline_mode :
168- logger .critical ("It's not possible to update Exegol in offline mode. Please retry later with an internet connection ." )
166+ logger .critical ("Exegol cannot be updated without Internet access. Skipping ." )
169167 if not ParametersManager ().skip_git :
170168 await UpdateManager .updateWrapper ()
171169 await UpdateManager .updateResources ()
@@ -175,7 +173,7 @@ async def update(cls) -> None:
175173 @classmethod
176174 async def uninstall (cls ) -> None :
177175 """Remove an exegol image"""
178- logger .info ("Uninstalling an exegol image" )
176+ logger .info ("Uninstalling image" )
179177 # Set log level to verbose in order to show every image installed including the outdated.
180178 if not logger .isEnabledFor (ExeLog .VERBOSE ):
181179 logger .setLevel (ExeLog .VERBOSE )
@@ -195,7 +193,7 @@ async def uninstall(cls) -> None:
195193 @classmethod
196194 async def remove (cls ) -> None :
197195 """Remove an exegol container"""
198- logger .info ("Removing an exegol container" )
196+ logger .info ("Removing container(s) " )
199197 containers = await cls .__loadOrCreateContainer (multiple = True , must_exist = True )
200198 assert type (containers ) is list
201199 if len (containers ) == 0 :
@@ -335,7 +333,7 @@ async def __loadOrInstallImage(cls,
335333 else :
336334 # Interactive (TUI) image selection
337335 image_selection = cast (Union [Optional [ExegolImage ], List [ExegolImage ]],
338- await cls .__interactiveSelection (ExegolImage , image_list , multiple , must_exist ))
336+ await cls .__interactiveSelection (ExegolImage , image_list , multiple ))
339337 else :
340338 # Select image by tag name (non-interactive)
341339 if multiple :
@@ -463,7 +461,7 @@ async def __loadOrCreateContainer(cls,
463461 else :
464462 # Interactive container selection
465463 cls .__container = cast (Union [Optional [ExegolContainer ], List [ExegolContainer ]],
466- await cls .__interactiveSelection (ExegolContainer , container_list , multiple , must_exist ))
464+ await cls .__interactiveSelection (ExegolContainer , container_list , multiple ))
467465 else :
468466 # Try to find the corresponding container
469467 if multiple :
@@ -491,9 +489,9 @@ async def __loadOrCreateContainer(cls,
491489 # Create container
492490 if must_exist :
493491 if container_tag is not None :
494- logger .warning (f"The container named '{ container_tag } ' has not been found" )
492+ logger .warning (f"Container '{ container_tag } ' has not been found" )
495493 return [] if multiple else None
496- logger .info (f"Creating new container named '{ container_tag } '" )
494+ logger .info (f"Creating new container '{ container_tag } '" )
497495 return await cls .__createContainer (container_tag )
498496 assert cls .__container is not None
499497 return cast (Union [Optional [ExegolContainer ], List [ExegolContainer ]], cls .__container )
@@ -502,16 +500,15 @@ async def __loadOrCreateContainer(cls,
502500 async def __interactiveSelection (cls ,
503501 object_type : Type [Union [ExegolImage , ExegolContainer ]],
504502 object_list : Sequence [SelectableInterface ],
505- multiple : bool = False ,
506- must_exist : bool = False ) -> \
503+ multiple : bool = False ) -> \
507504 Union [Optional [ExegolImage ], Optional [ExegolContainer ], Sequence [ExegolImage ], Sequence [ExegolContainer ]]:
508505 """Interactive object selection process, depending on object_type.
509506 object_type can be ExegolImage or ExegolContainer."""
510- user_selection : Union [SelectableInterface , Sequence [SelectableInterface ], str ]
507+ user_selection : Union [SelectableInterface , Sequence [SelectableInterface ], Sequence [ str ], str ]
511508 if multiple :
512509 user_selection = await ExegolTUI .multipleSelectFromTable (object_list , object_type = object_type )
513510 else :
514- user_selection = await ExegolTUI .selectFromTable (object_list , object_type = object_type , allow_None = object_type is ExegolContainer )
511+ user_selection = await ExegolTUI .selectFromTable (object_list , object_type = object_type , allow_none = object_type is ExegolContainer )
515512 # Check if the user has chosen an existing object
516513 if type (user_selection ) is str :
517514 # Otherwise, create a new object with the supplied name
@@ -523,19 +520,19 @@ async def __interactiveSelection(cls,
523520 async def __createContainer (cls , name : Optional [str ]) -> ExegolContainer :
524521 """Create an ExegolContainer"""
525522 if name is None :
526- name = await ExegolRich .Ask ("Enter the name of your new exegol container" , default = "default" )
523+ name = await ExegolRich .Ask ("Enter new container name " , default = "default" )
527524 logger .verbose ("Configuring new exegol container" )
528525 # Create exegol config
529526 image : Optional [ExegolImage ] = cast (ExegolImage , await cls .__loadOrInstallImage (show_custom = True ))
530527 assert image is not None # load or install return an image
531528 if name is None :
532- name = await ExegolRich .Ask ("Enter the name of your new exegol container" , default = "default" )
529+ name = await ExegolRich .Ask ("Enter new container name " , default = "default" )
533530 model = await ExegolContainerTemplate .newContainer (name , image , hostname = ParametersManager ().hostname )
534531
535532 # Recap
536533 await ExegolTUI .printContainerRecap (model )
537534 if cls .__interactive_mode :
538- if not model .image .isUpToDate () and \
535+ if not model .image .isUpToDate () and "Unknown" not in model . image . getStatus () and \
539536 await ExegolRich .Confirm ("Do you want to [green]update[/green] the selected image?" , False ):
540537 image = await UpdateManager .updateImage (model .image .getName ())
541538 if image is not None :
0 commit comments