Rename find_config_file to _find_config_file

This commit is contained in:
ZyX 2014-07-10 20:27:24 +04:00
parent c36e14fd3c
commit 289094362e
3 changed files with 6 additions and 6 deletions

View File

@ -13,7 +13,7 @@ from powerline.config import DEFAULT_SYSTEM_CONFIG_DIR
from threading import Lock, Event
def find_config_file(search_paths, config_file):
def _find_config_file(search_paths, config_file):
config_file += '.json'
for path in search_paths:
config_file_path = os.path.join(path, config_file)
@ -158,7 +158,7 @@ class Powerline(object):
self.renderer_module = self.renderer_module[:-1]
config_paths = self.get_config_paths()
self.find_config_file = lambda cfg_path: find_config_file(config_paths, cfg_path)
self.find_config_file = lambda cfg_path: _find_config_file(config_paths, cfg_path)
self.cr_kwargs_lock = Lock()
self.create_renderer_kwargs = {}
@ -483,7 +483,7 @@ class Powerline(object):
pass
functions = tuple(self.cr_callbacks.values())
self.config_loader.unregister_functions(set(functions))
self.config_loader.unregister_missing(set(((find_config_file, function) for function in functions)))
self.config_loader.unregister_missing(set(((self.find_config_file, function) for function in functions)))
def __enter__(self):
return self

View File

@ -1,7 +1,7 @@
# vim:fileencoding=utf-8:noet
from powerline.lint.markedjson import load
from powerline import find_config_file, Powerline
from powerline import _find_config_file as find_config_file, Powerline
from powerline.lib.config import load_json_config
from powerline.lint.markedjson.error import echoerr, MarkedError
from powerline.segments.vim import vim_modes

View File

@ -22,7 +22,7 @@ def load_json_config(config_file_path, *args, **kwargs):
raise IOError(config_file_path)
def find_config_file(config, search_paths, config_file):
def _find_config_file(config, search_paths, config_file):
if config_file.endswith('raise') and config_file not in config:
raise IOError('fcf:' + config_file)
return config_file
@ -158,7 +158,7 @@ def swap_attributes(cfg_container, powerline_module, replaces):
config_container = cfg_container
if not replaces:
replaces = {
'find_config_file': lambda *args: find_config_file(config_container['config'], *args),
'_find_config_file': lambda *args: _find_config_file(config_container['config'], *args),
}
for attr, val in replaces.items():
old_val = getattr(powerline_module, attr)