@@ -601,14 +601,24 @@ def _omc_port_get(self) -> str:
601601
602602class OMCProcessDockerHelper (OMCProcess ):
603603
604- def __init__ (self , ** kwargs ) -> None :
605- super ().__init__ (** kwargs )
604+ def __init__ (
605+ self ,
606+ timeout : float = 10.00 ,
607+ dockerExtraArgs : Optional [list ] = None ,
608+ dockerOpenModelicaPath : str = "omc" ,
609+ dockerNetwork : Optional [str ] = None ,
610+ port : Optional [int ] = None ,
611+ ) -> None :
612+ super ().__init__ (timeout = timeout )
606613
607- self ._dockerExtraArgs : list = []
608- self ._dockerOpenModelicaPath : Optional [str ] = None
609- self ._dockerNetwork : Optional [str ] = None
614+ if dockerExtraArgs is None :
615+ dockerExtraArgs = []
616+
617+ self ._dockerExtraArgs = dockerExtraArgs
618+ self ._dockerOpenModelicaPath = dockerOpenModelicaPath
619+ self ._dockerNetwork = dockerNetwork
610620
611- self ._interactivePort : Optional [ int ] = None
621+ self ._interactivePort = port
612622
613623 self ._dockerCid : Optional [str ] = None
614624 self ._docker_process : Optional [DummyPopen ] = None
@@ -707,22 +717,19 @@ def __init__(
707717 port : Optional [int ] = None ,
708718 ) -> None :
709719
710- super ().__init__ (timeout = timeout )
720+ super ().__init__ (
721+ timeout = timeout ,
722+ dockerExtraArgs = dockerExtraArgs ,
723+ dockerOpenModelicaPath = dockerOpenModelicaPath ,
724+ dockerNetwork = dockerNetwork ,
725+ port = port ,
726+ )
711727
712728 if docker is None :
713729 raise OMCSessionException ("Argument docker must be set!" )
714730
715731 self ._docker = docker
716732
717- if dockerExtraArgs is None :
718- dockerExtraArgs = []
719-
720- self ._dockerExtraArgs = dockerExtraArgs
721- self ._dockerOpenModelicaPath = dockerOpenModelicaPath
722- self ._dockerNetwork = dockerNetwork
723-
724- self ._interactivePort = port
725-
726733 # start up omc executable in docker container waiting for the ZMQ connection
727734 self ._omc_process , self ._docker_process , self ._dockerCid = self ._docker_omc_start ()
728735 # connect to the running omc instance using ZMQ
@@ -851,22 +858,19 @@ def __init__(
851858 port : Optional [int ] = None ,
852859 ) -> None :
853860
854- super ().__init__ (timeout = timeout )
861+ super ().__init__ (
862+ timeout = timeout ,
863+ dockerExtraArgs = dockerExtraArgs ,
864+ dockerOpenModelicaPath = dockerOpenModelicaPath ,
865+ dockerNetwork = dockerNetwork ,
866+ port = port ,
867+ )
855868
856869 if not isinstance (dockerContainer , str ):
857870 raise OMCSessionException ("Argument dockerContainer must be set!" )
858871
859872 self ._dockerCid = dockerContainer
860873
861- if dockerExtraArgs is None :
862- dockerExtraArgs = []
863-
864- self ._dockerExtraArgs = dockerExtraArgs
865- self ._dockerOpenModelicaPath = dockerOpenModelicaPath
866- self ._dockerNetwork = dockerNetwork
867-
868- self ._interactivePort = port
869-
870874 # start up omc executable in docker container waiting for the ZMQ connection
871875 self ._omc_process , self ._docker_process = self ._docker_omc_start ()
872876 # connect to the running omc instance using ZMQ
0 commit comments