incubator-bloodhound-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1438019 - /incubator/bloodhound/branches/bep_0003_multiproduct/trac/trac/config.py
Date Thu, 24 Jan 2013 14:34:54 GMT
Author: jure
Date: Thu Jan 24 14:34:53 2013
New Revision: 1438019

URL: http://svn.apache.org/viewvc?rev=1438019&view=rev
Log:
#115, t115_r1436300_option_accessor.diff applied, polymorphic access to Section methods in
Option accessor (from Olemis)


Modified:
    incubator/bloodhound/branches/bep_0003_multiproduct/trac/trac/config.py

Modified: incubator/bloodhound/branches/bep_0003_multiproduct/trac/trac/config.py
URL: http://svn.apache.org/viewvc/incubator/bloodhound/branches/bep_0003_multiproduct/trac/trac/config.py?rev=1438019&r1=1438018&r2=1438019&view=diff
==============================================================================
--- incubator/bloodhound/branches/bep_0003_multiproduct/trac/trac/config.py (original)
+++ incubator/bloodhound/branches/bep_0003_multiproduct/trac/trac/config.py Thu Jan 24 14:34:53
2013
@@ -567,7 +567,9 @@ class Option(object):
     """Descriptor for configuration options."""
 
     registry = {}
-    accessor = Section.get
+
+    def accessor(self, section, name, default):
+        return section.get(name, default)
 
     @staticmethod
     def get_registry(compmgr=None):
@@ -615,17 +617,20 @@ class Option(object):
 
 class BoolOption(Option):
     """Descriptor for boolean configuration options."""
-    accessor = Section.getbool
+    def accessor(self, section, name, default):
+        return section.getbool(name, default)
 
 
 class IntOption(Option):
     """Descriptor for integer configuration options."""
-    accessor = Section.getint
+    def accessor(self, section, name, default):
+        return section.getint(name, default)
 
 
 class FloatOption(Option):
     """Descriptor for float configuration options."""
-    accessor = Section.getfloat
+    def accessor(self, section, name, default):
+        return section.getfloat(name, default)
 
 
 class ListOption(Option):
@@ -673,7 +678,8 @@ class PathOption(Option):
     Relative paths are resolved to absolute paths using the directory
     containing the configuration file as the reference.
     """
-    accessor = Section.getpath
+    def accessor(self, section, name, default):
+        return section.getpath(name, default)
 
 
 class ExtensionOption(Option):



Mime
View raw message