where the arguments are the names of the generated files.
'''
-import codecs, sys
+import codecs, sys, textwrap
def xml_escape(s):
s = s.replace("&", "&")
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):
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):
+
+ 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):
?>
'''
-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 = []
echo "
<dt>
- <b>${name}</b>";
+ <b>${name}</b>
+";
if (isset($email) && $email != "")
echo " <i><${email}></i>";
-echo " </dt>
+$msg = ereg_replace("\\n *", "\\n ", ltrim($msg));
+
+echo "
+ </dt>
<dd>
${msg}
</dd>";
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('''?>
Gnu General Public Licence</a>, version 2 or later.
</p>
-<dl>
-<?php''')
+<dl><?php''')
for contributer in contributers:
if contributer.licence == "GPL":
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 = [
"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",
"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",
"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",
"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",
"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",
"",
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",
"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",
"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",