# HG changeset patch # User Paul Boddie # Date 1316211164 -7200 # Node ID 659dbbadf40835ce024cf1ca2e5413814dbfcecd # Parent 0aa7a495381baa562d9941d77873656ef7b495ce Added a method that shows the configuration settings including computed settings. diff -r 0aa7a495381b -r 659dbbadf408 moinsetup.py --- a/moinsetup.py Fri Sep 16 00:35:03 2011 +0200 +++ b/moinsetup.py Sat Sep 17 00:12:44 2011 +0200 @@ -287,6 +287,7 @@ "A class for installing and initialising MoinMoin." method_names = ( + "show_config", "setup", "setup_wiki", "install_moin", @@ -318,6 +319,21 @@ "install_page_package", ) + source_config_names = ( + "moin_distribution", "prefix", "site_packages", "htdocs_dir_source" + ) + + instance_config_names = ( + "common_dir", "farm_config", "site_config", + "site_name", "site_identifier", + "front_page_name", "superuser", "theme_default", "htdocs_dir" + ) + + site_config_names = ( + "web_app_dir", "web_site_dir", "web_static_dir", + "url_path", "static_url_path" + ) + # NOTE: Need to detect Web server user. web_user = "www-data" @@ -455,6 +471,19 @@ else: self.htdocs_dir = join(self.web_static_dir or self.common_dir, "htdocs") + def show_config(self): + + "Show the configuration." + + print + for section in ("source", "instance", "site"): + print section.title() + print "-" * len(section) + print + for setting in getattr(self, "%s_config_names" % section): + print "%-20s%s" % (setting, getattr(self, setting)) + print + def _get_abspath(self, d): return d and abspath(d) or None