From: Noel O'B. <bao...@gm...> - 2007-11-19 13:38:24
|
Do we really need support for three JSON libraries? We can just bundle simplejson (or one of the others if their licenses permit) with cclib. Noel On 19/11/2007, Karol Langner <kar...@kn...> wrote: > Hi, > > A clarification on my latest commit. Since I started to use a different JSON > encoder/decoder than simplejson, I decided to add support for them in cclib. > > One of simplejson, cjson ot json is loaded dynamically when load_json() is > called in data.py. It is only loaded once, unless an optional argument for > the module name is passed (can be passed through read_json, etc.). An > example: > > >>> import cclib > >>> m = cclib.parser.ccopen("dvb_sp.out").parse() > (...) > >>> m.writejson(outfile="x.simplejson", module="simplejson") > >>> m.writejson(outfile="x.json", module="json") > >>> m.writejson(outfile="x.cjson", module="cjson") > > This writes three files using the three different modules. So, > > x.cjson is 63K > x.json is 69K > x.simplejson is 105K > > I don't know if any of these modules is better or faster or if it matters, but > since simplejson was first it is the default (being the first to try to > load). > > Cheers, > Karol > > -- > written by Karol Langner > Mon Nov 19 14:26:59 CET 2007 > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > cclib-devel mailing list > ccl...@li... > https://lists.sourceforge.net/lists/listinfo/cclib-devel > |