Show More
@@ -66,6 +66,28 b' def promptchoice(pe):' | |||||
66 | def warningchecker(msgidpat=None): |
|
66 | def warningchecker(msgidpat=None): | |
67 | return checker('warning', msgidpat) |
|
67 | return checker('warning', msgidpat) | |
68 |
|
68 | |||
|
69 | @warningchecker() | |||
|
70 | def taildoublecolons(pe): | |||
|
71 | """Check equality of tail '::'-ness between msgid and msgstr | |||
|
72 | ||||
|
73 | >>> pe = polib.POEntry( | |||
|
74 | ... msgid ='ends with ::', | |||
|
75 | ... msgstr='ends with ::') | |||
|
76 | >>> for e in taildoublecolons(pe): print e | |||
|
77 | >>> pe = polib.POEntry( | |||
|
78 | ... msgid ='ends with ::', | |||
|
79 | ... msgstr='ends without double-colons') | |||
|
80 | >>> for e in taildoublecolons(pe): print e | |||
|
81 | tail '::'-ness differs between msgid and msgstr | |||
|
82 | >>> pe = polib.POEntry( | |||
|
83 | ... msgid ='ends without double-colons', | |||
|
84 | ... msgstr='ends with ::') | |||
|
85 | >>> for e in taildoublecolons(pe): print e | |||
|
86 | tail '::'-ness differs between msgid and msgstr | |||
|
87 | """ | |||
|
88 | if pe.msgid.endswith('::') != pe.msgstr.endswith('::'): | |||
|
89 | yield "tail '::'-ness differs between msgid and msgstr" | |||
|
90 | ||||
69 | #################### |
|
91 | #################### | |
70 |
|
92 | |||
71 | def check(pofile, fatal=True, warning=False): |
|
93 | def check(pofile, fatal=True, warning=False): |
General Comments 0
You need to be logged in to leave comments.
Login now