@@ -643,21 +643,18 @@ def digest_parser(self, parser: configparser.ConfigParser) -> Self:
643643 gui_location = tuple (
644644 map (int , re .split (r"[;,\-]" , parser ["CLI" ]["gui_location" ])),
645645 )
646- setattr ( self , " gui_location" , gui_location )
646+ self . gui_location = gui_location
647647
648648 window_size = parser ["CLI" ][
649649 "window_size"
650650 ] # if not "default", get a tuple of the position
651651 if window_size != "default" :
652652 window_size = tuple (map (int , re .split (r"[;,\-]" , window_size )))
653- setattr ( self , " window_size" , window_size )
653+ self . window_size = window_size
654654
655655 # plugins
656656 plugins = parser ["CLI" ].get ("plugins" , fallback = "" , raw = True )
657- if plugins == "" :
658- plugins = []
659- else :
660- plugins = plugins .split ("," )
657+ plugins = [] if plugins == "" else plugins .split ("," )
661658 self .plugins = plugins
662659 # the next two must be set AFTER digesting pixel_width and pixel_height
663660 self ["frame_height" ] = parser ["CLI" ].getfloat ("frame_height" , 8.0 )
@@ -674,7 +671,7 @@ def digest_parser(self, parser: configparser.ConfigParser) -> Self:
674671
675672 val = parser ["CLI" ].get ("progress_bar" )
676673 if val :
677- setattr ( self , " progress_bar" , val )
674+ self . progress_bar = val
678675
679676 val = parser ["ffmpeg" ].get ("loglevel" )
680677 if val :
@@ -684,11 +681,11 @@ def digest_parser(self, parser: configparser.ConfigParser) -> Self:
684681 val = parser ["jupyter" ].getboolean ("media_embed" )
685682 except ValueError :
686683 val = None
687- setattr ( self , " media_embed" , val )
684+ self . media_embed = val
688685
689686 val = parser ["jupyter" ].get ("media_width" )
690687 if val :
691- setattr ( self , " media_width" , val )
688+ self . media_width = val
692689
693690 val = parser ["CLI" ].get ("quality" , fallback = "" , raw = True )
694691 if val :
@@ -839,15 +836,12 @@ def digest_args(self, args: argparse.Namespace) -> Self:
839836 if args .tex_template :
840837 self .tex_template = TexTemplate .from_file (args .tex_template )
841838
842- if (
843- self .renderer == RendererType .OPENGL
844- and getattr (args , "write_to_movie" ) is None
845- ):
839+ if self .renderer == RendererType .OPENGL and args .write_to_movie is None :
846840 # --write_to_movie was not passed on the command line, so don't generate video.
847841 self ["write_to_movie" ] = False
848842
849843 # Handle --gui_location flag.
850- if getattr ( args , " gui_location" ) is not None :
844+ if args . gui_location is not None :
851845 self .gui_location = args .gui_location
852846
853847 return self
0 commit comments