Merge pull request #903 from ZyX-I/patchable-config

Add patchable file powerline/config.py with system-dependent variables
This commit is contained in:
Nikolai Aleksandrovich Pavlov 2014-06-28 19:30:04 +04:00
commit 71ddacec46
3 changed files with 12 additions and 4 deletions

View File

@ -8,13 +8,11 @@ import logging
from powerline.colorscheme import Colorscheme from powerline.colorscheme import Colorscheme
from powerline.lib.config import ConfigLoader from powerline.lib.config import ConfigLoader
from powerline.lib.unicode import safe_unicode, FailedUnicode from powerline.lib.unicode import safe_unicode, FailedUnicode
from powerline.config import DEFAULT_SYSTEM_CONFIG_DIR
from threading import Lock, Event from threading import Lock, Event
DEFAULT_SYSTEM_CONFIG_DIR = None
def find_config_file(search_paths, config_file): def find_config_file(search_paths, config_file):
config_file += '.json' config_file += '.json'
for path in search_paths: for path in search_paths:

View File

@ -7,6 +7,8 @@ import os
import subprocess import subprocess
import re import re
from powerline.config import TMUX_CONFIG_DIRECTORY
TmuxVersionInfo = namedtuple('TmuxVersionInfo', ('major', 'minor', 'suffix')) TmuxVersionInfo = namedtuple('TmuxVersionInfo', ('major', 'minor', 'suffix'))
@ -65,7 +67,7 @@ CONFIG_PRIORITY = {
def list_all_tmux_configs(): def list_all_tmux_configs():
'''List all version-specific tmux configuration files''' '''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): for root, dirs, files in os.walk(directory):
dirs[:] = () dirs[:] = ()
for fname in files: for fname in files:

8
powerline/config.py Normal file
View File

@ -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