pyfemtet.dispatch_extensions package

Module contents

exception pyfemtet.dispatch_extensions.DispatchExtensionException[source]

Bases: Exception

pyfemtet.dispatch_extensions.dispatch_femtet(timeout=120, subprocess_log_prefix='')[source]

Connect to existing Femtet process.

The wrapper for Dispatch() but returns PID with IFemtet.

Parameters:
  • timeout (int, optional) – Raises an error if the connection is not established within the specified timeout.

  • subprocess_log_prefix (str, optional) – A prefix to output in logs. Typically used only for internal processing.

Raises:

FemtetConnectionTimeoutError – Couldn’t connect Femtet process for some reason (i.e. Femtet.exe is not launched).

Returns:

An object for controlling Femtet and the PID of the Femtet being controlled.

Return type:

tuple[IFemtet, int]

pyfemtet.dispatch_extensions.dispatch_specific_femtet(pid, timeout=120)[source]
Return type:

tuple[CDispatch, int]

pyfemtet.dispatch_extensions.launch_and_dispatch_femtet(timeout=120, strictly_pid_specify=True)[source]

Launch Femtet by new process and connect to it.

The wrapper for Dispatch() but returns PID with IFemtet.

Parameters:
  • timeout (int, optional) – Raises an error if the connection is not established within the specified timeout.

  • strictly_pid_specify (bool, optional) – Attempts to establish a connection to the launched Femtet strictly. This may result in slower processing due to process exclusivity handling.

Raises:

FemtetConnectionTimeoutError – Couldn’t connect Femtet process for some reason (i.e. Femtet.exe is not launched).

Returns:

An object for controlling Femtet and the PID of the Femtet being controlled.

Return type:

tuple[IFemtet, int]