Refactor: More f-string for bypy scripts

This commit is contained in:
pagedown
2022-01-29 20:15:17 +08:00
parent 74921c1373
commit 74e70d2548
3 changed files with 45 additions and 45 deletions

View File

@@ -26,7 +26,7 @@ def initialize_constants():
kitty_constants = {}
src = read_src_file('constants.py')
nv = re.search(r'Version\((\d+), (\d+), (\d+)\)', src)
kitty_constants['version'] = '%s.%s.%s' % (nv.group(1), nv.group(2), nv.group(3))
kitty_constants['version'] = f'{nv.group(1)}.{nv.group(2)}.{nv.group(3)}'
kitty_constants['appname'] = re.search(
r'appname: str\s+=\s+(u{0,1})[\'"]([^\'"]+)[\'"]', src
).group(2)