mirror of
https://github.com/systemd/systemd.git
synced 2024-10-31 16:21:26 +03:00
Merge pull request #18745 from keszybz/stop-using-fstrings
Stop using fstrings
This commit is contained in:
commit
267294e08d
@ -1,7 +1,8 @@
|
||||
#!/usr/bin/env python3
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
"Generate %-from-name.gperf from %-list.txt"
|
||||
"""Generate %-from-name.gperf from %-list.txt
|
||||
"""
|
||||
|
||||
import sys
|
||||
|
||||
@ -13,12 +14,12 @@ print("""\
|
||||
_Pragma("GCC diagnostic ignored \\"-Wimplicit-fallthrough\\"")
|
||||
#endif
|
||||
%}""")
|
||||
print(f"""\
|
||||
struct {name}_name {{ const char* name; int id; }};
|
||||
print("""\
|
||||
struct {}_name {{ const char* name; int id; }};
|
||||
%null-strings
|
||||
%%""")
|
||||
%%""".format(name))
|
||||
|
||||
for line in open(input):
|
||||
line = line.rstrip()
|
||||
s = line.replace('_', '-')
|
||||
print(f'{s}, {prefix}{line}')
|
||||
print("{}, {}{}".format(s, prefix, line))
|
||||
|
@ -18,9 +18,9 @@ for line in open(sys.argv[1]):
|
||||
if match:
|
||||
s = match.group(1)
|
||||
if s == 'sd_bus_object_vtable_format':
|
||||
print(f' &{s},')
|
||||
print(' &{},'.format(s))
|
||||
else:
|
||||
print(f' {s},')
|
||||
print(' {},'.format(s))
|
||||
|
||||
print('''};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user