Class ConnectSocket

Configuration class for connecting to LibreOffice via socket. By default no configuration is required.

Lo.ConnectSocket is an alias of this class.

Example:

from ooodev.loader.lo import Lo

loader = Lo.load_office(Lo.ConnectSocket())
class ooodev.conn.connectors.ConnectSocket(host='localhost', port=2002, **kwargs)[source]

Bases: ConnectorBridgeBase

Connect to LO via socket

__init__(host='localhost', port=2002, **kwargs)[source]

Constructor

Parameters:
  • host (str, optional) – Connection host. Defaults to localhost.

  • port (int, optional) – Connection port. Defaults to 2002.

Keyword Arguments:
  • no_restore (bool, optional) – Default True

  • no_first_start_wizard (bool, optional) – Default True

  • no_logo (bool, optional) – Default True

  • invisible (bool, optional) – Default True

  • headless (bool, optional) – Default False

  • start_as_service (bool, optional) – Default False

  • start_office (bool, optional) – Default True

  • soffice (Path | str, optional) – Path to soffice

  • env_vars (Dict[str, str], optional) – Environment variables to be set when starting office

  • extended_args (List[str], optional) – Extended arguments to be passed to soffice, such as ["--display :0"].

  • remote_connection (bool, optional) – Specifies if the connection is to a remote server. Default is False

Return type:

None

get_connection_identifier()[source]

Gets connection identifier

Such as socket,host=localhost,port=2002

Return type:

str

get_connection_str()[source]

Gets connection string.

Such as uno:socket,host=localhost,port=2002;urp;StarOffice.ServiceManager

Return type:

str

property env_vars: Dict[str, str]

Gets/Sets environment variables to be set when starting office

Return type:

Dict[str, str]

property extended_args: List[str]

Extended arguments to be passed to soffice such as [--display : 0]

Return type:

List[str]

property headless: bool

Gets/Sets if the connection is made using headless option. Default is False

Return type:

bool

property host: str

Gets/Sets host. Default localhost

Return type:

str

property invisible: bool

Gets/Sets if office is started with invisible option. Default is True

Return type:

bool

property no_first_start_wizard: bool

Gets/Sets if office is started with nofirststartwizard option. Default is True

Return type:

bool

Gets/Sets if office is started with nologo option. Default is True

Return type:

bool

property no_restore: bool

Gets/Sets if office is started with norestore Option. Default is True

Return type:

bool

property port: int

Gets/Sets port. Default 2002

Return type:

int

property remote_connection: bool

Specifies if the connection is to a remote server. Default is False

Return type:

bool

property soffice: Path

Get/Sets Path to LibreOffice soffice. Default is auto discovered.

Return type:

Path

property start_as_service: bool

Gets/Sets if office is started as service (StarOffice.Service). Default is False

Return type:

bool

property start_office: bool

Gets/Sets if office is to be started. Default is True

Return type:

bool