emsm.core.paths

class emsm.core.paths.Pathsystem(instance_dir)[source]

Bases: object

Manages the paths to the different files and directories of the application.

The EMSM distinguishes two primary folders: The instance folder, where the worlds, server, configuration and plugins of the user are placed. The instance folder can actually be considered to be the working directory of the EMSM. On the other side is the EMSM installation directory. The emsm directory. This directory is usually placed in Python’s third party library folder (site-packages) and contains the EMSM core application and the core plugins.

  1. emsm directory:

    |- emsm
        |- core
            |- lib
                |- ...
            |- __init__.py
            |- application.py
            |- argparse_.py
            |- base_plugin.py
            |- ...
        |- plugins
            |- __init__.py
            |- backups.py
            |- emsm.py
            |- guard.py
            |- ...
        |- __init__.py
    
  2. instance folder:

    |- instance             # usually /opt/minecraft
        |- conf             # the emsm configuration files
            |- main.conf
            |- server.conf
            |- worlds.conf
        |- plugins          # the user's plugins.
            |- __init__.py
            |- myawesomeplugin.py
            |- ...
        |- plugins_data     # data generated or needed by the plugins
            |- backups
            |- emsm
            |- guard
            |- ...
            |- myawesomeplugin
            |- ...
        |- server           # the server executables
            |- minecraft_server.jar
            |- craftbukkit.jar
            |- ...
        |- worlds           # the data of the worlds (minecraft map, ...)
            |- foo
                |- server.properties
                |- ...
            |- bar
                |- server.properties
                |- ...
        |- logs
            |- emsm.log
            |- emsm.log.1
            |- ...
        |- minecraft.py
    
conf()[source]

Contains the configuration files of the EMSM. Not the configuration for the minecraft worlds. These are still located in the world folder.

The directory contains the main.conf, server.conf and worlds.conf file.

The directory is located in the instance folder.

create()[source]

Creates the folders used by the EMSM Application.

This method should only be called, after the EMSM downgraded it’s priviliges.

emsm()[source]

Returns the path to the emsm installation directory. This folder is usually located in Python’s site-packages directory.

emsm_core()[source]

Returns the path to the emsm.core directory.

emsm_plugins()[source]

Returns the path to the emsm.plugins directory. The directory contains the core plugins like worlds, server, backups, …

instance()[source]

The instance folder contains all data generated by the EMSM application and the minecraft worlds.

logs()[source]

Contains the EMSM log files.

Note, that this is NOT the log directory of the minecraft server.

plugin_data(plugin_name)[source]

This directory contains all data of the plugin with the name plugin_name.

The directory is a subfolder of plugins_data().

plugins()[source]

Contains all user plugins and plugin packages.

The directory is located in the instance folder.

See also

emsm_plugins()

plugins_data()[source]

The directory that contains the data generated or used by all plugins.

The directory is located in the instance folder.

See also

plugin_data`()

server()[source]

This directory contains all server executables specified in the server.conf configuration file.

The directory is located in the instance folder.

See also

server_()

server_(server_name)[source]

This directory contains the server software for the server with the name server_name.

The directory is located in the server() folder.

Todo

  • Try to find better names for server and server_. They are hard to distinguish.
world(world_name)[source]

This directory contains the data generated by the minecraft server which powers the world world_name. It contains among others those files:

  • server.properties
  • ops.json
  • whitelist.json

Furthermore, it is a child of worlds().

worlds()[source]

Contains for each world in worlds.conf one folder that contains the data generated by the minecraft server.

The directory is located in the instance folder.

See also

world()