File: checkTranslationDupes.py

package info (click to toggle)
3depict 0.0.21-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 17,908 kB
  • sloc: cpp: 72,771; sh: 6,497; xml: 1,576; python: 326; makefile: 194; ansic: 186
file content (27 lines) | stat: -rwxr-xr-x 415 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/python

import sys
import re

filename="3Depict_de_DE.po"
f = open(filename)

if not f:
	sys.exit("Unable to open file. Exiting")

curLine=0

while True: 
	curLine=curLine+1;
	s=f.readline();
	if(not s):
		break;

	if re.match("msgid.*",s):
		msgid=s[6:];
	elif re.match("msgstr.*",s):
		msgstr=s[7:];

		if(msgid == msgstr and re.match(".*[A-z].*",msgid)):
				print "Duplicate id at "  + str(curLine)