mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-03-10 00:58:20 +03:00
generate-dns_type-gperf: modernize python syntax
This commit is contained in:
parent
7857b6e838
commit
b0a336a669
@ -1,7 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
"""Generate %-from-name.gperf from %-list.txt
|
||||
"""
|
||||
"Generate %-from-name.gperf from %-list.txt"
|
||||
|
||||
import sys
|
||||
|
||||
@ -13,12 +12,12 @@ print("""\
|
||||
_Pragma("GCC diagnostic ignored \\"-Wimplicit-fallthrough\\"")
|
||||
#endif
|
||||
%}""")
|
||||
print("""\
|
||||
struct {}_name {{ const char* name; int id; }};
|
||||
print(f"""\
|
||||
struct {name}_name {{ const char* name; int id; }};
|
||||
%null-strings
|
||||
%%""".format(name))
|
||||
%%""")
|
||||
|
||||
for line in open(input):
|
||||
line = line.rstrip()
|
||||
s = line.replace('_', '-')
|
||||
print("{}, {}{}".format(s, prefix, line))
|
||||
print(f'{s}, {prefix}{line}')
|
||||
|
Loading…
x
Reference in New Issue
Block a user