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
|
#!/usr/bin/env python3
|
||||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||||
|
|
||||||
"Generate %-from-name.gperf from %-list.txt"
|
"""Generate %-from-name.gperf from %-list.txt
|
||||||
|
"""
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
@ -13,12 +14,12 @@ print("""\
|
|||||||
_Pragma("GCC diagnostic ignored \\"-Wimplicit-fallthrough\\"")
|
_Pragma("GCC diagnostic ignored \\"-Wimplicit-fallthrough\\"")
|
||||||
#endif
|
#endif
|
||||||
%}""")
|
%}""")
|
||||||
print(f"""\
|
print("""\
|
||||||
struct {name}_name {{ const char* name; int id; }};
|
struct {}_name {{ const char* name; int id; }};
|
||||||
%null-strings
|
%null-strings
|
||||||
%%""")
|
%%""".format(name))
|
||||||
|
|
||||||
for line in open(input):
|
for line in open(input):
|
||||||
line = line.rstrip()
|
line = line.rstrip()
|
||||||
s = line.replace('_', '-')
|
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:
|
if match:
|
||||||
s = match.group(1)
|
s = match.group(1)
|
||||||
if s == 'sd_bus_object_vtable_format':
|
if s == 'sd_bus_object_vtable_format':
|
||||||
print(f' &{s},')
|
print(' &{},'.format(s))
|
||||||
else:
|
else:
|
||||||
print(f' {s},')
|
print(' {},'.format(s))
|
||||||
|
|
||||||
print('''};
|
print('''};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user