]> git.lyx.org Git - lyx.git/blobdiff - lib/generate_contributions.py
Ouput warning of missing info
[lyx.git] / lib / generate_contributions.py
index 952c0aaa255ec692092f0994f4b80f071a79e30b..c802d64f727b09d40d941822b9c2636ad0d24b3d 100755 (executable)
@@ -97,6 +97,42 @@ def usage(prog_name):
      return "Usage: %s <CREDITS> <credits.php> <blanket-permission.php" % prog_name
 
 
+def collate_incomplete(contributers):
+
+    missing_credit = []
+    missing_licence = []
+    for contributer in contributers:
+          if len(contributer.credit) == 0:
+              missing_credit.append(contributer.name)
+          if len(contributer.licence) == 0:
+              missing_licence.append(contributer.name)
+
+    return '''WARNING!
+The following contributers to not have a CREDITS entry:
+    %s
+
+These ones have no explicit licence statement:
+    %s
+''' % ( ",\n    ".join(missing_credit), ",\n    ".join(missing_licence))
+
+
+def as_txt_credits(contributers):
+     results = []
+
+     for contributer in contributers:
+          if len(contributer.credit) != 0:
+              results.append(contributer.as_txt_credits())
+
+     results.append('''
+
+If your name doesn't appear here although you've done
+something for LyX, or your entry is wrong or incomplete,
+just drop some e-mail to lyx@lyx.org. Thanks.
+''')
+
+     return "".join(results)
+
+
 def header(title, file):
      return '''<?php
 // WARNING! This file is autogenerated.
@@ -122,23 +158,6 @@ include("end.php3");
 ?>
 '''
 
-def as_txt_credits(contributers):
-     results = []
-
-     for contributer in contributers:
-          if len(contributer.credit) != 0:
-              results.append(contributer.as_txt_credits())
-
-     results.append('''
-
-If your name doesn't appear here although you've done
-something for LyX, or your entry is wrong or incomplete,
-just drop some e-mail to lyx@lyx.org. Thanks.
-''')
-
-     return "".join(results)
-
-
 def as_php_credits(contributers, file):
      results = []
 
@@ -274,10 +293,13 @@ def main(argv, contributers):
      php_credits = open(argv[2], "w")
      php_credits.write(php_credits_data)
 
-     php_blanket_data = unicode(as_php_blanket(contributers, argv[3])).encode("utf-8") 
+     php_blanket_data = unicode(as_php_blanket(contributers, argv[3])).encode("utf-8")
      php_blanket = open(argv[3], "w")
      php_blanket.write(php_blanket_data)
 
+     warning_data =  unicode(collate_incomplete(contributers) + '\n').encode("utf-8")
+     sys.stderr.write(warning_data)
+
 
 # Store the raw data.
 contributers = [