1
0
mirror of https://github.com/wting/autojump synced 2026-03-02 03:49:26 +00:00

Merge branch 'contrib/xdg-base-directory' of git://git.ortolo.eu/pkg-autojump into tanguy

Conflicts:

	autojump.bash
	jumpapplet

This should correctly merge Tanguy's XDG changes (thanks!) into the new
codebase.
This commit is contained in:
Joël Schaerer
2011-08-26 15:59:02 +02:00
4 changed files with 45 additions and 19 deletions

View File

@@ -34,7 +34,11 @@ import os
MAX_KEYWEIGHT = 1000
MAX_STORED_PATHS = 600
COMPLETION_SEPARATOR = '__'
CONFIG_DIR = os.environ.get("AUTOJUMP_DATA_DIR", os.path.expanduser("~"))
if "AUTOJUMP_DATA_DIR" in os.environ:
CONFIG_DIR = os.environ.get("AUTOJUMP_DATA_DIR")
else:
xdg_data_dir = os.environ.get('XDG_DATA_HOME') or os.path.join(os.environ['HOME'], '.local', 'share')
CONFIG_DIR=os.path.join(xdg_data_dir, 'autojump')
def uniqadd(collection, key):
"""Adds a key to a list only if it is not already present"""