emsm.core.conf

class emsm.core.conf.ConfigParser(path)[source]

Bases: configparser.ConfigParser

Extends the standard Python configparser.ConfigParser by some useful methods.

Parameters:path (str) – The path to the configuration file. This file is used, when you call read() or write().
epilog()[source]

Returns a comment, which is written at the begin of a configuration file.

path()[source]

Returns the path of the configuration file.

read()[source]

Reads the configuration from path().

remove()[source]

Removes the configuration file from the file system.

write()[source]

Writes the configuration into path().

class emsm.core.conf.MainConfiguration(path)[source]

Bases: emsm.core.conf.ConfigParser

Handles the main.conf configuration file.

This file includes the configuration for the EMSM Application and the plugins.

The EMSM owns the [emsm] section and each plugin has its own section with the plugin name.

[emsm]
user = minecraft
timeout = 0
screenrc =

[backups]
include_server = ...
# ...
epilog()[source]

Returns a comment, which is written at the begin of a configuration file.

class emsm.core.conf.ServerConfiguration(path)[source]

Bases: emsm.core.conf.ConfigParser

Handles the server.conf configuration file, which allows the user to overwrite the default EMSM settings for a server wrapper like the url or the start command.

epilog()[source]

Returns a comment, which is written at the begin of a configuration file.

class emsm.core.conf.WorldConfiguration(path)[source]

Bases: emsm.core.conf.ConfigParser

Handles a configuration file for one world and allows the user to set custom configuration values for each plugin, server and the EMSM.

Parameters:path (str) –
epilog()[source]

Returns a comment, which is written at the begin of a configuration file.

class emsm.core.conf.Configuration(app)[source]

Bases: object

Manages all configuration files of an EMSM application object.

See also

list_worlds()[source]

Returns a list with the names of all worlds, for which a configuration file has been found.

main()[source]

Returns the MainConfiguration.

read()[source]

Reads all configration files.

server()[source]

Returns the ServerConfiguration.

world(name)[source]

Returns the WorldConfiguration for the world with the name name and None, if there is not such a world.

worlds()[source]

Returns a list with all WorldConfiguration objects.

write()[source]

Saves all configuration values.