View previous topic :: View next topic |
Author |
Message |
baxissimo
Joined: 23 Oct 2006 Posts: 241 Location: Tokyo, Japan
|
Posted: Mon Jun 23, 2008 3:05 am Post subject: JSON indentation |
|
|
The JSON output, comes out looking like:
Code: |
[{
"Container" : {
"thing_" : {
"Thingy" : {
"n_parts" : 4,
"name" : "ImaThingy",
"bytes" : [0, 1, 2, 3]
}
}
}
}, {
"Container" : {
"thing_" : $1
}
}]
|
without any indentation whatsoever. It looks like there's some infrastructure there intended to make indentations, but currently 'indent' is always 0, and Skip.indent is never used. How hard would it be to make that work?
As a first step in using the Serializer I'd like to replace my code that I have that saves a simple Prefs struct to JSON. But my current code (using cashew's JSON utils) indents nicely. I don't really want my prefs file to take a step backwards by "upgrading" to doost.serialize. |
|
Back to top |
|
|
aarti_pl
Joined: 25 Jul 2006 Posts: 28
|
Posted: Tue Jun 24, 2008 4:20 pm Post subject: |
|
|
It's difficult to say how much work it will take. Probably not so much, but I can not give any timing, when I will be able to implement this. |
|
Back to top |
|
|
baxissimo
Joined: 23 Oct 2006 Posts: 241 Location: Tokyo, Japan
|
Posted: Tue Jun 24, 2008 11:50 pm Post subject: |
|
|
aarti_pl wrote: | It's difficult to say how much work it will take. Probably not so much, but I can not give any timing, when I will be able to implement this. |
I took care of this one. Now output looks like this:
Code: |
[{
"Container" : {
"thing_" : {
"Thingy" : {
"n_parts" : 4,
"name" : "ImaThingy",
"dict" : {
5 : 0.5,
7 : 0.7,
9 : 0.9
},
"bytes" : [0, 1, 2, 3]
}
}
}
}, {
"Container" : {
"thing_" : $1
}
}]
|
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|