Thanks a lot okay_awright it worked.

Em 30 de agosto de 2011 11:57, okay_awright <[email protected]>escreveu:

> pass every value as Strings (even Null values, e.g. make it an empty
> String, or even better, do not propagate the key/value pair in your JSON in
> this case) and update your default template accordingly.
> The biggest caveat though: you will have to manually keep track of your
> data types and use X_of_string() to properly re-cast them afterwards,
> though.
> But I've tested it and it works flawlessly this way.
>
> --
> best regards,
>
> okay_awright
> <okay_awright AT ddcr DOT biz>
> [PGP key on request]
>
>
>
> On 30/08/2011 15:05, Fábio Costa wrote:
>
>> 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<http://p.sf.net/sfu/arcsisghtdev2dev>
>>
>>
>>
>> ______________________________**_________________
>> Savonet-users mailing list
>> Savonet-users@lists.**sourceforge.net<[email protected]>
>> https://lists.sourceforge.net/**lists/listinfo/savonet-users<https://lists.sourceforge.net/lists/listinfo/savonet-users>
>>
>
>
>
------------------------------------------------------------------------------
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