Full author contact details are available in file CREDITS
This script both stores and manipulates the raw data needed to
-create CREDITS, credits.php and blanket-permission.php
+create CREDITS, credits.inc and blanket-permission.inc
Usage:
$ python generate_contributions.py \
CREDITS \
- credits.php \
- blanket-permission.php
+ credits.inc \
+ blanket-permission.inc
where the arguments are the names of the generated files.
'''
if self.contact.find("http") != -1:
result.append('@i%s\n' % self.contact)
else:
- ename, address = self.contact.split(" () ", 1)
- address = address.replace(" ! ", ".")
- contact = "%s@%s" % (ename, address)
- result.append('@iE-mail: %s\n' % contact)
+ result.append('@iE-mail: %s\n' % self.contact)
result.append(' %s\n' % self.credit.replace('\n', '\n '))
return "".join(result)
def as_php_credits(self, wrapper):
return '''
-contrib("%s",
+$output=$output.credits_contrib("%s",
"%s",
"%s");
''' % ( xml_escape(self.name),
def as_php_blanket(self):
return '''
-contrib("%s",
+$output=$output.blanket_contrib("%s",
"%s",
"%s",
"%s",
return "".join(results)
-def header(title, file):
+def header():
return '''<?php
// WARNING! This file is autogenerated.
// Any changes to it will be lost.
// Please modify generate_contributions.py direct.
-
-// What's the title of the page?
-$title = "%s";
-// Who is the author?
-$author="lyx-devel@lists.lyx.org";
-// Full name of this file (relative path from LyX home page)
-$file_full="about/%s";
-
-include("start.php");
-?>
-''' % ( title, file )
+'''
def footer():
return '''
-<?php
-include("end.php");
-?>
'''
def as_php_credits(contributers, file):
results = []
- results.append(header("CREDITS", file))
+ results.append(header())
results.append('''
-<?
-function contrib($name, $email, $msg) {
-echo "
+function credits_contrib($name, $email, $msg) {
- <dt>
- <b>${name}</b>
-";
+$email = str_replace(' () ', '@', $email);
+$email = str_replace(' ! ', '.', $email);
if (isset($email) && $email != "")
- echo " <i><${email}></i>";
+ $output=$output. "<dt><b>[[mailto:${email} | ${name}]]</b>";
+else
+ $output=$output. "<dt><b>${name}</b>";
$msg = ereg_replace("\\n *", "\\n ", ltrim($msg));
-echo "
+$output=$output. "
</dt>
<dd>
${msg}
</dd>";
+
+return $output;
}
-?>
+function credits_output() {
-<p>
+$output=$output."<p>
If your name doesn't appear here although you've done
something for LyX, or your entry is wrong or incomplete,
just drop an e-mail to the
- <a href="mailto:lyx-devel@lists.lyx.org">lyx-devel</a>
+ [[mailto:lyx-devel@lists.lyx.org | lyx-devel]]
mailing list. Thanks.
</p>
-<dl><?php''')
+<dl>";
+''')
wrapper = textwrap.TextWrapper(width=60, subsequent_indent=" ")
if len(contributer.credit) != 0:
results.append(contributer.as_php_credits(wrapper))
- results.append('''?>
+ results.append('''
+$output=$output."</dl>";
+
+return $output;
-</dl>
+}
''')
results.append(footer())
return "".join(results)
def as_php_blanket(contributers, file):
results = []
- results.append(header("Permissions", file))
+ results.append(header())
results.append('''
-<?
-function contrib($name, $email, $msg_title, $msg_ref, $date) {
-echo "
+function blanket_contrib($name, $email, $msg_title, $msg_ref, $date) {
+
+$email = str_replace(' () ', '@', $email);
+$email = str_replace(' ! ', '.', $email);
+
+$output=$output. "
<dt>
- <b>${name}</b>
- <i><${email}></i>
+ <b>[[mailto:${email} | ${name}]]</b>
</dt>
<dd>
See the lyx-devel mailing list message
if (isset($msg_ref) && $msg_ref != "") {
$msg_ref = htmlspecialchars("$msg_ref");
- echo "<a href=\\"http://marc.info/?l=lyx-devel&${msg_ref}\\">${msg_title}</a>";
+ $output=$output. "[[http://marc.info/?l=lyx-devel&" . ${msg_ref} . "|" . ${msg_title} . "]]";
} else {
- echo "${msg_title}";
+ $output=$output. "${msg_title}";
}
-echo ""
+$output=$output. ""
of $date.
</dd>";
+
+return $output;
}
-?>
+function blanket_output() {
-<p>
- The following people hereby grant permission to licence their
+$output=$output."<p>
+ The following people hereby grant permission to license their
contributions to LyX under the
- <a href="http://www.opensource.org/licenses/gpl-license.php">
- Gnu General Public Licence</a>, version 2 or later.
+ [[http://www.opensource.org/licenses/gpl-license.php |
+ Gnu General Public License]], version 2 or later.
</p>
-<dl><?php''')
+<dl>";
+''')
for contributer in contributers:
if contributer.licence == "GPL":
results.append(contributer.as_php_blanket())
- results.append('''?>
-</dl>
+ results.append('''
+$output=$output."</dl>";
+$output=$output."
<p>
- The following people hereby grant permission to licence their
+ The following people hereby grant permission to license their
contributions to LyX under the
- <a href="http://www.opensource.org/licenses/artistic-license.php">
- Artistic Licence</a>.
+ [[http://www.opensource.org/licenses/artistic-license.php |
+ Artistic License]].
</p>
-<dl>
-<?php''')
+<dl>";
+''')
for contributer in contributers:
if contributer.licence == "Artistic":
results.append(contributer.as_php_blanket())
- results.append('''?>
-</dl>
+ results.append('''
+$output=$output."</dl>";
+
+return $output;
+
+}
''')
results.append(footer())
"",
u"Bug fix to the spellchecker"),
+ contributer(u"Nicola Focci",
+ "nicola.focci () gmail ! com",
+ "GPL",
+ "Permission",
+ "m=120946605432341",
+ "29 April 2008",
+ u"Italian translation of documentations"),
+
contributer(u"Enrico Forestieri",
"forenr () tlc ! unipr ! it",
"GPL",
"m=110916171925288",
"23 February 2005",
u"Norwegian documentation and localization"),
-
+
contributer(u"Richard Heck",
"rgheck () brown ! edu",
"GPL",
"",
u"bug reports and small fixes") ]
+
if __name__ == "__main__":
main(sys.argv, contributers)
+