Use README.txt for source distribution as well as for win32-portable

This commit is contained in:
Andy Kittner 2012-04-27 23:29:39 +02:00
parent 7b8f882f0d
commit 9d81a0b871
2 changed files with 88 additions and 93 deletions

View File

@ -1,7 +1,7 @@
English README file for OpenSlides English README file for OpenSlides
================================== ==================================
This is OpenSlides, version ${VERSION}. This is OpenSlides, version 1.2.
What is OpenSlides? What is OpenSlides?
@ -58,7 +58,7 @@ Example 2: Like above, but also specify the port as 8080
Supported operating systems and browsers Supported operating systems and browsers
======================================== ========================================
Operating Systems: Operating Systems:
Windows XP or newe r (32 and 64bit) [use openslids.exe] Windows XP or newer (32 and 64bit) [use openslides.exe]
MacOS X MacOS X
GNU/Linux GNU/Linux
@ -67,16 +67,3 @@ Browsers:
IE 7+ IE 7+
Chrome Chrome
Safari Safari
Included Packages
=================
${PACKAGE_LIST}
License
=======
OpenSlides is distributed under the GNU General Public License
version 2. For details about this license and the licenses of the
bundled packages, please refer to the corresponding file in the
licenses/ directory.

View File

@ -19,7 +19,6 @@ import distutils.ccompiler
import distutils.sysconfig import distutils.sysconfig
from contextlib import nested from contextlib import nested
from string import Template
import pkg_resources import pkg_resources
@ -100,6 +99,16 @@ MSVCR_PUBLIC_KEY = "1fc8b3b9a1e18e3b"
MSVCR_VERSION = "9.0.21022.8" MSVCR_VERSION = "9.0.21022.8"
MSVCR_NAME = "Microsoft.VC90.CRT" MSVCR_NAME = "Microsoft.VC90.CRT"
README_LICENSE_SECTION = """
License
=======
OpenSlides is distributed under the GNU General Public License
version 2. For details about this license and the licenses of the
bundled packages, please refer to the corresponding file in the
licenses/ directory.
"""
def compile_re_list(patterns): def compile_re_list(patterns):
expr = "|".join("(?:{0})".format(x) for x in patterns) expr = "|".join("(?:{0})".format(x) for x in patterns)
return re.compile(expr) return re.compile(expr)
@ -261,20 +270,19 @@ def copy_msvcr(odir):
shutil.copyfile(src, dest) shutil.copyfile(src, dest)
def write_readme(template_file, outfile): def write_readme(orig_readme, outfile):
with open(template_file, "rU") as f: with open(orig_readme, "rU") as f:
tmpl = Template(f.read()) text = [l for l in f]
packages = ["openslides-{0}".format(openslides.get_version())] text.extend(["\n", "\n", "Included Packages\n", 17 * "=" + "\n"])
for pkg in SITE_PACKAGES: for pkg in sorted(SITE_PACKAGES):
dist = pkg_resources.get_distribution(pkg) dist = pkg_resources.get_distribution(pkg)
packages.append("{0}-{1}".format(dist.project_name, dist.version)) text.append("{0}-{1}\n".format(dist.project_name, dist.version))
tmpl_vars = {"PACKAGE_LIST": "\n".join(packages),
"VERSION": openslides.get_version()}
with open(outfile, "w") as f: with open(outfile, "w") as f:
f.write(tmpl.substitute(tmpl_vars)) f.writelines(text)
f.write(README_LICENSE_SECTION)
def main(): def main():
@ -312,7 +320,7 @@ def main():
zip_fp = os.path.join("dist", "openslides-{0}-portable.zip".format( zip_fp = os.path.join("dist", "openslides-{0}-portable.zip".format(
openslides.get_version())) openslides.get_version()))
write_readme("extras/win32-portable/README.txt.in", write_readme("README.txt",
os.path.join(odir, "README.txt")) os.path.join(odir, "README.txt"))
with zipfile.ZipFile(zip_fp, "w", zipfile.ZIP_DEFLATED) as zf: with zipfile.ZipFile(zip_fp, "w", zipfile.ZIP_DEFLATED) as zf: