From ee48fd7151868d4eb269ae4eb9c235342336f9e8 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 3 Mar 2020 12:25:02 +0530 Subject: [PATCH] ... --- kitty/rgb.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kitty/rgb.py b/kitty/rgb.py index 510c13ff7..397fd8404 100644 --- a/kitty/rgb.py +++ b/kitty/rgb.py @@ -844,12 +844,12 @@ if __name__ == '__main__': r, g, b = map(int, parts[:3]) name = ' '.join(parts[3:]).lower() data[name] = data[name.replace(' ', '')] = r, g, b - data = pprint.pformat(data).replace('{', '{\n ').replace('(', 'Color(') + formatted_data = pprint.pformat(data).replace('{', '{\n ').replace('(', 'Color(') with open(__file__, 'r+') as src: raw = src.read() raw = re.sub( r'^# BEGIN_DATA_SECTION {{{$.*^# END_DATA_SECTION }}}', - '# BEGIN_DATA_SECTION {{{\ncolor_names = %s\n# END_DATA_SECTION }}}' % data, + '# BEGIN_DATA_SECTION {{{\ncolor_names = %s\n# END_DATA_SECTION }}}' % formatted_data, raw, flags=re.DOTALL | re.MULTILINE ) src.seek(0), src.truncate(), src.write(raw)