diff --git a/ChangeLog b/ChangeLog index e78cf93f..1dbcc36b 100755 --- a/ChangeLog +++ b/ChangeLog @@ -29,6 +29,10 @@ Features: * :issue:`194` - Added pre_argument_parsing/post_argument_parsing hooks * :issue:`196` - Added utils.misc.wrap +Incompatible: + + * :issue:`173` - Deprecated 'has_key()' from configparser extension + 2.1.2 - Thu Nov 1st, 2012 (DEVELOPMENT) ------------------------------------------------------------------------------ diff --git a/cement/core/config.py b/cement/core/config.py index 11371c9f..366bc8b8 100644 --- a/cement/core/config.py +++ b/cement/core/config.py @@ -8,7 +8,6 @@ def config_validator(klass, obj): members = [ '_setup', 'keys', - 'has_key', 'get_sections', 'get_section_dict', 'get', diff --git a/cement/ext/ext_configparser.py b/cement/ext/ext_configparser.py index 494671ba..c0779746 100644 --- a/cement/ext/ext_configparser.py +++ b/cement/ext/ext_configparser.py @@ -98,38 +98,6 @@ class ConfigParserConfigHandler(config.CementConfigHandler, RawConfigParser): """ return self.options(section) - def has_key(self, section, key): - """ - Return whether or not a 'section' has the given 'key'. - - :param section: The section of the configuration. - I.e. [block_section]. - :param key: The key within 'section'. - :returns: True if the config `section` has `key`. - :rtype: boolean - - *This function is deprecated as of Cement 2.1.1, and will be removed - in future versions. Use `if 'key' in config.keys('section')` - instead.* - """ - if self.app._meta.ignore_deprecation_warnings: - LOG.debug("ConfigParserConfigHandler.has_key() is " + - "deprecated as of Cement 2.1.1. Please use " + - "`if key in app.config.keys(section)` " + - "instead.") - else: - LOG.warn("ConfigParserConfigHandler.has_key() is " + - "deprecated as of Cement 2.1.1. Please use " + - "`if key in app.config.keys(section)` " + - "instead. You can disable this warning by setting " + - "`ignore_deprecation_warnings = true` under the " + - "applications primary config section.") - - if key in self.keys(section): - return True - else: - return False - def get_sections(self): """ Return a list of configuration sections or [blocks]. diff --git a/scripts/devtools.py b/scripts/devtools.py index 2fd235a3..6ec573d2 100755 --- a/scripts/devtools.py +++ b/scripts/devtools.py @@ -88,6 +88,8 @@ class CementDevtoolsController(CementBaseController): @expose(help='run all unit tests') def run_tests(self): + print('') + print('Python Version: %s' % sys.version) print('') print("Running Tests for Cement Version %s" % VERSION) print('-' * 77) diff --git a/tests/ext/configparser_tests.py b/tests/ext/configparser_tests.py index b833496a..f46ec5e8 100644 --- a/tests/ext/configparser_tests.py +++ b/tests/ext/configparser_tests.py @@ -3,18 +3,4 @@ from cement.utils import test from cement.utils.misc import init_defaults class ConfigParserConfigHandlerTestCase(test.CementTestCase): - def test_has_key(self): - defaults = init_defaults('test') - defaults['test']['foo'] = 'bar' - app = self.make_app(config_defaults=defaults) - app.setup() - self.eq(app.config.has_key('test', 'bogus'), False) - self.eq(app.config.has_key('test', 'foo'), True) - - # same thing but ignore deprecation warning - app = self.make_app( - config_defaults=defaults, - ignore_deprecation_warnings=True - ) - app.setup() - self.eq(app.config.has_key('test', 'bogus'), False) \ No newline at end of file + pass \ No newline at end of file