[Inteproxy-commits] r202 - in trunk: . inteproxy

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Sep 10 22:24:13 CEST 2009


Author: bh
Date: 2009-09-10 22:24:12 +0200 (Thu, 10 Sep 2009)
New Revision: 202

Modified:
   trunk/ChangeLog
   trunk/inteproxy/transcoder.py
Log:
* inteproxy/transcoder.py (TranscoderMap.add_rule)
(TranscoderMap.lookup): Store the actual InteProxyRule in the list
of rules, not just the scheme


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2009-09-10 20:14:29 UTC (rev 201)
+++ trunk/ChangeLog	2009-09-10 20:24:12 UTC (rev 202)
@@ -1,5 +1,11 @@
 2009-09-10  Bernhard Herzog  <bh at intevation.de>
 
+	* inteproxy/transcoder.py (TranscoderMap.add_rule)
+	(TranscoderMap.lookup): Store the actual InteProxyRule in the list
+	of rules, not just the scheme
+
+2009-09-10  Bernhard Herzog  <bh at intevation.de>
+
 	* inteproxy/transcoder.py
 	(TranscoderMap.add_host, TranscoderMap.add_hosts): Removed.  These
 	methods are now unused.

Modified: trunk/inteproxy/transcoder.py
===================================================================
--- trunk/inteproxy/transcoder.py	2009-09-10 20:14:29 UTC (rev 201)
+++ trunk/inteproxy/transcoder.py	2009-09-10 20:24:12 UTC (rev 202)
@@ -199,7 +199,7 @@
         self.rules.append((re.compile(pattern_to_regex(rule.host,
                                                        character_set="[^/]")),
                            re.compile(pattern_to_regex(rule.path)),
-                           rule.scheme))
+                           rule))
 
     def add_rules(self, rules):
         """Adds all transcoder rules in rules"""
@@ -209,11 +209,12 @@
     def lookup(self, method, host, path):
         """Returns the python class implementing the transcoder for path on host
         """
-        for host_regex, path_regex, classname in self.rules:
+        for host_regex, path_regex, rule in self.rules:
             host_match = host_regex.match(host)
             if host_match and host_match.group(0) == host:
                 path_match = path_regex.match(path)
                 if path_match and path_match.group(0) == path:
+                    classname = rule.scheme
                     break
         else:
             classname = self.default_classname



More information about the Inteproxy-commits mailing list