##// END OF EJS Templates
svn-support: Use settings functions from rhodecode config.
Martin Bornhold -
r1004:4b450a75 default
parent child Browse files
Show More
@@ -22,7 +22,7 b' import logging'
22 22 import os
23 23
24 24 from rhodecode import events
25 from rhodecode.lib.utils2 import str2bool
25 from rhodecode.config.middleware import _bool_setting, _string_setting
26 26
27 27 from .subscribers import generate_config_subscriber
28 28 from . import config_keys
@@ -45,22 +45,18 b' def _sanitize_settings_and_apply_default'
45 45 Set defaults, convert to python types and validate settings.
46 46 """
47 47 # Convert bool settings from string to bool.
48 settings[config_keys.generate_config] = str2bool(
49 settings.get(config_keys.generate_config, 'false'))
50 settings[config_keys.list_parent_path] = str2bool(
51 settings.get(config_keys.list_parent_path, 'true'))
48 _bool_setting(settings, config_keys.generate_config, 'false')
49 _bool_setting(settings, config_keys.list_parent_path, 'true')
50 _string_setting(settings, config_keys.config_file_path, '', lower=False)
51 _string_setting(settings, config_keys.location_root, '/', lower=False)
52 52
53 # Set defaults if key not present.
54 settings.setdefault(config_keys.config_file_path, None)
55 settings.setdefault(config_keys.location_root, '/')
56
57 # Append path separator to paths.
53 # Append path separator to location root.
58 54 settings[config_keys.location_root] = _append_path_sep(
59 55 settings[config_keys.location_root])
60 56
61 57 # Validate settings.
62 58 if settings[config_keys.generate_config]:
63 assert settings[config_keys.config_file_path] is not None
59 assert len(settings[config_keys.config_file_path]) > 0
64 60
65 61
66 62 def _append_path_sep(path):
General Comments 0
You need to be logged in to leave comments. Login now