michaelssss / dict4ini

Automatically exported from code.google.com/p/dict4ini
0 stars 0 forks source link

dict4ini didn't paser the comment at same line with value #6

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
i paser supervisor.conf ini file through dict4ini,the file's format like belows:

; Sample supervisor config file.

[unix_http_server]
file=/tmp/supervisor.sock   ; (the path to the socket file)
;chmod=0700                 ; sockef file mode (default 0700)
;chown=nobody:nogroup       ; socket file uid:gid owner
;username=user              ; (default is no username (open server))
;password=123               ; (default is no password (open server))

[inet_http_server]         ; inet (TCP) server disabled by default
port=127.0.0.1:9001        ; (ip_address:port specifier, *:port for all iface)
;username=user              ; (default is no username (open server))
;password=123               ; (default is no password (open server))

it will contain the comment at same line with value,here is the detail code

In [10]: x=dict4ini.DictIni("supervisord.conf",commentdelimeter=";")

In [11]: x.inet_http_server.port
Out[11]: {}

In [12]: x.unix_http_server
Out[12]: {'file': '/tmp/supervisor.sock   ; (the path to the socket file)'}

In [13]: x.inet_http_server
Out[13]: {'port': {}}

In [14]: help(dict4ini.Dict4Ini)

you can see the `file` key has the wrong value,it contains comment content

also the `port` key didn't get any value

Original issue reported on code.google.com by FREDERICK.Mao on 24 Sep 2010 at 3:53

GoogleCodeExporter commented 8 years ago
Because dict4ini doesn't support comments after normal line, so 

file=/tmp/supervisor.sock   ; (the path to the socket file)

is wrong.

Original comment by limo...@gmail.com on 24 Sep 2010 at 10:34