pyserv.settings module

Pyserv default settings for server and daemon modes.

pyserv.settings.get_user_iface(pref=('e', 'E'))[source]

Get the active network interface name if possible (not loopback). Use pref to provide a name hint if the default device match is not correct, for example ‘eth2’ or ‘wl’.

Parameters:

pref (string or tuple of strings) – short prefix hint for interface name

Returns:

network interface name or empty string

pyserv.settings.get_user_iface_addr(pref=('e', 'E'))[source]

Get the active network interface addr if possible (not loopback). Use pref to provide a name hint if the default device match is not correct, for example ‘eth2’ or ‘wl’.

Parameters:

pref – short prefix hint for interface name

Returns:

network interface addr or empty string

pyserv.settings.get_user_iface_mask(pref=('e', 'E'))[source]

Get the active network interface mask if possible (not loopback). Use pref to provide a name hint if the default device match is not correct, for example ‘eth2’ or ‘wl’.

Parameters:

pref – short prefix hint for interface name

Returns:

network interface mask or empty string

pyserv.settings.get_userdirs()[source]

Get platform-agnostic user directory paths via PlatformDirs.

Return tuple:

logdir, piddir, docdir as Path objs

pyserv.settings.init_dirs(dirs)[source]

Check and create user dirs for logs and PID (doc root is assumed to already exist).

Parameters:

dirs – list of Path objs

pyserv.settings.platform_check()[source]

Check to see if we think we are POSIX.

Return we_are_posix:

true if system is posix

Return type:

bool

pyserv.settings.show_uservars()[source]

Display defaults and (possibly) overridden host paths and environment variables.