a `8a\ ã@s4ddlmZmZddlmZdZGdd„deƒZdS)é)ÚMissingRequiredErrorÚ ReadOnlyError)Ú UnicodeMixin)Ú Configurationc@s~eZdZddd„Zdd„Zdd„Zdd „Zd d „Zd d „Zdd„Z dd„Z dd„Z dd„Z dd„Z dd„Zdd„Zdd„ZdS)rNcCs.||jd<i|jd<|D]}||j|j<qdS)NÚ_parentÚ _settings)Ú__dict__rÚname)ÚselfÚsettingsÚparentÚsetting©rúG/home/carl/code/landscape/setoptconf-tmp/build/lib/setoptconf/config.pyÚ__init__ s  zConfiguration.__init__cCsb||jvr>|j|}|jr^|js^|jr4|j |¡q^t|ƒ‚n |jrR|j |¡n td|ƒ‚dS©NzNo such setting "%s")rÚrequiredÚ establishedrÚvalidate_settingrÚAttributeError)r r r rrrrs    zConfiguration.validate_settingcCs|D]}| |¡qdS©N)r©r r rrrÚvalidateszConfiguration.validatecCsd||jvrB|j|jr"|j|jS|jr4t|j|ƒS|j|jSn|jrTt|j|ƒStd|ƒ‚dSr)rrÚvaluerÚgetattrÚdefaultrrrrrÚ __getattr__!s     zConfiguration.__getattr__cCs t||ƒSr)r©r ÚkeyrrrÚ __getitem__.szConfiguration.__getitem__cCs tdƒ‚dS)Nz#Cannot change the value of settings©r)r r rrrrÚ __setattr__1szConfiguration.__setattr__cCst|||ƒdSr)Úsetattr)r rrrrrÚ __setitem__4szConfiguration.__setitem__cCs tdƒ‚dS)NzCannot delete settingsr rrrrÚ __delattr__7szConfiguration.__delattr__cCst||ƒdSr)ÚdelattrrrrrÚ __delitem__:szConfiguration.__delitem__cCs,t|j ¡ƒ}|jr$| t|jƒ¡t|ƒSr)ÚsetrÚkeysrÚupdateÚiter)r Z all_namesrrrÚ__iter__=szConfiguration.__iter__cCsttt|ƒƒƒSr)ÚlenÚlistr*©r rrrÚ__len__CszConfiguration.__len__cCs|tt|ƒƒvSr)r-r*)r ÚitemrrrÚ __contains__FszConfiguration.__contains__csdd ‡fdd„ˆDƒ¡S)NzConfiguration(%s)z, cs g|]}d|tˆ|ƒf‘qS)z%s=%s)Úrepr)Ú.0r r.rrÚ Kóz-Configuration.__unicode__..)Újoinr.rr.rÚ __unicode__IsÿzConfiguration.__unicode__cCs dt|ƒS)Nz<%s>)Ústrr.rrrÚ__repr__NszConfiguration.__repr__)N)Ú__name__Ú __module__Ú __qualname__rrrrrr!r#r$r&r+r/r1r7r9rrrrrs   rN)Ú exceptionrrÚutilrÚ__all__rrrrrÚs