What if i want to pass mixed data?Like with the following python script:
---------------------------------------------------------------------------------------------------------------------------
#!/usr/bin/python
import json
conf={'host':'10.0.0.11','port':8000,'pass':'MyPASSS','mount':'stream.ogg'}
print(json.dumps(conf))

-----------------------------------------------------------------------------------------------------------------------------

Em 30 de agosto de 2011 10:01, Romain Beauxis <[email protected]>escreveu:

> Hi!
>
> 2011/8/30 Fábio Costa <[email protected]>:
> > No problem Romain i got a of_json feature up and working, just installed
> the
> > libjson-wheel-ocaml-dev that David told.
> > I am just with some problem with null comparison and with types.
> > If i pass an int in the json like {"port":8000}, the of_json function
> > breaks.
> > if i pass {"port":"8000"} it works but then the liquidsoap says it
> shouldn't
> > be a string when i try to use it as a port number.
> > I'll figure type conversion out thogh.
>
> I think you should be able to make it work this way:
>  result = of_json(default=[("foo", 1234)], " {\"port\":8000} ")
>
> Here, I have:
>  liquidsoap 'print(of_json(default=[("foo", 1234)], " {\"port\":8000} "))'
>    [("port",8000)]
>
> The important part if the type of the default value because it tells
> liquidsoap how to parse the json string you are giving it..
>
> Romain
>
------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to