Skip to content

Follow the XDG Base Directory Specification #164

Description

@hakan-demirli

There is XDG Base Directory Specification which dictates which files should go where.

According to that user data should go to $XDG_DATA_HOME on linux.

history_filename = ".mitype_history.csv"

Without adding extra pip dependency:

from sys import platform
if platform == "linux" or platform == "linux2":
    XDG_DATA_HOME = os.environ.get('XDG_DATA_HOME', os.path.expanduser("~/.local/share"))
    user_data_file = XDG_DATA_HOME + "/.mitype_history.csv"
    return os.path.expanduser(user_data_file)
else:
    # as usual for windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions