From f2ed31557927f5dafbd2e980e39e19c017218d54 Mon Sep 17 00:00:00 2001 From: Fernando Schauenburg Date: Tue, 15 Dec 2020 23:46:14 +0100 Subject: [PATCH] python: move .cache/python/history -> .local/share/python/history --- roles/python/files/startup.py | 6 +++--- roles/python/tasks/main.yml | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/roles/python/files/startup.py b/roles/python/files/startup.py index bb3e542..52ffcd8 100644 --- a/roles/python/files/startup.py +++ b/roles/python/files/startup.py @@ -5,7 +5,7 @@ # 1. Set the Tab key as completion key. # 2. Initialize readline (e.g. from .inputrc). # 3. Register a history file, using: -# - $XDG_CACHE_HOME/python/history if XDG_CACHE_HOME iset +# - $XDG_DATA_HOME/python/history if XDG_DATA_HOME iset # - .python_history otherwise. def configure_readline(): import atexit @@ -42,8 +42,8 @@ def configure_readline(): # http://bugs.python.org/issue5845#msg198636 history = os.path.join(os.path.expanduser('~'), '.python_history') - if 'XDG_CACHE_HOME' in os.environ: - history = os.path.join(os.environ['XDG_CACHE_HOME'], 'python', 'history') + if 'XDG_DATA_HOME' in os.environ: + history = os.path.join(os.environ['XDG_DATA_HOME'], 'python', 'history') try: readline.read_history_file(history) diff --git a/roles/python/tasks/main.yml b/roles/python/tasks/main.yml index d4ff36f..bff08fe 100644 --- a/roles/python/tasks/main.yml +++ b/roles/python/tasks/main.yml @@ -8,13 +8,13 @@ when: ansible_os_family == "Darwin" homebrew: name=python3 state=latest -- name: Create the python config and cache directories +- name: Create the python config and data directories file: - path: "~/.{{ item }}/python" + path: "{{ item }}" state: directory loop: - - cache - - config + - ~/.config/python + - ~/.local/share/python - name: Deploy python startup file file: