pymap.sockets

class pymap.sockets.InheritedSockets[source]

Abstracts the ability to retrieve inherited sockets from the calling process, usually a service management framework.

abstract get()[source]

Return the sockets inherited by the process.

Return type:

Sequence[socket]

classmethod supports(service_manager)[source]

Return True if the given service manager is supported. This does not guarantee the service manager will provide inherited sockets, only that it is available to of().

Parameters:

service_manager (str) – The service manager name.

Return type:

bool

classmethod of(service_manager)[source]

Return the inherited sockets for the given service manager.

Note

Only 'systemd' is implemented at this time.

Parameters:

service_manager (str) – The service manager name.

Return type:

InheritedSockets

classmethod for_systemd()[source]

Return the inherited sockets for systemd. The python-systemd library must be installed.

Raises:

NotImplementedError

Return type:

InheritedSockets