# HG changeset patch # User Mads Kiilerich # Date 1505347686 -7200 # 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 -r d7222b590156 -r 952a83c9e478 kallithea/lib/inifile.py --- a/kallithea/lib/inifile.py Thu Sep 14 02:08:06 2017 +0200 +++ b/kallithea/lib/inifile.py Thu Sep 14 02:08:06 2017 +0200 @@ -61,7 +61,8 @@ [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 @@ 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)