Tryag File Manager
Home
-
Turbo Force
Current Path :
/
usr
/
lib
/
python2.4
/
Upload File :
New :
File
Dir
//usr/lib/python2.4/ConfigParser.pyo
mò ‚=5Dc�������� ���@���sg��d��Z��d�k�Z�d�d�d�d�d�d�d�d �d �d�d�d �d�g �Z�d�Z�d�Z�d�e�f�d�„��ƒ��YZ�d�e�f�d�„��ƒ��YZ�d�e�f�d�„��ƒ��YZ�d�e�f�d�„��ƒ��YZ �d�e�f�d�„��ƒ��YZ �d�e �f�d�„��ƒ��YZ�d�e �f�d�„��ƒ��YZ�d�e �f�d�„��ƒ��YZ �d�e�f�d�„��ƒ��YZ�d �e�f�d�„��ƒ��YZ�d�f��d�„��ƒ��YZ�d �e�f�d�„��ƒ��YZ�d�e�f�d�„��ƒ��YZ�d�S( ���s��Configuration file parser. A setup file consists of sections, lead by a "[section]" header, and followed by "name: value" entries, with continuations and such in the style of RFC 822. The option values can contain format strings which refer to other values in the same section, or values in a special [DEFAULT] section. For example: something: %(dir)s/whatever would resolve the "%(dir)s" to the value of dir. All reference expansions are done late, on demand. Intrinsic defaults can be specified by passing them into the ConfigParser constructor as a dictionary. class: ConfigParser -- responsible for parsing a list of configuration files, and managing the parsed database. methods: __init__(defaults=None) create the parser and specify a dictionary of intrinsic defaults. The keys must be strings, the values must be appropriate for %()s string interpolation. Note that `__name__' is always an intrinsic default; its value is the section's name. sections() return all the configuration section names, sans DEFAULT has_section(section) return whether the given section exists has_option(section, option) return whether the given option exists in the given section options(section) return list of configuration options for the named section read(filenames) read and parse the list of named configuration files, given by name. A single filename is also allowed. Non-existing files are ignored. Return list of successfully read files. readfp(fp, filename=None) read and parse one configuration file, given as a file object. The filename defaults to fp.name; it is only used in error messages (if fp has no `name' attribute, the string `<???>' is used). get(section, option, raw=False, vars=None) return a string value for the named option. All % interpolations are expanded in the return values, based on the defaults passed into the constructor and the DEFAULT section. Additional substitutions may be provided using the `vars' argument, which must be a dictionary whose contents override any pre-existing defaults. getint(section, options) like get(), but convert value to an integer getfloat(section, options) like get(), but convert value to a float getboolean(section, options) like get(), but convert value to a boolean (currently case insensitively defined as 0, false, no, off for False, and 1, true, yes, on for True). Returns False or True. items(section, raw=False, vars=None) return a list of tuples with (name, value) for each option in the section. remove_section(section) remove the given file section and all its options remove_option(section, option) remove the given option from the given section set(section, option, value) set the given option write(fp) write the configuration state in .ini format Nt���NoSectionErrort���DuplicateSectionErrort ���NoOptionErrort���InterpolationErrort���InterpolationDepthErrort���InterpolationSyntaxErrort���ParsingErrort���MissingSectionHeaderErrort���ConfigParsert���SafeConfigParsert���RawConfigParsert���DEFAULTSECTt���MAX_INTERPOLATION_DEPTHt���DEFAULTi ���t���Errorc�����������B���s)���t��Z�d��Z�d�d�„�Z�d�„��Z�e�Z�RS(���s'���Base class for ConfigParser exceptions.t����c���������C���s���|�|��_�t�i�|��|�ƒ�d��S(���N(���t���msgt���selft���messaget ���Exceptiont���__init__(���R���R���(����(����t"���/usr/lib/python2.4/ConfigParser.pyR���m���s���� c���������C���s���|��i�S(���N(���R���R���(���R���(����(����R���t���__repr__q���s����(���t���__name__t ���__module__t���__doc__R���R���t���__str__(����(����(����R���R���j���s���� c�����������B���s���t��Z�d��Z�d�„��Z�RS(���s2���Raised when no section matches a requested option.c���������C���s$���t��i�|��d�|�f�ƒ�|�|��_�d��S(���Ns���No section: %r(���R���R���R���t���section(���R���R���(����(����R���R���y���s����(���R���R���R���R���(����(����(����R���R����v���s����c�����������B���s���t��Z�d��Z�d�„��Z�RS(���s*���Raised when a section is multiply-created.c���������C���s!���t��i�|��d�|�ƒ�|�|��_�d��S(���Ns���Section %r already exists(���R���R���R���R���(���R���R���(����(����R���R���€���s����(���R���R���R���R���(����(����(����R���R���}���s����c�����������B���s���t��Z�d��Z�d�„��Z�RS(���s!���A requested option was not found.c���������C���s0���t��i�|��d�|�|�f�ƒ�|�|��_�|�|��_�d��S(���Ns���No option %r in section: %r(���R���R���R���t���optionR���(���R���R���R���(����(����R���R���‡���s���� (���R���R���R���R���(����(����(����R���R���„���s����c�����������B���s���t��Z�d��Z�d�„��Z�RS(���s0���Base class for interpolation-related exceptions.c���������C���s&���t��i�|��|�ƒ�|�|��_�|�|��_�d��S(���N(���R���R���R���R���R���R���(���R���R���R���R���(����(����R���R������s���� (���R���R���R���R���(����(����(����R���R������s����t���InterpolationMissingOptionErrorc�����������B���s���t��Z�d��Z�d�„��Z�RS(���sA���A string substitution required a setting which was not available.c���������C���s9���d�|�|�|�|�f�}�t�i�|��|�|�|�ƒ�|�|��_�d��S(���NsN���Bad value substitution: section: [%s] option : %s key : %s rawval : %s (���R���R���t ���referencet���rawvalR���R���R���R���(���R���R���R���R���R���R���(����(����R���R���˜���s����(���R���R���R���R���(����(����(����R���R���•���s����c�����������B���s���t��Z�d��Z�RS(���sj���Raised when the source text into which substitutions are made does not conform to the required syntax.(���R���R���R���(����(����(����R���R���¢���s���c�����������B���s���t��Z�d��Z�d�„��Z�RS(���s0���Raised when substitutions are nested too deeply.c���������C���s-���d�|�|�|�f�}�t�i�|��|�|�|�ƒ�d��S(���NsS���Value interpolation too deeply recursive: section: [%s] option : %s rawval : %s (���R���R���R���R���R���R���R���(���R���R���R���R���R���(����(����R���R���©���s����(���R���R���R���R���(����(����(����R���R���¦���s����c�����������B���s ���t��Z�d��Z�d�„��Z�d�„��Z�RS(���s>���Raised when a configuration file does not follow legal syntax.c���������C���s*���t��i�|��d�|�ƒ�|�|��_�g��|��_�d��S(���Ns ���File contains parsing errors: %s(���R���R���R���t���filenamet���errors(���R���R ���(����(����R���R���´���s���� c���������C���s3���|��i�i�|�|�f�ƒ�|��i�d�|�|�f�7_�d��S(���Ns��� [line %2d]: %s(���R���R!���t���appendt���linenot���lineR���(���R���R#���R$���(����(����R���R"���¹���s����(���R���R���R���R���R"���(����(����(����R���R���±���s���� c�����������B���s���t��Z�d��Z�d�„��Z�RS(���s@���Raised when a key-value pair is found before any section header.c���������C���s<���t��i�|��d�|�|�|�f�ƒ�|�|��_�|�|��_�|�|��_�d��S(���Ns7���File contains no section headers. file: %s, line: %d %r(���R���R���R���R ���R#���R$���(���R���R ���R#���R$���(����(����R���R���À���s ���� (���R���R���R���R���(����(����(����R���R���½���s����c�����������B���s7��t��Z�d��d�„�Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z �d��d�„�Z �d �„��Z�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�d�„��Z�e�i�d�ƒ�Z�e�i�d�ƒ�Z�d�„��Z�RS( ���Nc���������C���sT���h��|��_�h��|��_�|�o7�x4�|�i�ƒ��D]"�\�}�}�|�|��i�|��i�|�ƒ�<q&�Wn�d��S(���N(���R���t ���_sectionst ���_defaultst���defaultst���itemst���keyt���valuet���optionxform(���R���R'���R*���R)���(����(����R���R���Ì���s���� �c���������C���s���|��i�S(���N(���R���R&���(���R���(����(����R���R'���Ó���s����c���������C���s ���|��i�i�ƒ��S(���s3���Return a list of section names, excluding [DEFAULT]N(���R���R%���t���keys(���R���(����(����R���t���sectionsÖ���s�����c���������C���s1���|�|��i�j�o�t�|�ƒ�‚�n�h��|��i�|�<d�S(���s“���Create a new section in the configuration. Raise DuplicateSectionError if a section by the specified name already exists. N(���R���R���R%���R���(���R���R���(����(����R���t���add_sectionÛ���s�����c���������C���s ���|�|��i�j�S(���s~���Indicate whether the named section is present in the configuration. The DEFAULT section is not acknowledged. N(���R���R���R%���(���R���R���(����(����R���t���has_sectionå���s�����c���������C���sk���y�|��i�|�i�ƒ��}�Wn�t�j �o�t�|�ƒ�‚�n�X|�i�|��i�ƒ�d�|�j�o�|�d�=n�|�i �ƒ��S(���s9���Return a list of option names for the given section name.R���N( ���R���R%���R���t���copyt���optst���KeyErrorR����t���updateR&���R,���(���R���R���R1���(����(����R���t���optionsì���s����� c���������C���sˆ���t��|�t�ƒ�o �|�g�}�n�g��}�x^�|�D]V�}�y�t�|�ƒ�}�Wn�t�j �o �q*�n�X|��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. Return list of successfully read files. N(���t ���isinstancet ���filenamest ���basestringt���read_okR ���t���opent���fpt���IOErrorR���t���_readt���closeR"���(���R���R6���R:���R ���R8���(����(����R���t���read÷���s����� � c���������C���sN���|�d�j�o-�y �|�i�}�Wq:�t�j �o �d�}�q:�Xn�|��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. s���<???>N(���R ���t���NoneR:���t���namet���AttributeErrorR���R<���(���R���R:���R ���(����(����R���t���readfp��s����� c���������C���sÇ���|��i�|�ƒ�}�|�|��i�j�oO�|�t�j�o�t�|�ƒ�‚�n�|�|��i�j�o�|��i�|�SqÃ�t �|�|�ƒ�‚�nV�|�|��i�|�j�o�|��i�|�|�Sn/�|�|��i�j�o�|��i�|�Sn�t �|�|�ƒ�‚�d��S(���N( ���R���R+���R���t���optR���R%���R���R����R&���R���(���R���R���R���RC���(����(����R���t���get ��s���� c���������C���sˆ���y�|��i�|�}�Wn6�t�j �o*�|�t�j�o�t�|�ƒ�‚�n�h��}�n�X|��i�i�ƒ��}�|�i �|�ƒ�d�|�j�o�|�d�=n�|�i�ƒ��S(���NR���(���R���R%���R���t���d2R2���R���R����R&���R0���t���dR3���R(���(���R���R���RE���RF���(����(����R���R(���0��s���� c���������C���s���|�|��i�|�|�ƒ�ƒ�S(���N(���t���convR���RD���R���R���(���R���R���RG���R���(����(����R���t���_get=��s����c���������C���s���|��i�|�t�|�ƒ�S(���N(���R���RH���R���t���intR���(���R���R���R���(����(����R���t���getint@��s����c���������C���s���|��i�|�t�|�ƒ�S(���N(���R���RH���R���t���floatR���(���R���R���R���(����(����R���t���getfloatC��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���RD���R���R���t���vt���lowert���_boolean_statest ���ValueError(���R���R���R���RU���(����(����R���t ���getbooleanI��s����c���������C���s ���|�i�ƒ��S(���N(���t ���optionstrRV���(���R���RZ���(����(����R���R+���O��s����c���������C���s���|�p �|�t�j�o �|��i�|�ƒ�}�|�|��i�j�SnI�|�|��i�j�o�t�Sn1�|��i�|�ƒ�}�|�|��i�|�j�p �|�|��i�j�Sd�S(���s=���Check for the existence of a given option in a given section.N(���R���R���R���R+���R���R&���R%���t���False(���R���R���R���(����(����R���t ���has_optionR��s�����c���������C���sl���|�p �|�t�j�o �|��i�}�n4�y�|��i�|�}�Wn�t�j �o�t�|�ƒ�‚�n�X|�|�|��i �|�ƒ�<d�S(���s���Set an option.N(���R���R���R���R&���t���sectdictR%���R2���R����R*���R+���R���(���R���R���R���R*���R]���(����(����R���t���set^��s����� c���������C���s ��|��i�ok�|�i�d�t�ƒ�xF�|��i�i�ƒ��D]5�\�}�}�|�i�d�|�t�|�ƒ�i �d�d�ƒ�f�ƒ�q+�W|�i�d�ƒ�n�x�|��i �D]‚�}�|�i�d�|�ƒ�x[�|��i �|�i�ƒ��D]F�\�}�}�|�d�j�o-�|�i�d�|�t�|�ƒ�i �d�d�ƒ�f�ƒ�qª�qª�W|�i�d�ƒ�q�Wd�S(���s?���Write an .ini-format representation of the configuration state.s���[%s] s���%s = %s s��� s��� R���N(���R���R&���R:���t���writeR���R(���R)���R*���t���strt���replaceR%���R���(���R���R:���R*���R)���R���(����(����R���R_���i��s����� �- �� 1c���������C���s†���|�p �|�t�j�o �|��i�}�n4�y�|��i�|�}�Wn�t�j �o�t�|�ƒ�‚�n�X|��i�|�ƒ�}�|�|�j�}�|�o�|�|�=n�|�S(���s���Remove an option.N(���R���R���R���R&���R]���R%���R2���R����R+���R���t���existed(���R���R���R���Rb���R]���(����(����R���t ���remove_optionx��s����� c���������C���s(���|�|��i�j�}�|�o�|��i�|�=n�|�S(���s���Remove a file section.N(���R���R���R%���Rb���(���R���R���Rb���(����(����R���t���remove_section‡��s �����s���\[(?P<header>[^]]+)\]s9���(?P<option>[^:=\s][^:=]*)\s*(?P<vi>[:=])\s*(?P<value>.*)$c���������C���sÏ��d�}�d�}�d�} �d�}�xŸt�o—|�i�ƒ��}�|�p�Pn�| �d�} �|�i �ƒ��d�j�p�|�d�d�j�o�q�n�|�i �d�d�ƒ�d�i�ƒ��d�j�o�|�d�d�j�o�q�n�|�d�i�ƒ��oG�|�d�j �o:�|�o3�|�i �ƒ��}�|�o�d�|�|�|�f�|�|�<qµq�|��i�i�|�ƒ�}�|�op�|�i�d�ƒ�}�|�|��i�j�o�|��i�|�}�n7�|�t�j�o �|��i�}�n�h��d �|�<}�|�|��i�|�<d�}�q�|�d�j�o�t�|�| �|�ƒ�‚�q�|��i�i�|�ƒ�}�|�oÁ�|�i�d �d�d�ƒ�\�}�}�} �|�d�j�oP�d�| �j�oC�| �i�d�ƒ�} �| �d�j�o#�| �| �d�i�ƒ��o�| �| � } �qBn�| �i �ƒ��} �| �d�j�o �d�} �n�|��i�|�i�ƒ��ƒ�}�| �|�|�<q�|�p�t �|�ƒ�}�n�|�i!�| �t"�|�ƒ�ƒ�q�W|�o �|�‚�n�d�S(���s®��Parse a sectioned setup file. The sections in setup file contains a title line at the top, indicated by a name in square brackets (`[]'), plus key/value options lines, indicated by `name: value' format lines. Continuations are represented by an embedded newline then leading whitespace. Blank lines, lines beginning with a '#', and just about everything else are ignored. i����i���R���s���#;t���remt���rRs���%s %st���headerR���R���t���viR*���t���=t���:t���;iÿÿÿÿs���""N(���Ri���Rj���(#���R?���t���cursectt���optnameR#���t���et���TrueR:���t���readlineR$���t���stript���splitRV���t���isspaceR*���R���t���SECTCREt���matcht���mot���groupt���sectnameR%���R���R&���R���t���fpnamet���OPTCRERh���t���optvalt���findt���posR+���t���rstripR���R"���t���repr(���R���R:���Ry���Rl���Rn���Rm���Rx���Rh���R*���R}���R#���R$���Rv���R{���(����(����R���R<���Ÿ��s`���� �� $4% " (���R���R���R?���R���R'���R-���R.���R/���R4���R>���RB���RD���R(���RH���RJ���RL���Ro���R[���RW���RY���R+���R\���R^���R_���Rc���Rd���t���ret���compileRt���Rz���R<���(����(����(����R���R ���Ë���s0��� N c�����������B���sG���t��Z�e�d��d�„�Z�e�d��d�„�Z�d�„��Z�e�i�d�ƒ�Z �d�„��Z �RS(���Nc���������C���s���|��i�i�ƒ��}�y�|�i�|��i�|�ƒ�Wn0�t�j �o$�|�t�j�o�t �|�ƒ�‚�qZ�n�X|�o4�x1�|�i�ƒ��D]�\�}�}�|�|�|��i�|�ƒ�<qn�Wn�|��i�|�ƒ�}�y�|�|�}�Wn"�t�j �o�t�|�|�ƒ�‚�n�X|�o�|�Sn�|��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���R&���R0���RF���R3���R%���R���R2���R���R����t���varsR(���R)���R*���R+���R���R���t���rawt���_interpolate(���R���R���R���Rƒ���R‚���RF���R*���R)���(����(����R���RD���ï��s&���� � �c��� ��� ���C���s2��|��i�i�ƒ��}�y�|�i�|��i�|�ƒ�Wn0�t�j �o$�|�t�j�o�t �|�ƒ�‚�qZ�n�X|�o4�x1�|�i�ƒ��D]�\�} �}�|�|�|��i�| �ƒ�<qn�Wn�|�i�ƒ��}�d�|�j�o�|�i�d�ƒ�n�|�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. R���N(���R���R&���R0���RF���R3���R%���R���R2���R���R����R‚���R(���R)���R*���R+���R,���R4���t���removeRƒ���t���_[1]R���R„���( ���R���R���Rƒ���R‚���RF���R���R*���R4���R†���R)���(����(����R���R(�����s"����� � -c���������C���sµ���|�}�t�}�x�|�ow�|�d�8}�d�|�j�o[�|��i�i�|��i�|�ƒ�}�y�|�|�}�Wq‰�t �j �o"�}�t�|�|�|�|�d�ƒ�‚�q‰�Xq�Pq�Wd�|�j�o�t�|�|�|�ƒ�‚�n�|�S(���Ni���s���%(i����(���R���R*���R���t���depthR���t���_KEYCREt���subt���_interpolation_replaceR‚���R2���Rn���R���R���R���R���(���R���R���R���R���R‚���Rn���R*���R‡���(����(����R���R„���/��s����� " s���%\(([^)]*)\)s|.c���������C���s?���|�i�d�ƒ�}�|�d��j�o�|�i�ƒ��Sn�d�|��i�|�ƒ�Sd��S(���Ni���s���%%(%s)s(���Ru���Rw���t���sR?���R���R+���(���R���Ru���R‹���(����(����R���RŠ���D��s���� (���R���R���R[���R?���RD���R(���R„���R€���R���Rˆ���RŠ���(����(����(����R���R���í��s ��� c�����������B���s5���t��Z�d�„��Z�e�i�d�ƒ�i�Z�d�„��Z�d�„��Z�RS(���Nc���������C���s/���g��}�|��i�|�|�|�|�|�d�ƒ�d�i�|�ƒ�S(���Ni���R���(���t���LR���t���_interpolate_someR���R���R���R‚���t���join(���R���R���R���R���R‚���RŒ���(����(����R���R„���N��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�|�i�d�ƒ�ƒ�}�|�|�i�ƒ��}�y�|�|�}�Wn(�t�j �o�t�|�|�|�|�ƒ�‚�n�Xd�|�j�o$�|��i�|�|�|�|�|�|�d�ƒ�q¾|�i �|�ƒ�q&�t�|�|�d�|�f�ƒ�‚�q&�Wd��S(���Nt���%i����i���i���t���(s'���bad interpolation variable reference %rs/���'%%' must be followed by '%%' or '(', found: %r(���R‡���R���R���R���R���t���restR|���t���pt���accumR"���t���cR���t���_interpvar_matcht���mR?���R���R+���Rw���t���vart���endt���mapRU���R2���R���R���(���R���R���R“���R‘���R���R™���R‡���R—���R–���R”���R’���RU���(����(����R���R���V��s@���� � c���������C���s:���t��|�t�ƒ�p�t�d�ƒ�‚�n�t�i�|��|�|�|�ƒ�d�S(���sA���Set an option. Extend ConfigParser.set: check for string values.s���option values must be stringsN( ���R5���R*���R7���t ���TypeErrorR���R^���R���R���R���(���R���R���R���R*���(����(����R���R^���|��s�����( ���R���R���R„���R€���R���Ru���R•���R���R^���(����(����(����R���R ���L��s��� &(���R���R€���t���__all__R���R���R���R���R����R���R���R���R���R���R���R���R���R ���R���R ���(���R ���R���R›���R���R���R���R���R���R���R€���R ���R���R���R���R���R����R���(����(����R���t���?X���s$��� - ÿ�#_