|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /proc/21573/root/usr/lib/python2.4/site-packages/iniparse/ |
Upload File : |
mò
p[Gc @ s, d Z d k Z d k Z d k l Z d k l Z l Z l 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 d „ Z d e i f d „ ƒ YZ d „ Z d „ Z d e i f d „ ƒ YZ d S( s” Access and/or modify INI files
* Compatiable with ConfigParser
* Preserves order of sections & options
* Preserves comments/blank lines/etc
* More conveninet access to data
Example:
>>> from StringIO import StringIO
>>> sio = StringIO('''# configure foo-application
... [foo]
... bar1 = qualia
... bar2 = 1977
... [foo-ext]
... special = 1''')
>>> cfg = INIConfig(sio)
>>> print cfg.foo.bar1
qualia
>>> print cfg['foo-ext'].special
1
>>> cfg.foo.newopt = 'hi!'
>>> print cfg
# configure foo-application
[foo]
bar1 = qualia
bar2 = 1977
newopt = hi!
[foo-ext]
special = 1
N( s Set( s DEFAULTSECTs ParsingErrors MissingSectionHeaderErrort LineTypec B s5 t Z d Z d d „ Z d „ Z d „ Z d „ Z RS( Nc C s' | d j o | i d ƒ | _ n d S( Ns
( t linet Nonet stript self( R R ( ( t0 /usr/lib/python2.4/site-packages/iniparse/ini.pyt __init__4 s
c C s) | i d j o | i Sn | i ƒ Sd S( N( R R R t to_string( R ( ( R t __str__: s c C s2 t | | ƒ o d | i d <n | | i | <d S( NR ( t hasattrR t nameR t __dict__t value( R R
R ( ( R t __setattr__B s c C s t d ƒ ‚ d S( Ns1 This method must be overridden in derived classes( t Exception( R ( ( R R G s ( t __name__t
__module__R R R R R
R ( ( ( R R 1 s
t SectionLinec B sJ t Z e i d ƒ Z d d d d d „ Z d „ Z d „ Z e e ƒ Z RS( Ns7 ^\[(?P<name>[^]]+)\]\s*((?P<csep>;|#)(?P<comment>.*))?$iÿÿÿÿc C s>