[Inteproxy-commits] r196 - in trunk: . inteproxy test

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Sep 10 21:59:17 CEST 2009


Author: bh
Date: 2009-09-10 21:59:16 +0200 (Thu, 10 Sep 2009)
New Revision: 196

Modified:
   trunk/ChangeLog
   trunk/create-rewrite-rules.py
   trunk/inteproxy/config.py
   trunk/inteproxy/main.py
   trunk/test/test_config.py
   trunk/test/test_transcoder_map.py
Log:
* inteproxy/config.py (read_config): Rename the config object's
hosts attribute to rules to better reflect its new contents

* inteproxy/main.py (run_server),
create-rewrite-rules.py (read_transcoder_map),
test/test_transcoder_map.py (TranscoderMapTest.setUp),
test/test_config.py (TestReadConfigProxyAndOldHosts.test_readconfig)
(TestReadConfigNewHosts.test_readconfig): Adapt to hosts->rules
renaming


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2009-09-10 19:53:10 UTC (rev 195)
+++ trunk/ChangeLog	2009-09-10 19:59:16 UTC (rev 196)
@@ -1,5 +1,17 @@
 2009-09-10  Bernhard Herzog  <bh at intevation.de>
 
+	* inteproxy/config.py (read_config): Rename the config object's
+	hosts attribute to rules to better reflect its new contents
+
+	* inteproxy/main.py (run_server),
+	create-rewrite-rules.py (read_transcoder_map),
+	test/test_transcoder_map.py (TranscoderMapTest.setUp),
+	test/test_config.py (TestReadConfigProxyAndOldHosts.test_readconfig)
+	(TestReadConfigNewHosts.test_readconfig): Adapt to hosts->rules
+	renaming
+
+2009-09-10  Bernhard Herzog  <bh at intevation.de>
+
 	* inteproxy/config.py (read_config): Minor cleanups
 
 2009-09-10  Bernhard Herzog  <bh at intevation.de>

Modified: trunk/create-rewrite-rules.py
===================================================================
--- trunk/create-rewrite-rules.py	2009-09-10 19:53:10 UTC (rev 195)
+++ trunk/create-rewrite-rules.py	2009-09-10 19:59:16 UTC (rev 196)
@@ -61,7 +61,7 @@
     transcoder_map.add_class("undefined", UndefinedTranscoder,
                              UndefinedTranscoder)
     transcoder_map.set_default_class("undefined")
-    transcoder_map.add_hosts(config.hosts)
+    transcoder_map.add_hosts(config.rules)
     return transcoder_map
 
 

Modified: trunk/inteproxy/config.py
===================================================================
--- trunk/inteproxy/config.py	2009-09-10 19:53:10 UTC (rev 195)
+++ trunk/inteproxy/config.py	2009-09-10 19:59:16 UTC (rev 196)
@@ -149,18 +149,18 @@
                                                             proxy_desc))
             sections.discard(section)
 
-    config.hosts = []
+    config.rules = []
 
     if rules_section_name in sections:
         sections.discard(rules_section_name)
         raw_urls = parser.get(rules_section_name, "urls")
         for url in raw_urls.splitlines():
             if url:
-                config.hosts.append(parse_inteproxy_url(url))
+                config.rules.append(parse_inteproxy_url(url))
 
     # handle old host sections
     for section in sections:
-        config.hosts.append(read_config_section(parser, section, host_desc,
+        config.rules.append(read_config_section(parser, section, host_desc,
                                                 settings_class=InteProxyRule))
 
 

Modified: trunk/inteproxy/main.py
===================================================================
--- trunk/inteproxy/main.py	2009-09-10 19:53:10 UTC (rev 195)
+++ trunk/inteproxy/main.py	2009-09-10 19:59:16 UTC (rev 196)
@@ -174,7 +174,7 @@
     HandlerClass.debug_level = opts.debug_level
 
     transcoder_map = inteproxy.transcoder.create_transcoder_map()
-    transcoder_map.add_hosts(config.hosts)
+    transcoder_map.add_hosts(config.rules)
 
     setup_language()
 

Modified: trunk/test/test_config.py
===================================================================
--- trunk/test/test_config.py	2009-09-10 19:53:10 UTC (rev 195)
+++ trunk/test/test_config.py	2009-09-10 19:59:16 UTC (rev 196)
@@ -115,7 +115,7 @@
         self.check_attributes(config.https_proxy,
                               host="localhost", port=8080,
                               username="john", password="secret")
-        self.assertEquals(sorted(config.hosts),
+        self.assertEquals(sorted(config.rules),
                           [InteProxyRule("basicauth",
                                          "wms.example.org",
                                          "/wms"),
@@ -138,7 +138,7 @@
     def test_readconfig(self):
         config = read_config(self.config_file)
         self.check_attributes(config, http_proxy=None, https_proxy=None)
-        self.assertEquals(sorted(config.hosts),
+        self.assertEquals(sorted(config.rules),
                           [InteProxyRule("basicauth", "data.intevation.*", "/",
                                          user="bob", password="tomato"),
                            InteProxyRule("basicauth",

Modified: trunk/test/test_transcoder_map.py
===================================================================
--- trunk/test/test_transcoder_map.py	2009-09-10 19:53:10 UTC (rev 195)
+++ trunk/test/test_transcoder_map.py	2009-09-10 19:59:16 UTC (rev 196)
@@ -24,7 +24,7 @@
         config_filename = self.create_temp_file(self.id(), self.config_contents)
         config = inteproxy.config.read_config(config_filename)
         self.transcoder_map = create_transcoder_map()
-        self.transcoder_map.add_hosts(config.hosts)
+        self.transcoder_map.add_hosts(config.rules)
 
 
 class TestTranscoderMapNoWildcards(TranscoderMapTest):



More information about the Inteproxy-commits mailing list