Skip to content
Snippets Groups Projects
Commit b5116ece authored by Martin Nilsson's avatar Martin Nilsson
Browse files

Makes better get_text output.

Rev: lib/modules/Tools.pmod/Legal.pmod/License.pmod/module.pmod:1.2
parent f4dd7289
Branches
Tags
No related merge requests found
#pike __REAL_VERSION__ #pike __REAL_VERSION__
// $Id: module.pmod,v 1.1 2002/05/31 16:20:18 nilsson Exp $ // $Id: module.pmod,v 1.2 2002/05/31 22:24:27 nilsson Exp $
//! Returns all the licenses as a string, suitable for //! Returns all the licenses as a string, suitable for
//! saving as a file. //! saving as a file.
string get_text() { string get_text() {
array licenses = sort(indices(Tools.Legal.License)) - array licenses = sort(indices(Tools.Legal.License)) -
({ "get_text", "module" }); ({ "get_text", "module" });
string ret = sprintf("%-=80s\n\n", array list = map(licenses,
lambda(string lic) {
return lic + " (" + Tools.Legal.License[lic]->get_name() + ")";
});
string ret = sprintf("%-=80s\n",
"The Pike source is distributed under " + "The Pike source is distributed under " +
String.implode_nicely(licenses) + ". " String.implode_nicely(list) + ". "
"These licenses are listed in order below."); "These licenses are listed in order below.");
foreach(licenses, string license) foreach(licenses, string license)
ret += "\n\f" + Tools.Legal.License[license]->get_text(); ret += "\n\n\f\n" + Tools.Legal.License[license]->get_text();
return ret; return ret;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment