@@ -67,7 +67,8 @@ def create_engine(engine_config: Configuration, game: model.Game | None = None)
6767 f" Invalid engine type: { engine_type } . Expected xboard, uci, or homemade." )
6868 options = remove_managed_options (cfg .lookup (f"{ engine_type } _options" ) or Configuration ({}))
6969 logger .debug (f"Starting engine: { commands } " )
70- return Engine (commands , options , stderr , cfg .draw_or_resign , game , cwd = cfg .working_dir )
70+ return Engine (commands , options , stderr , cfg .draw_or_resign , game , cfg .debug ,
71+ cwd = cfg .working_dir )
7172
7273
7374def remove_managed_options (config : Configuration ) -> OPTIONS_GO_EGTB_TYPE :
@@ -478,7 +479,8 @@ class UCIEngine(EngineWrapper):
478479 """The class used to communicate with UCI engines."""
479480
480481 def __init__ (self , commands : COMMANDS_TYPE , options : OPTIONS_GO_EGTB_TYPE , stderr : int | None ,
481- draw_or_resign : Configuration , game : model .Game | None , ** popen_args : str ) -> None :
482+ draw_or_resign : Configuration , game : model .Game | None , debug : bool ,
483+ ** popen_args : str ) -> None :
482484 """
483485 Communicate with UCI engines.
484486
@@ -487,10 +489,11 @@ def __init__(self, commands: COMMANDS_TYPE, options: OPTIONS_GO_EGTB_TYPE, stder
487489 :param stderr: Whether we should silence the stderr.
488490 :param draw_or_resign: Options on whether the bot should resign or offer draws.
489491 :param game: The first Game message from the game stream.
492+ :param debug: Whether to debug or not.
490493 :param popen_args: The cwd of the engine.
491494 """
492495 super ().__init__ (options , draw_or_resign )
493- self .engine = chess .engine .SimpleEngine .popen_uci (commands , timeout = 60. , debug = False , setpgrp = True , stderr = stderr ,
496+ self .engine = chess .engine .SimpleEngine .popen_uci (commands , timeout = 60. , debug = debug , setpgrp = True , stderr = stderr ,
494497 ** popen_args )
495498 self .configure (options , game )
496499
@@ -499,7 +502,8 @@ class XBoardEngine(EngineWrapper):
499502 """The class used to communicate with XBoard engines."""
500503
501504 def __init__ (self , commands : COMMANDS_TYPE , options : OPTIONS_GO_EGTB_TYPE , stderr : int | None ,
502- draw_or_resign : Configuration , game : model .Game | None , ** popen_args : str ) -> None :
505+ draw_or_resign : Configuration , game : model .Game | None , debug : bool ,
506+ ** popen_args : str ) -> None :
503507 """
504508 Communicate with XBoard engines.
505509
@@ -508,10 +512,11 @@ def __init__(self, commands: COMMANDS_TYPE, options: OPTIONS_GO_EGTB_TYPE, stder
508512 :param stderr: Whether we should silence the stderr.
509513 :param draw_or_resign: Options on whether the bot should resign or offer draws.
510514 :param game: The first Game message from the game stream.
515+ :param debug: Whether to debug or not.
511516 :param popen_args: The cwd of the engine.
512517 """
513518 super ().__init__ (options , draw_or_resign )
514- self .engine = chess .engine .SimpleEngine .popen_xboard (commands , timeout = 60. , debug = False , setpgrp = True ,
519+ self .engine = chess .engine .SimpleEngine .popen_xboard (commands , timeout = 60. , debug = debug , setpgrp = True ,
515520 stderr = stderr , ** popen_args )
516521 egt_paths = cast (EGTPATH_TYPE , options .pop ("egtpath" , {}) or {})
517522 protocol = cast (chess .engine .XBoardProtocol , self .engine .protocol )
@@ -539,7 +544,7 @@ class MinimalEngine(EngineWrapper):
539544 """
540545
541546 def __init__ (self , commands : COMMANDS_TYPE , options : OPTIONS_GO_EGTB_TYPE , stderr : int | None , # noqa: ARG002
542- draw_or_resign : Configuration , game : model .Game | None = None , name : str | None = None , # noqa: ARG002
547+ draw_or_resign : Configuration , game : model .Game | None , debug : bool , # noqa: ARG002
543548 ** popen_args : str ) -> None : # noqa: ARG002 Unused argument popen_args
544549 """
545550 Initialize the values of the engine that all homemade engines inherit.
@@ -548,9 +553,7 @@ def __init__(self, commands: COMMANDS_TYPE, options: OPTIONS_GO_EGTB_TYPE, stder
548553 :param draw_or_resign: Options on whether the bot should resign or offer draws.
549554 """
550555 super ().__init__ (options , draw_or_resign )
551-
552- self .engine_name = self .__class__ .__name__ if name is None else name
553-
556+ self .engine_name = self .__class__ .__name__
554557 self .engine = FillerEngine (self , name = self .engine_name )
555558
556559 def get_pid (self ) -> str :
0 commit comments