Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Follow the XDG Base Directory Specification #164

Open
hakan-demirli opened this issue Apr 30, 2024 · 1 comment
Open

Follow the XDG Base Directory Specification #164

hakan-demirli opened this issue Apr 30, 2024 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@hakan-demirli
Copy link

hakan-demirli commented Apr 30, 2024

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
@hakan-demirli hakan-demirli added the enhancement New feature or request label Apr 30, 2024
Copy link

welcome bot commented Apr 30, 2024

Thank you for opening your first issue in this project!
A contributor should be by to give feedback soon. In the meantime, please check out the contributing guidelines.

@Mithil467 Mithil467 added the good first issue Good for newcomers label May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants