Skip to content

Use platform specific directories #45

@jtojnar

Description

@jtojnar

On Linux XDG basedir specification should be followed. That means the database should be stored in data_dir:

if 'XDG_DATA_HOME' in os.environ:
    data_dir = os.path.join(os.environ['XDG_DATA_HOME'], 'cum')
else:
    data_dir = os.path.join(os.environ['HOME'], '.local', 'share', 'cum')

And the configuration file in config_dir:

if 'XDG_CONFIG_HOME' in os.environ:
    config_dir = os.path.join(os.environ['XDG_CONFIG_HOME'], 'cum')
else:
    config_dir = os.path.join(os.environ['HOME'], '.config', 'cum')

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions