Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions localconfig/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ def __setattr__(self, key, value):
else:
return self._config.set(self._section, key, value)

def __contains__(self, key):
"""
Determine if this section has specified attribute

:param str key: Config key to look for
"""
return (self._section, key) in self._config._dot_keys

def __iter__(self):
return self._config.items(self._section)

Expand Down Expand Up @@ -355,6 +363,7 @@ def __getattr__(self, section):
"""
self._read_sources()

section = section.lower()
if section in self._dot_keys:
return self.SectionAccessor(self, section)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name='localconfig',
version='1.1.5',
version='1.1.6',

author='Max Zheng',
author_email='maxzheng.os @t gmail.com',
Expand Down