Browse Source

[trac547] renamed the method name according to consideration of the meaning of the original class

Naoki Kambe 14 years ago
parent
commit
160b062120
2 changed files with 6 additions and 6 deletions
  1. 1 1
      src/bin/stats/stats_httpd.py.in
  2. 5 5
      src/bin/stats/tests/isc/config/ccsession.py

+ 1 - 1
src/bin/stats/stats_httpd.py.in

@@ -191,7 +191,7 @@ class StatsHttpd:
             self.config = DEFAULT_CONFIG
             self.config.update(
                 dict([
-                        (itm['item_name'], self.mccs.get_value(itm['item_name'])[0])
+                        (itm['item_name'], self.mccs.get_default_value(itm['item_name'])[0])
                         for itm in self.mccs.get_module_spec().get_config_spec()
                         ])
                 )

+ 5 - 5
src/bin/stats/tests/isc/config/ccsession.py

@@ -87,12 +87,12 @@ class ConfigData:
     def __init__(self, specification):
         self.specification = specification
 
-    def get_value(self, identifier):
+    def get_default_value(self, identifier):
         """Returns a tuple where the first item is the value at the
            given identifier, and the second item is a bool which is
            true if the value is an unset default. Raises an
            DataNotFoundError if the identifier is bad"""
-        def _get_value(config_map):
+        def _get_default_value(config_map):
                 if 'item_default' in config_map:
                     return config_map['item_default'], False
                 elif 'item_type' in config_map:
@@ -105,16 +105,16 @@ class ConfigData:
                     elif config_map['item_type'] in set(['float', 'double', 'real']):
                         return float(), True
                     elif config_map['item_type'] in set(['list', 'array']):
-                        return [ _get_value(conf)
+                        return [ _get_default_value(conf)
                                  for conf in spec['list_item_spec'] ], True
                     elif config_map['item_type'] in set(['map', 'object']):
                         return dict(
-                            [ (conf['item_name'], _get_value(conf))
+                            [ (conf['item_name'], _get_default_value(conf))
                               for conf in config_map['map_item_spec'] ]), True
                 return None, True
         for config_map in self.get_module_spec().get_config_spec():
             if config_map['item_name'] == identifier:
-                return _get_value(config_map)
+                return _get_default_value(config_map)
         raise DataNotFoundError("item_name %s is not found in the specfile" % identifier)
 
     def get_module_spec(self):