From: Naoki Kambe Date: Mon, 26 Nov 2012 04:59:57 +0000 (+0900) Subject: [2225_statistics] make Counter class hidden(rename Counter to _Counter), add Counter... X-Git-Tag: bind10-1.1.0beta1-release~72^2~40^2~81 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=57e46e4378c4d8b8dd39cca093500672fa124e42;p=thirdparty%2Fkea.git [2225_statistics] make Counter class hidden(rename Counter to _Counter), add Counter class, and move empty methods in it. --- diff --git a/src/lib/python/isc/statistics/counter.py b/src/lib/python/isc/statistics/counter.py index 54db3cfb21..a0862b2403 100644 --- a/src/lib/python/isc/statistics/counter.py +++ b/src/lib/python/isc/statistics/counter.py @@ -84,7 +84,7 @@ def init(spec_file_name): module_spec = isc.config.module_spec_from_file(spec_file_name) class_name = '%sCounter' % module_spec.get_module_name() global _COUNTER - if issubclass(_COUNTER.__class__, Counter): + if issubclass(_COUNTER.__class__, _Counter): # already loaded return _COUNTER # create an instance once @@ -93,15 +93,6 @@ def init(spec_file_name): globals().update(_COUNTER._to_global) return _COUNTER -# These method are dummies for notify_out in case XfroutCounter is not -# loaded. -def inc_notifyoutv4(self, arg): - """An empty method to be disclosed""" - pass -def inc_notifyoutv6(self, arg): - """An empty method to be disclosed""" - pass - # static internal functions def _add_counter(element, spec, identifier): """Returns value of the identifier if the identifier is in the @@ -169,6 +160,16 @@ def _stop_timer(start_time, element, spec, identifier): _set_counter(element, spec, identifier, sec) class Counter(): + # These method are dummies for notify_out in case XfroutCounter is not + # loaded. + def inc_notifyoutv4(arg): + """An empty method to be disclosed""" + pass + def inc_notifyoutv6(arg): + """An empty method to be disclosed""" + pass + +class _Counter(): """A basic counter class for concrete classes""" # '_SERVER_' is a special zone name representing an entire