##// END OF EJS Templates
fix(settings): fixed a case for certain settings that could be quoted inside .ini files
super-admin -
r1215:685ad2d3 default
parent child Browse files
Show More
@@ -78,10 +78,10 b' debugtoolbar.exclude_prefixes ='
78 ; default locale used by VCS systems
78 ; default locale used by VCS systems
79 #locale = en_US.UTF-8
79 #locale = en_US.UTF-8
80
80
81 ; path to binaries for vcsserver, it should be set by the installer
81 ; path to binaries (hg,git,svn) for vcsserver, it should be set by the installer
82 ; at installation time, e.g /home/user/.rccontrol/vcsserver-1/profile/bin
82 ; at installation time, e.g /home/user/.rccontrol/vcsserver-1/profile/bin
83 ; it can also be a path to nix-build output in case of development
83 ; or /usr/local/bin/rhodecode_bin/vcs_bin
84 core.binary_dir = ""
84 core.binary_dir =
85
85
86 ; Custom exception store path, defaults to TMPDIR
86 ; Custom exception store path, defaults to TMPDIR
87 ; This is used to store exception from RhodeCode in shared directory
87 ; This is used to store exception from RhodeCode in shared directory
@@ -41,10 +41,10 b' use = egg:rhodecode-vcsserver'
41 ; default locale used by VCS systems
41 ; default locale used by VCS systems
42 #locale = en_US.UTF-8
42 #locale = en_US.UTF-8
43
43
44 ; path to binaries for vcsserver, it should be set by the installer
44 ; path to binaries (hg,git,svn) for vcsserver, it should be set by the installer
45 ; at installation time, e.g /home/user/.rccontrol/vcsserver-1/profile/bin
45 ; at installation time, e.g /home/user/.rccontrol/vcsserver-1/profile/bin
46 ; it can also be a path to nix-build output in case of development
46 ; or /usr/local/bin/rhodecode_bin/vcs_bin
47 core.binary_dir = ""
47 core.binary_dir =
48
48
49 ; Custom exception store path, defaults to TMPDIR
49 ; Custom exception store path, defaults to TMPDIR
50 ; This is used to store exception from RhodeCode in shared directory
50 ; This is used to store exception from RhodeCode in shared directory
@@ -28,6 +28,7 b' from vcsserver.type_utils import str2boo'
28
28
29 log = logging.getLogger(__name__)
29 log = logging.getLogger(__name__)
30
30
31
31 # skip keys, that are set here, so we don't double process those
32 # skip keys, that are set here, so we don't double process those
32 set_keys = {
33 set_keys = {
33 '__file__': ''
34 '__file__': ''
@@ -51,6 +52,10 b' class SettingsMaker:'
51 return int(input_val)
52 return int(input_val)
52
53
53 @classmethod
54 @classmethod
55 def _float_func(cls, input_val):
56 return float(input_val)
57
58 @classmethod
54 def _list_func(cls, input_val, sep=','):
59 def _list_func(cls, input_val, sep=','):
55 return aslist(input_val, sep=sep)
60 return aslist(input_val, sep=sep)
56
61
@@ -61,8 +66,17 b' class SettingsMaker:'
61 return input_val
66 return input_val
62
67
63 @classmethod
68 @classmethod
64 def _float_func(cls, input_val):
69 def _string_no_quote_func(cls, input_val, lower=True):
65 return float(input_val)
70 """
71 Special case string function that detects if value is set to empty quote string
72 e.g.
73
74 core.binar_dir = ""
75 """
76
77 input_val = cls._string_func(input_val, lower=lower)
78 if input_val in ['""', "''"]:
79 return ''
66
80
67 @classmethod
81 @classmethod
68 def _dir_func(cls, input_val, ensure_dir=False, mode=0o755):
82 def _dir_func(cls, input_val, ensure_dir=False, mode=0o755):
@@ -148,10 +162,12 b' class SettingsMaker:'
148 parser_func = {
162 parser_func = {
149 'bool': self._bool_func,
163 'bool': self._bool_func,
150 'int': self._int_func,
164 'int': self._int_func,
165 'float': self._float_func,
151 'list': self._list_func,
166 'list': self._list_func,
152 'list:newline': functools.partial(self._list_func, sep='/n'),
167 'list:newline': functools.partial(self._list_func, sep='/n'),
153 'list:spacesep': functools.partial(self._list_func, sep=' '),
168 'list:spacesep': functools.partial(self._list_func, sep=' '),
154 'string': functools.partial(self._string_func, lower=lower),
169 'string': functools.partial(self._string_func, lower=lower),
170 'string:noquote': functools.partial(self._string_no_quote_func, lower=lower),
155 'dir': self._dir_func,
171 'dir': self._dir_func,
156 'dir:ensured': functools.partial(self._dir_func, ensure_dir=True),
172 'dir:ensured': functools.partial(self._dir_func, ensure_dir=True),
157 'file': self._file_path_func,
173 'file': self._file_path_func,
@@ -716,7 +716,7 b' def sanitize_settings_and_apply_defaults'
716 settings_maker.make_setting('pyramid.default_locale_name', 'en')
716 settings_maker.make_setting('pyramid.default_locale_name', 'en')
717 settings_maker.make_setting('locale', 'en_US.UTF-8')
717 settings_maker.make_setting('locale', 'en_US.UTF-8')
718
718
719 settings_maker.make_setting('core.binary_dir', '/usr/local/bin/rhodecode_bin/vcs_bin')
719 settings_maker.make_setting('core.binary_dir', '/usr/local/bin/rhodecode_bin/vcs_bin', parser='string:noquote')
720
720
721 temp_store = tempfile.gettempdir()
721 temp_store = tempfile.gettempdir()
722 default_cache_dir = os.path.join(temp_store, 'rc_cache')
722 default_cache_dir = os.path.join(temp_store, 'rc_cache')
General Comments 0
You need to be logged in to leave comments. Login now