Move auxilary functions before specifications

This commit is contained in:
ZyX 2014-09-20 00:13:27 +04:00
parent e9c9b6519f
commit e9e53aa85f
1 changed files with 10 additions and 10 deletions

View File

@ -28,6 +28,16 @@ def open_file(path):
return open(path, 'rb') return open(path, 'rb')
def generate_json_config_loader(lhadproblem):
def load_json_config(config_file_path, load=load, open_file=open_file):
with open_file(config_file_path) as config_file_fp:
r, hadproblem = load(config_file_fp)
if hadproblem:
lhadproblem[0] = True
return r
return load_json_config
function_name_re = '^(\w+\.)*[a-zA-Z_]\w*$' function_name_re = '^(\w+\.)*[a-zA-Z_]\w*$'
@ -279,16 +289,6 @@ theme_spec = common_theme_spec().update(
) )
def generate_json_config_loader(lhadproblem):
def load_json_config(config_file_path, load=load, open_file=open_file):
with open_file(config_file_path) as config_file_fp:
r, hadproblem = load(config_file_fp)
if hadproblem:
lhadproblem[0] = True
return r
return load_json_config
def check(paths=None, debug=False, echoerr=echoerr, require_ext=None): def check(paths=None, debug=False, echoerr=echoerr, require_ext=None):
search_paths = paths or get_config_paths() search_paths = paths or get_config_paths()
find_config_files = generate_config_finder(lambda: search_paths) find_config_files = generate_config_finder(lambda: search_paths)