File: update-constants.py

package info (click to toggle)
python-systemd 235-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 416 kB
  • sloc: ansic: 2,505; python: 1,139; makefile: 63
file content (9 lines) | stat: -rw-r--r-- 309 bytes parent folder | download | duplicates (3)
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()))