# HG changeset patch # User Mads Kiilerich # Date 2017-09-14 02:08:06 # Node ID 952a83c9e478628de80aa9e62102a979925fb285 # Parent d7222b590156cd331a78610d71399500eea7b049 ini: be less strict about amount of whitespace around '=' in templates Allow any amount of space/tab around '=' ... but no other whitespace on the left hand side. diff --git a/kallithea/lib/inifile.py b/kallithea/lib/inifile.py --- a/kallithea/lib/inifile.py +++ b/kallithea/lib/inifile.py @@ -61,7 +61,8 @@ def expand(template, desc, selected_mako [first-section] variable=VALUE - variable2 = value after tab + #variable2 = value after tab + variable2 = VAL2 ## This section had some whitespace and stuff @@ -117,7 +118,7 @@ def expand(template, desc, selected_mako if '$' not in value: line = '#%s = %s\n%s' % (key, value, line) return line.rstrip() - lines = re.sub(r'^([^#\n].*) = ?(.*)', process_line, lines, flags=re.MULTILINE) + lines = re.sub(r'^([^#\n\s]*)[ \t]*=[ \t]*(.*)$', process_line, lines, flags=re.MULTILINE) return sectionname + '\n' + lines ini_lines = re.sub(r'^(\[.*\])\n((?:(?:[^[\n].*)?\n)*)', process_section, ini_lines, flags=re.MULTILINE)