]> git.donarmstrong.com Git - lilypond.git/commitdiff
Docs: fix translations checking
authorJohn Mandereau <john.mandereau@gmail.com>
Sat, 22 Nov 2008 19:19:53 +0000 (20:19 +0100)
committerJohn Mandereau <john.mandereau@gmail.com>
Sat, 22 Nov 2008 19:19:53 +0000 (20:19 +0100)
buildscripts/buildlib.py
buildscripts/check_translation.py
buildscripts/translations-status.py

index 11dbf96a164dc9a3faa7c54fbb36bd5616bc929d..cd99586ff81038832afcae4b9c31468cde8766b5 100644 (file)
@@ -2,6 +2,7 @@
 
 import subprocess
 import re
+import sys
 
 verbose = False
 
@@ -18,13 +19,13 @@ def read_pipe (command):
         error = code + ' ' + error
     return (output, error)
 
-revision_re = re.compile ('GIT [Cc]ommittish: ([a-f0-9]+)')
+revision_re = re.compile ('GIT [Cc]ommittish:\s+([a-f0-9]+)')
 vc_diff_cmd = 'git diff %(color_flag)s %(revision)s HEAD -- %(original)s | cat'
 
-def check_translated_doc (original, translated_contents, color=False):
+def check_translated_doc (original, translated_file, translated_contents, color=False):
     m = revision_re.search (translated_contents)
     if not m:
-        sys.stderr.write ('error: ' + translated + \
+        sys.stderr.write ('error: ' + translated_file + \
                           ": no 'GIT committish: <hash>' found.\nPlease check " + \
                           'the whole file against the original in English, then ' + \
                           'fill in HEAD committish in the header.\n')
index 4f6ef6a62908b8bcaff37d427416249cfcaa0f71..090b1fbe8a73811af2dd98c0d2c74f2078ca6aa3 100755 (executable)
@@ -36,7 +36,11 @@ def do_file (file_name, lang_codes, buildlib):
     
     original = dir_lang (file_name, '', lang_dir_index)
     translated_contents = open (file_name).read ()
-    (diff_string, error) = buildlib.check_translated_doc (original, translated_contents, color=use_colors and not update_mode)
+    (diff_string, error) \
+        = buildlib.check_translated_doc (original,
+                                         file_name,
+                                         translated_contents,
+                                         color=use_colors and not update_mode)
 
     if error:
         sys.stderr.write ('warning: %s: %s' % (file_name, error))
index 4180ea86722c925bc4250e61311a4832735a0c34..c93199354f524f0296690ec90ba4bbbe08785817 100755 (executable)
@@ -247,7 +247,7 @@ class TranslatedTelyDocument (TelyDocument):
 
         ## calculate how much the file is outdated
         (diff_string, error) = \
-            buildlib.check_translated_doc (masterdocument.filename, self.contents)
+            buildlib.check_translated_doc (masterdocument.filename, self.filename, self.contents)
         if error:
             sys.stderr.write ('warning: %s: %s' % (self.filename, error))
             self.uptodate_percentage = None