File: update-constants.py

package info (click to toggle)
python-systemd 234-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 380 kB
  • sloc: ansic: 2,295; python: 1,024; makefile: 60
file content (9 lines) | stat: -rw-r--r-- 309 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
import sys

for file in sys.argv[1:]:
    lines = iter(open(file).read().splitlines())
    for line in lines:
        if line.startswith('#define SD_MESSAGE') and '_STR ' not in line:
            if line.endswith('\\'):
                line = line[:-1] + next(lines)
            print(' '.join(line.split()))