Kc@sdZddlZddlmZmZmZmZmZmZm Z m Z ddlm Z m Z m Z mZddlZdefdYZdefdYZd efd YZd efd YZdS( s(Compatibility interfaces for ConfigParser Interfaces of ConfigParser, RawConfigParser and SafeConfigParser should be completely identical to the Python standard library versions. Tested with the unit tests included with Python-2.3.4 The underlying INIConfig object can be accessed as cfg.data iN(tDuplicateSectionErrortNoSectionErrort NoOptionErrortInterpolationMissingOptionErrortInterpolationDepthErrortInterpolationSyntaxErrort DEFAULTSECTtMAX_INTERPOLATION_DEPTH(tErrortInterpolationErrortMissingSectionHeaderErrort ParsingErrortRawConfigParsercBseZdedZdZdZdZdZdZ dZ dZ ddZ dd Z d Zd Zd Zied 6ed6ed6ed6ed6ed6ed6ed6ZdZdZdZdZdZdZRS(cCs:|tkrtdntjd|d||_dS(NsCustom dict types not supportedtdefaultstoptionxformsource(tdictt ValueErrortinit INIConfigtdata(tselfR t dict_type((s3/usr/lib/python2.7/site-packages/iniparse/compat.pyt__init__s cCs |jS(N(tlower(Rt optionstr((s3/usr/lib/python2.7/site-packages/iniparse/compat.pyt optionxform#scCs=i}|jj}x$|jD]}|j|||' is used. N(RR-(RR2R1((s3/usr/lib/python2.7/site-packages/iniparse/compat.pytreadfpgscCs||j|st|n|dk rC||krC||}n|j|}||kri|j|St||dS(N(R#RtNoneRRR(RR%toptiontvarstvaluetsec((s3/usr/lib/python2.7/site-packages/iniparse/compat.pytgetqs    cCs`||jkrPg}x4|j|D]%}|j||j||fq#W|St|dS(N(RR,R:R(RR%tanstopt((s3/usr/lib/python2.7/site-packages/iniparse/compat.pytitems}s #cCst|j||S(N(tintR:(RR%R6((s3/usr/lib/python2.7/site-packages/iniparse/compat.pytgetintscCst|j||S(N(tfloatR:(RR%R6((s3/usr/lib/python2.7/site-packages/iniparse/compat.pytgetfloatst1tyesttruetont0tnotfalsetoffcCsH|j||}|j|jkr7td|n|j|jS(NsNot a boolean: %s(R:Rt_boolean_statesR(RR%R6tv((s3/usr/lib/python2.7/site-packages/iniparse/compat.pyt getbooleanscCs5||jkr|j|}n t|||kS(s=Check for the existence of a given option in a given section.(RR(RR%R6R9((s3/usr/lib/python2.7/site-packages/iniparse/compat.pyt has_options cCs3||jkr#||j|| s : " N