diff --git a/powerline/__init__.py b/powerline/__init__.py index 1f7b71cc..bc023f61 100644 --- a/powerline/__init__.py +++ b/powerline/__init__.py @@ -8,13 +8,11 @@ import logging from powerline.colorscheme import Colorscheme from powerline.lib.config import ConfigLoader from powerline.lib.unicode import safe_unicode, FailedUnicode +from powerline.config import DEFAULT_SYSTEM_CONFIG_DIR from threading import Lock, Event -DEFAULT_SYSTEM_CONFIG_DIR = None - - def find_config_file(search_paths, config_file): config_file += '.json' for path in search_paths: diff --git a/powerline/bindings/config.py b/powerline/bindings/config.py index 83bab203..16722a98 100644 --- a/powerline/bindings/config.py +++ b/powerline/bindings/config.py @@ -7,6 +7,8 @@ import os import subprocess import re +from powerline.config import TMUX_CONFIG_DIRECTORY + TmuxVersionInfo = namedtuple('TmuxVersionInfo', ('major', 'minor', 'suffix')) @@ -65,7 +67,7 @@ CONFIG_PRIORITY = { def list_all_tmux_configs(): '''List all version-specific tmux configuration files''' - directory = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'tmux') + directory = TMUX_CONFIG_DIRECTORY for root, dirs, files in os.walk(directory): dirs[:] = () for fname in files: diff --git a/powerline/config.py b/powerline/config.py new file mode 100644 index 00000000..53e530f4 --- /dev/null +++ b/powerline/config.py @@ -0,0 +1,8 @@ +# vim:fileencoding=utf-8:noet + +from __future__ import absolute_import, unicode_literals, print_function +import os + +BINDINGS_DIRECTORY = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'bindings') +TMUX_CONFIG_DIRECTORY = os.path.join(BINDINGS_DIRECTORY, 'tmux') +DEFAULT_SYSTEM_CONFIG_DIR = None