From 153d8271ec3c3b9d7b5aacb6f01edff9e10ca13e Mon Sep 17 00:00:00 2001 From: bescoto Date: Fri, 12 Sep 2003 00:48:36 +0000 Subject: Further changes related to examples file git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@424 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109 --- rdiff-backup/dist/makedist | 51 ++++++++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 22 deletions(-) (limited to 'rdiff-backup/dist/makedist') diff --git a/rdiff-backup/dist/makedist b/rdiff-backup/dist/makedist index 926b686..9f41a90 100755 --- a/rdiff-backup/dist/makedist +++ b/rdiff-backup/dist/makedist @@ -23,37 +23,42 @@ def CopyMan(destination, version): fp.close() infp.close() -def MakeFAQ(): - """Create FAQ.html and FAQ.wml files from FAQ-body.html""" - faqbody_fp = open("FAQ-body.html", "r") - faqbody_string = faqbody_fp.read() - faqbody_fp.close() +def MakeHTML(input_prefix, title): + """Create html and wml versions from given html body - wml_fp = open("FAQ.wml", "w") + Input expected in -body.html, and output will be put + in .wml and .html. + + """ + body_fp = open("%s-body.html" % (input_prefix,), "r") + body_string = body_fp.read() + body_fp.close() + + wml_fp = open("%s.wml" % (input_prefix,), "w") wml_fp.write( -"""#include 'template.wml' home=. curpage=faq title="rdiff-backup: FAQ" +"""#include 'template.wml' home=. curpage=none title="%s" -

FAQ:

+

%s

-""") - wml_fp.write(faqbody_string) +""" % (title, title)) + wml_fp.write(body_string) wml_fp.write("\n
\n") wml_fp.close() - html_fp = open("FAQ.html", "w") + html_fp = open("%s.html" % (input_prefix,), "w") html_fp.write( """ - rdiff-backup FAQ + %s -

rdiff-backup FAQ

-""") - html_fp.write(faqbody_string) +

%s

+""" % (title, title)) + html_fp.write(body_string) html_fp.write("\n") html_fp.close() @@ -92,7 +97,8 @@ def MakeTar(): os.system("rm -rf " + tardir) except OSError: pass os.mkdir(tardir) - for filename in ["CHANGELOG", "COPYING", "README", "FAQ.html", + for filename in ["CHANGELOG", "COPYING", "README", + "FAQ.html", "examples.html", SourceDir + "/cmodule.c", SourceDir + "/_librsyncmodule.c", DistDir + "/setup.py"]: @@ -134,24 +140,25 @@ def parse_cmdline(arglist): """Returns action""" global Version def error(): - print "Syntax: makedist [--faq-only] [version_number]" + print "Syntax: makedist [--html-only] [version_number]" sys.exit(1) - optlist, args = getopt.getopt(arglist, "", ["faq-only"]) + optlist, args = getopt.getopt(arglist, "", ["html-only"]) if len(args) != 1: error() else: Version = args[0] for opt, arg in optlist: - if opt == "--faq-only": return "FAQ" + if opt == "--html-only": return "HTML" else: assert 0, "Bad argument" return "All" def Main(): action = parse_cmdline(sys.argv[1:]) - print "Making FAQ" - MakeFAQ() + print "Making HTML" + MakeHTML("FAQ", "rdiff-backup FAQ") + MakeHTML("examples", "rdiff-backup examples") - if action != "FAQ": + if action != "HTML": assert action == "All" print "Processing version " + Version tarfile = MakeTar() -- cgit v1.2.1