X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=lib%2Fgenerate_contributions.py;h=2f7612f9b148f8cb9df0ad63b07e37814ca47391;hb=c7e92d1cff1adf380b336bcdf8d0669b2c4a7a1c;hp=952c0aaa255ec692092f0994f4b80f071a79e30b;hpb=d0bee1117dfc5da607fec354b2945e279c37a365;p=lyx.git
diff --git a/lib/generate_contributions.py b/lib/generate_contributions.py
index 952c0aaa25..2f7612f9b1 100755
--- a/lib/generate_contributions.py
+++ b/lib/generate_contributions.py
@@ -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("&", "&")
@@ -59,18 +59,18 @@ class contributer:
address = address.replace(" ! ", ".")
contact = "%s@%s" % (ename, address)
result.append('@iE-mail: %s\n' % contact)
- result.append(' %s\n' % self.credit)
+ result.append(' %s\n' % self.credit.replace('\n', '\n '))
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,43 @@ def error(message):
def usage(prog_name):
- return "Usage: %s " % 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 do 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):
@@ -110,7 +146,7 @@ $author="lyx-devel@lists.lyx.org";
// Full name of this file (relative path from LyX home page)
$file_full="about/%s";
-include("start.php3");
+include("start.php");
?>
''' % ( title, file )
@@ -118,27 +154,10 @@ include("start.php3");
def footer():
return '''
'''
-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 = []
@@ -151,12 +170,16 @@ function contrib($name, $email, $msg) {
echo "
- ${name}";
+ ${name}
+";
if (isset($email) && $email != "")
echo " <${email}>";
-echo "
+$msg = ereg_replace("\\n *", "\\n ", ltrim($msg));
+
+echo "
+
${msg}
";
@@ -172,12 +195,13 @@ echo "
mailing list. Thanks.
-
-
@@ -208,7 +232,7 @@ echo "
if (isset($msg_ref) && $msg_ref != "") {
$msg_ref = htmlspecialchars("$msg_ref");
- echo "${msg_title}";
+ echo "${msg_title}";
} else {
echo "${msg_title}";
}
@@ -227,8 +251,7 @@ echo ""
Gnu General Public Licence, version 2 or later.
-
-