]> git.lyx.org Git - lyx.git/blobdiff - lib/generate_contributions.py
Pretty printing
[lyx.git] / lib / generate_contributions.py
index c802d64f727b09d40d941822b9c2636ad0d24b3d..b92042686330801e7aed93889144b3a5597a73ff 100755 (executable)
@@ -21,7 +21,7 @@ $ python generate_contributions.py \
 where the arguments are the names of the generated files.
 '''
 
-import codecs, sys
+import codecs, sys, textwrap
 
 def xml_escape(s):
     s = s.replace("&", "&")
@@ -63,14 +63,14 @@ class contributer:
           return "".join(result)
 
 
-     def as_php_credits(self):
+     def as_php_credits(self, wrapper):
           return '''
 contrib("%s",
         "%s",
         "%s");
 ''' % ( xml_escape(self.name),
         xml_escape(self.contact),
-        xml_escape(self.credit) )
+        "\n".join(wrapper.wrap(xml_escape(self.credit))) )
 
 
      def as_php_blanket(self):
@@ -94,7 +94,7 @@ def error(message):
 
 
 def usage(prog_name):
-     return "Usage: %s <CREDITS> <credits.php> <blanket-permission.php" % prog_name
+     return "Usage: %s <CREDITS> <credits.php> <blanket-permission.php>" % prog_name
 
 
 def collate_incomplete(contributers):
@@ -170,12 +170,16 @@ function contrib($name, $email, $msg) {
 echo "
 
  <dt>
-  <b>${name}</b>";
+  <b>${name}</b>
+";
 
 if (isset($email) && $email != "")
         echo "  <i>&lt;${email}&gt;</i>";
 
-echo " </dt>
+$msg = ereg_replace("\\n *", "\\n  ", ltrim($msg));
+
+echo "
+ </dt>
  <dd>
   ${msg}
  </dd>";
@@ -191,12 +195,13 @@ echo " </dt>
      mailing list. Thanks.
 </p>
 
-<dl>
-<?php''')
+<dl><?php''')
+
+     wrapper = textwrap.TextWrapper(width=60, subsequent_indent="         ")
 
      for contributer in contributers:
           if len(contributer.credit) != 0:
-               results.append(contributer.as_php_credits())
+               results.append(contributer.as_php_credits(wrapper))
 
      results.append('''?>
 
@@ -246,8 +251,7 @@ echo "&quot;
      Gnu General Public Licence</a>, version 2 or later.
 </p>
 
-<dl>
-<?php''')
+<dl><?php''')
 
      for contributer in contributers:
           if contributer.licence == "GPL":
@@ -382,7 +386,7 @@ contributers = [
                  "Re: Licensing of tex2lyx (and perhaps LyX itself?)",
                  "m=110907078027047",
                  "22 February 2005",
-                 u"Improvements to user interface (menus and keyhandling) including configurabletoolbar, and a few other (not so) minor things, like rewriting most of the LyX kernel. Also current source maintainer"),
+                 u"Improvements to user interface (menus and keyhandling) including a configurable toolbar and a few other (not so) minor things, like rewriting most of the LyX kernel. Also current source maintainer"),
 
      contributer(u"Alfredo Braunstein",
                  "abraunst () lyx ! org",
@@ -406,7 +410,7 @@ contributers = [
                  "Re: The LyX licence",
                  "m=110908472818670",
                  "22 February 2005",
-                 u"Ported John Levon's original 'change tracking' code to later versions of LyX.Numerous bug fixes thereof."),
+                 u"Ported John Levon's original 'change tracking' code to later versions of LyX. Numerous bug fixes thereof."),
 
      contributer(u"Francesc Burrull i Mestres",
                  "fburrull () mat ! upc ! es",
@@ -502,7 +506,7 @@ contributers = [
                  "Re: The LyX licence",
                  "m=110959835300777",
                  "28 February 2005",
-                 u"Improvements to lyxserver; LyX-Client perl package"),
+                 u"Improvements to lyxserver"),
 
      contributer(u"Hartmut Goebel",
                  "h.goebel () crazy-compilers ! com",
@@ -750,7 +754,7 @@ contributers = [
                  "Re: The LyX licence",
                  "m=110911176213928",
                  "22 February 2005",
-                 u"Improvements to find&replace popup"),
+                 u"Improvements to the find&replace dialog"),
 
      contributer(u"Pablo De Napoli",
                  "pdenapo () mate ! dm ! uba ! ar",
@@ -830,7 +834,7 @@ contributers = [
                  "Re: The LyX licence",
                  "m=111121553103800",
                  "19 March 2005",
-                 u"heavy mathed testing provided siamltex document class"),
+                 u"heavy mathed testing; provided siamltex document class"),
 
      contributer(u"Bernhard Psaier",
                  "",
@@ -881,11 +885,11 @@ contributers = [
                  u"Creator of the native port of LyX to Windows"),
 
      contributer(u"Bernd Rellermeyer",
-                 "100.41728 () germanynet ! de",
-                 "",
-                 "",
-                 "",
-                 "",
+                 "bernd.rellermeyer () arcor ! de",
+                 "GPL",
+                 "Re: The LyX licence",
+                 "m=111317142419908",
+                 "10 April 2005",
                  u"Support for Koma-Script family of classes"),
 
      contributer(u"Michael Ressler",
@@ -1062,7 +1066,7 @@ contributers = [
                  "Re: The LyX licence",
                  "m=110907543900367",
                  "22 February 2005",
-                 u"support for optional argument in sections/captions svjour/svjog, egs and llncs document classes Lot of bug hunting (and fixing!)"),
+                 u"support for optional argument in sections/captions svjour/svjog, egs and llncs document classes. Lot of bug hunting (and fixing!)"),
 
      contributer(u"Jürgen Vigna",
                  "jug () lyx ! org",
@@ -1070,7 +1074,7 @@ contributers = [
                  "Re: Licensing of tex2lyx (and perhaps LyX itself?)",
                  "m=110899839906262",
                  "21 February 2005",
-                 u"complete rewrite of the tabular, text inset fax- and Ascii-Export support iletter and dinbrief support"),
+                 u"complete rewrite of the tabular, text inset; fax- and Ascii-Export support; iletter and dinbrief support"),
 
      contributer(u"Pauli Virtanen",
                  "pauli.virtanen () hut ! fi",