Another correction of the options, the default of skip_fuzzy must be

false of course.
Corrected the reported message number, which should now be the same as
the one KBabel uses.


svn: r7660
This commit is contained in:
Kees Bakker 2006-11-20 20:57:31 +00:00
parent be25a9e171
commit 9a3ef222be

View File

@ -231,7 +231,7 @@ def read_msgs( fname ):
str_pat = re.compile( r'"', re.VERBOSE ) str_pat = re.compile( r'"', re.VERBOSE )
old_pat = re.compile( r'\#~ \s+ ', re.VERBOSE ) old_pat = re.compile( r'\#~ \s+ ', re.VERBOSE )
msgnr = 1 msgnr = 0 # This is the message number of the next message to read. The first real message is 1.
f = open( fname ) f = open( fname )
lines = f.readlines() lines = f.readlines()
@ -274,23 +274,23 @@ def read_msgs( fname ):
# expect msgid or comment or old stuff # expect msgid or comment or old stuff
if next_state == CMNT: if next_state == CMNT:
state = CMNT state = CMNT
msgnr += 1
msg = Msgid( msgnr, lineno ) # Start with an empty new item msg = Msgid( msgnr, lineno ) # Start with an empty new item
msgnr += 1
msgs.append( msg ) msgs.append( msg )
msg.add_cmnt( line ) msg.add_cmnt( line )
elif next_state == MSGID: elif next_state == MSGID:
state = MSGID state = MSGID
msgnr += 1
msg = Msgid( msgnr, lineno ) # Start with an empty new item msg = Msgid( msgnr, lineno ) # Start with an empty new item
msgnr += 1
msgs.append( msg ) msgs.append( msg )
msg.add_msgid( line ) msg.add_msgid( line )
elif next_state == MSGSTR: elif next_state == MSGSTR:
print 'WARNING: Wild msgstr at %(fname)s:%(lineno)d' % vars() print 'WARNING: Wild msgstr at %(fname)s:%(lineno)d' % vars()
state = MSGSTR state = MSGSTR
msgnr += 1
msg = Msgid( msgnr, lineno ) # Start with an empty new item msg = Msgid( msgnr, lineno ) # Start with an empty new item
msgnr += 1
msgs.append( msg ) msgs.append( msg )
msg.add_msgstr( line ) msg.add_msgstr( line )
@ -312,16 +312,16 @@ def read_msgs( fname ):
elif next_state == MSGID: elif next_state == MSGID:
state = MSGID state = MSGID
if not msg: if not msg:
msgnr += 1
msg = Msgid( msgnr, lineno ) # Start with an empty new item msg = Msgid( msgnr, lineno ) # Start with an empty new item
msgnr += 1
msgs.append( msg ) msgs.append( msg )
msg.add_msgid( line ) msg.add_msgid( line )
elif next_state == MSGSTR: elif next_state == MSGSTR:
print 'WARNING: Wild msgstr at %(fname)s:%(lineno)d' % vars() print 'WARNING: Wild msgstr at %(fname)s:%(lineno)d' % vars()
state = MSGSTR state = MSGSTR
msgnr += 1
msg = Msgid( msgnr, lineno ) # Start with an empty new item msg = Msgid( msgnr, lineno ) # Start with an empty new item
msgnr += 1
msgs.append( msg ) msgs.append( msg )
msg.add_msgstr( line ) msg.add_msgstr( line )
@ -355,15 +355,15 @@ def read_msgs( fname ):
if next_state == CMNT: if next_state == CMNT:
# A comment probably starts a new item # A comment probably starts a new item
state = CMNT state = CMNT
msgnr += 1
msg = Msgid( msgnr, lineno ) msg = Msgid( msgnr, lineno )
msgnr += 1
msgs.append( msg ) msgs.append( msg )
msg.add_cmnt( line ) msg.add_cmnt( line )
elif next_state == MSGID: elif next_state == MSGID:
state = MSGID state = MSGID
msgnr += 1
msg = Msgid( msgnr, lineno ) msg = Msgid( msgnr, lineno )
msgnr += 1
msgs.append( msg ) msgs.append( msg )
msg.add_msgid( line ) msg.add_msgid( line )
@ -450,7 +450,7 @@ def main():
parser = OptionParser( description='This program validates a PO file for GRAMPS.', usage='%prog [options] po-file...' ) parser = OptionParser( description='This program validates a PO file for GRAMPS.', usage='%prog [options] po-file...' )
parser.add_option("", "--skip-fuzzy", parser.add_option("", "--skip-fuzzy",
action="store_true", dest="skip_fuzzy", default=True, action="store_true", dest="skip_fuzzy", default=False,
help="skip fuzzies") help="skip fuzzies")
parser.add_option("-s", "--only-summary", parser.add_option("-s", "--only-summary",