diff bin/publishstaticweb.py @ 372:ef87d30468b6

Added the option to expose additional log files from the log directory. To enable this one can either set a build_logs value in the staticweb.cfg or call createstaticweb with the parameter --show-logs. Default behavior is to only publish the build log, although the title is now capitalized.
author Andre Heinecke <aheinecke@intevation.de>
date Mon, 21 Jun 2010 08:23:30 +0000
parents 28df50b267f6
children bccd69dedbe5
line wrap: on
line diff
--- a/bin/publishstaticweb.py	Tue Jun 15 10:56:44 2010 +0000
+++ b/bin/publishstaticweb.py	Mon Jun 21 08:23:30 2010 +0000
@@ -29,14 +29,21 @@
     return os.path.expandvars(os.path.expanduser(filename))
 
 staticweb_desc = ["build_user", "build_host", "build_create", "build_template",
+                  "build_logs",
                   ("build_dir", remove_trailing_slashes),
                   "publish_user", "publish_host",
                   ("publish_dir", remove_trailing_slashes),
                   ("cachedir",
                    lambda s: expand_filename(remove_trailing_slashes(s)))]
 
+#Default values for the configuration options can be set here
+staticweb_defaults = [("build_logs", "build_log.txt.gz")]
+
 def read_config(filename):
     parser = SafeConfigParser()
+    parser.add_section("staticweb")
+    for value in staticweb_defaults:
+        parser.set("staticweb", value[0], value[1])
     parser.read([filename])
     return read_config_section(parser, "staticweb", staticweb_desc)
 
@@ -58,6 +65,7 @@
 
     # create web-page on build host
     call(cmdexpand("ssh $build_user$@$build_host $build_create"
+                   " --show-logs=$build_logs"
                    " --status-template=$build_template $build_dir",
                    **config))
 
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)