Tryag File Manager
Home
-
Turbo Force
Current Path :
/
usr
/
lib
/
python2.4
/
site-packages
/
iniparse
/
Upload File :
New :
File
Dir
//usr/lib/python2.4/site-packages/iniparse/compat.pyc
mò >³ Pc�����������@���sÊ���d��Z��d�k�Z�d�k�l�Z�l�Z�l�Z�l�Z�l�Z�l�Z�l �Z �l �Z �d�k�l�Z�l�Z�l �Z �l�Z�d�k�Z�d�e�f�d�„��ƒ��YZ�d�e�f�d�„��ƒ��YZ�d�e�f�d �„��ƒ��YZ�d �e�f�d�„��ƒ��YZ�d�S(���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 N(���s���DuplicateSectionErrors���NoSectionErrors ���NoOptionErrors���InterpolationMissingOptionErrors���InterpolationDepthErrors���InterpolationSyntaxErrors���DEFAULTSECTs���MAX_INTERPOLATION_DEPTH(���s���Errors���InterpolationErrors���MissingSectionHeaderErrors���ParsingErrort���RawConfigParserc�����������B���s ��t��Z�d��d�„�Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z �d�„��Z �d��d �„�Z�d��d �„�Z�d�„��Z �d�„��Z�d �„��Z�h��d�e�<d�e�<d�e�<d�e�<d�e�<d�e�<d�e�<d�e�<Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z�RS(���Nc���������C���s���t��i�d�|�d�|��ƒ�|��_�d��S(���Nt���defaultst���optionxformsource(���t���init ���INIConfigR���t���selft���data(���R���R���(����(����t3���/usr/lib/python2.4/site-packages/iniparse/compat.pyt���__init__���s����c���������C���s ���|�i�ƒ��S(���N(���t ���optionstrt���lower(���R���R ���(����(����R���t���optionxform!���s����c���������C���s=���h��}�x0�|��i�i�i�i�ƒ��D]�\�}�}�|�i�|�|�<q�W|�S(���N( ���t���dR���R���t ���_defaultst���_optionst���itemst���namet���lineobjt���value(���R���R���R���R���(����(����R���R���$���s �����c���������C���s ���t��|��i�ƒ�S(���s3���Return a list of section names, excluding [DEFAULT]N(���t���listR���R���(���R���(����(����R���t���sections*���s�����c���������C���s4���|��i�|�ƒ�o�t�|�ƒ�‚�n�|��i�i�|�ƒ�d�S(���s“���Create a new section in the configuration. Raise DuplicateSectionError if a section by the specified name already exists. N(���R���t���has_sectiont���sectiont���DuplicateSectionErrorR���t ���new_namespace(���R���R���(����(����R���t���add_section.���s�����c���������C���s1���y�|��i�|�t�SWn�t�j �o�t�Sn�Xd�S(���s~���Indicate whether the named section is present in the configuration. The DEFAULT section is not acknowledged. N(���R���R���R���t���Truet���KeyErrort���False(���R���R���(����(����R���R���9���s�����c���������C���s;���y�t��|��i�|�ƒ�SWn�t�j �o�t�|�ƒ�‚�n�Xd�S(���s9���Return a list of option names for the given section name.N(���R���R���R���R���R���t���NoSectionError(���R���R���(����(����R���t���optionsD���s �����c���������C���sˆ���g��}�t�|�t�ƒ�o �|�g�}�n�x^�|�D]V�}�y�t�|�ƒ�}�Wn�t�j �o �q*�n�X|�i�|�ƒ�|��i �i�|�ƒ�|�i�ƒ��q*�W|�S(���s£��Read and parse a filename or a list of filenames. Files that cannot be opened are silently ignored; this is designed so that you can specify a list of potential configuration file locations (e.g. current directory, user's home directory, systemwide directory), and all existing configuration files in the list will be read. A single filename may also be given. N( ���t ���files_readt ���isinstancet ���filenamest ���basestringt���filenamet���opent���fpt���IOErrort���appendR���R���t���readfpt���close(���R���R!���R%���R#���R���(����(����R���t���readK���s���� � � c���������C���s���|��i�i�|�ƒ�d�S(���s��Like read() but the argument must be a file-like object. The `fp' argument must have a `readline' method. Optional second argument is the `filename', which if not given, is taken from fp.name. If fp has no `name' attribute, `<???>' is used. N(���R���R���R(���R%���(���R���R%���R#���(����(����R���R(���b���s�����c���������C���s„���|��i�|�ƒ�p�t�|�ƒ�‚�n�|�d��j �o�|�|�j�o�|�|�}�n�y�|��i�|�|�SWn"�t �j �o�t �|�|�ƒ�‚�n�Xd��S(���N(���R���R���R���R���t���varst���Nonet���optionR���R���R���t ���NoOptionError(���R���R���R-���R+���R���(����(����R���t���getl���s����c���������C���sk���yE�g��}�x4�|��i�|�D]%�}�|�i�|�|��i�|�|�ƒ�f�ƒ�q�W|�SWn�t�j �o�t�|�ƒ�‚�n�Xd��S(���N( ���t���ansR���R���R���t���optR'���R/���R���R���(���R���R���R1���R0���(����(����R���R���v���s�����#c���������C���s���t��|��i�|�|�ƒ�ƒ�S(���N(���t���intR���R/���R���R-���(���R���R���R-���(����(����R���t���getint���s����c���������C���s���t��|��i�|�|�ƒ�ƒ�S(���N(���t���floatR���R/���R���R-���(���R���R���R-���(����(����R���t���getfloat‚���s����t���1t���yest���truet���ont���0t���not���falset���offc���������C���sJ���|��i�|�|�ƒ�}�|�i�ƒ��|��i�j�o�t�d�|�‚�n�|��i�|�i�ƒ��S(���Ns���Not a boolean: %s(���R���R/���R���R-���t���vR ���t���_boolean_statest ���ValueError(���R���R���R-���R>���(����(����R���t ���getbooleanˆ���s����c���������C���sa���y�|��i�|�}�Wn�t�j �o�t�|�ƒ�‚�n�Xy�|�|�t�SWn�t�j �o�t�Sn�Xd�S(���s=���Check for the existence of a given option in a given section.N( ���R���R���R���t���secR���R���R-���R���R���(���R���R���R-���RB���(����(����R���t ���has_optionŽ���s�����c���������C���s;���y�|�|��i�|�|�<Wn�t�j �o�t�|�ƒ�‚�n�Xd�S(���s���Set an option.N(���R���R���R���R���R-���R���R���(���R���R���R-���R���(����(����R���t���setš���s �����c���������C���s���|�i�t�|��i�ƒ�ƒ�d�S(���s?���Write an .ini-format representation of the configuration state.N(���R%���t���writet���strR���R���(���R���R%���(����(����R���RE���¡���s�����c���������C���sh���y�|��i�|�}�Wn�t�j �o�t�|�ƒ�‚�n�Xy�|�|�|�|�=d�SWn�t�j �o�d�Sn�Xd�S(���s���Remove an option.i���i����N(���R���R���R���RB���R���R���R-���(���R���R���R-���RB���(����(����R���t ���remove_option¥���s�����c���������C���s&���|��i�|�ƒ�p�t�Sn�|��i�|�=t�S(���s���Remove a file section.N(���R���R���R���R���R���R���(���R���R���(����(����R���t���remove_section²���s ����� (���t���__name__t ���__module__R,���R���R���R���R���R���R���R���R*���R(���R/���R���R3���R5���R���R���R?���RA���RC���RD���RE���RG���RH���(����(����(����R���R�������s(��� N t ���ConfigDictc�����������B���s ���t��Z�d��Z�d�„��Z�d�„��Z�RS(���s*���Present a dict interface to a ini section.c���������C���s���|�|��_��|�|��_�|�|��_�d��S(���N(���t���cfgR���R���R+���(���R���RL���R���R+���(����(����R���R���½���s���� c���������C���sO���y#�t��i�|��i�|��i�|�|��i�ƒ�SWn%�t�t�f�j �o�t �|�ƒ�‚�n�Xd��S(���N( ���R����R/���R���RL���R���t���keyR+���R.���R���R���(���R���RM���(����(����R���t���__getitem__Â���s����#(���RI���RJ���t���__doc__R���RN���(����(����(����R���RK���º���s���� t���ConfigParserc�����������B���s/���t��Z�e�d��d�„�Z�d�„��Z�e�d��d�„�Z�RS(���Nc���������C���s���|�t�j�o!�|��i�|�ƒ�o�t�|�ƒ�‚�n�|��i�|�ƒ�}�t�i�|��|�|�|�ƒ�}�|�o�|�Sn)�t�|��|�|�ƒ�}�|��i�|�|�|�|�ƒ�Sd�S(���s®��Get an option value for a given section. All % interpolations are expanded in the return values, based on the defaults passed into the constructor, unless the optional argument `raw' is true. Additional substitutions may be provided using the `vars' argument, which must be a dictionary whose contents overrides any pre-existing defaults. The section DEFAULT is special. N(���R���t���DEFAULTSECTR���R���R���R���R-���R����R/���R+���R���t���rawRK���R���t���_interpolate(���R���R���R-���RR���R+���R���R���(����(����R���R/���Ë���s���� �c���������C���s¦���|�}�t�}�xg�|�o_�|�d�8}�d�|�j�oC�y�|�|�}�Wqq�t�j �o"�}�t�|�|�|�|�d�ƒ�‚�qq�Xq�Pq�W|�i �d�ƒ�d�j�o�t�|�|�|�ƒ�‚�n�|�S(���Ni���s���%(i����iÿÿÿÿ(���t���rawvalR���t���MAX_INTERPOLATION_DEPTHt���depthR+���R���t���et���InterpolationMissingOptionErrorR-���R���t���findt���InterpolationDepthError(���R���R���R-���RT���R+���RW���R���RV���(����(����R���RS���â���s����� "c��� ��� ���C���sD��|�t�j�o!�|��i�|�ƒ�o�t�|�ƒ�‚�n�|�d�j�o�t�|��i�|�ƒ�}�nP�g��}�x3�|��i�|�D]$�}�|�|�j�o�|�i�|�ƒ�qf�qf�W|�i�|�i �ƒ��ƒ�d�|�j�o�|�i�d�ƒ�n�t�|��|�|�ƒ�}�|�o-�g��}�|�D]�}�|�|�|�|�f�qã�~�Sn<�g��}�|�D])�}�|�|�|��i�|�|�|�|�|�ƒ�f�q~�Sd�S(���sØ��Return a list of tuples with (name, value) for each option in the section. All % interpolations are expanded in the return values, based on the defaults passed into the constructor, unless the optional argument `raw' is true. Additional substitutions may be provided using the `vars' argument, which must be a dictionary whose contents overrides any pre-existing defaults. The section DEFAULT is special. RI���N(���R���RQ���R���R���R���R+���R,���R���R���R���t���xR'���t���extendt���keyst���removeRK���R���RR���t���_[1]R-���RS���( ���R���R���RR���R+���R���R_���R-���R[���R���(����(����R���R���ô���s"����� � -(���RI���RJ���R���R,���R/���RS���R���(����(����(����R���RP���É���s��� t���SafeConfigParserc�����������B���s5���t��Z�d�„��Z�d�„��Z�e�i�d�ƒ�i�Z�d�„��Z�RS(���Nc���������C���s:���t��|�t�ƒ�p�t�d�ƒ�‚�n�t�i�|��|�|�|�ƒ�d��S(���Ns���option values must be strings( ���R ���R���R"���t ���TypeErrorRP���RD���R���R���R-���(���R���R���R-���R���(����(����R���RD�����s����c���������C���s/���g��}�|��i�|�|�|�|�|�d�ƒ�d�i�|�ƒ�S(���Ni���t����(���t���LR���t���_interpolate_someR-���RT���R���R+���t���join(���R���R���R-���RT���R+���Rc���(����(����R���RS�����s����s ���%\(([^)]+)\)sc���������C���s¼��|�t�j�o�t�|�|�|�ƒ�‚�n�x’|�oŠ|�i�d�ƒ�} �| �d�j��o�|�i �|�ƒ�d��Sn�| �d�j�o�|�i �|�| � ƒ�|�| �}�n�|�d�d�!} �| �d�j�o�|�i �d�ƒ�|�d�}�q&�| �d�j�oÐ�|��i�|�ƒ�}�|�d��j�o�t�|�|�d�|�ƒ�‚�n�|�i�d�ƒ�}�|�|�i�ƒ��}�y�|�|�}�Wn(�t�j �o�t�|�|�|�|�ƒ�‚�n�Xd�|�j�o$�|��i�|�|�|�|�|�|�d�ƒ�q³|�i �|�ƒ�q&�t�|�|�d�|� ƒ�‚�q&�Wd��S(���Nt���%i����i���i���t���(s'���bad interpolation variable reference %rs+���'%' must be followed by '%' or '(', found: (���RV���RU���RZ���R-���R���t���restRY���t���pt���accumR'���t���cR���t���_interpvar_matcht���mR,���t���InterpolationSyntaxErrort���groupt���vart���endt���mapR>���R���RX���Rd���(���R���R-���Rj���Rh���R���Rr���RV���Rp���Rm���Rk���Ri���R>���(����(����R���Rd���%��s@���� � ( ���RI���RJ���RD���RS���t���ret���compilet���matchRl���Rd���(����(����(����R���R`�����s��� (���RO���Rs���RP���R���R���R.���RX���RZ���Rn���RQ���RU���t���Errort���InterpolationErrort���MissingSectionHeaderErrort���ParsingErrorR���t���objectR����RK���R`���(���R`���RZ���RQ���Rx���RX���Rv���RK���Rw���Rn���Rs���R����RU���R���Ry���R���R.���R���RP���(����(����R���t���?���s��� 7 N