1111from pydantic import ValidationError
1212from tqdm import tqdm
1313
14- from .commons import config_path_option
14+ from .commons import config_path_option , verbosity_option
1515from .config import Config , PresentationConfig , SlideConfig , SlideType
1616from .defaults import FOLDER_PATH , FONT_ARGS
17+ from .manim import logger
1718
1819INTERPOLATION_FLAGS = {
1920 "nearest" : cv2 .INTER_NEAREST ,
@@ -450,6 +451,9 @@ def quit(self) -> None:
450451 cv2 .destroyAllWindows ()
451452
452453 if self .record_to is not None and len (self .recordings ) > 0 :
454+ logger .debug (
455+ f"A total of { len (self .recordings )} frames will be saved to { self .record_to } "
456+ )
453457 file , frame_number , fps = self .recordings [0 ]
454458
455459 cap = cv2 .VideoCapture (file )
@@ -489,6 +493,7 @@ def quit(self) -> None:
489493 show_default = True ,
490494)
491495@click .help_option ("-h" , "--help" )
496+ @verbosity_option
492497def list_scenes (folder ) -> None :
493498 """List available scenes."""
494499
@@ -502,13 +507,18 @@ def _list_scenes(folder) -> List[str]:
502507
503508 for file in os .listdir (folder ):
504509 if file .endswith (".json" ):
510+ filepath = os .path .join (folder , file )
505511 try :
506- filepath = os .path .join (folder , file )
507512 _ = PresentationConfig .parse_file (filepath )
508513 scenes .append (os .path .basename (file )[:- 5 ])
509- except Exception : # Could not parse this file as a proper presentation config
514+ except Exception as e : # Could not parse this file as a proper presentation config
515+ logger .warn (
516+ f"Something went wrong with parsing presentation config `{ filepath } `: { e } "
517+ )
510518 pass
511519
520+ logger .info (f"Found { len (scenes )} valid scene configuration files in `{ folder } `." )
521+
512522 return scenes
513523
514524
@@ -552,6 +562,7 @@ def _list_scenes(folder) -> List[str]:
552562 help = "If set, the presentation will be recorded into a AVI video file with given name." ,
553563)
554564@click .help_option ("-h" , "--help" )
565+ @verbosity_option
555566def present (
556567 scenes ,
557568 config_path ,
@@ -616,8 +627,8 @@ def value_proc(value: str) -> List[str]:
616627 f"File { config_file } does not exist, check the scene name and make sure to use Slide as your scene base class"
617628 )
618629 try :
619- config = PresentationConfig .parse_file (config_file )
620- presentations .append (Presentation (config ))
630+ pres_config = PresentationConfig .parse_file (config_file )
631+ presentations .append (Presentation (pres_config ))
621632 except ValidationError as e :
622633 raise click .UsageError (str (e ))
623634
@@ -627,6 +638,7 @@ def value_proc(value: str) -> List[str]:
627638 except ValidationError as e :
628639 raise click .UsageError (str (e ))
629640 else :
641+ logger .info ("No configuration file found, using default configuration." )
630642 config = Config ()
631643
632644 if record_to is not None :
0 commit comments