diff options
author | montellese <montellese@xbmc.org> | 2011-06-03 16:25:07 +0200 |
---|---|---|
committer | montellese <montellese@xbmc.org> | 2011-06-03 16:25:07 +0200 |
commit | 3565ad579e9b80f4be57db901d3fe44d9bfac87d (patch) | |
tree | 23b7218b1aacdbd6e3299a614ce8073ae93cc86f /lib/jsoncpp/test/pyjsontestrunner.py | |
parent | 648af1e56953eb1c9aeeebfc5826c6a828d4ebbb (diff) | |
parent | fee62a4d040f6eb3e44e703f2f80846a6aaa57ea (diff) |
replace jsoncpp with yajl (thanks topfs2)
* topfs2/remove_jsoncpp: (21 commits)
Fix. Added explicit typecast to platform int to quench warnings for variant use in jsonrpc
[win32] replace jsoncpp with yajl
Removed jsoncpp
Added pragma and license to IClient.h
Removed the dependency of jsoncpp in CVariant
Switched to use CVariant instead of jsoncpp values in JSON-RPC
Added yajl writer for Variant
Added yajl parser for Variant
Added c_str and have size of variant work with strings
Added check for libyajl to configure
Added CVariant::type which returns the type of the current variant (easier than multiple isFoo queries)
Switched Variant to use double internally, still accepts floats
Added swap method to CVariant
Moved to use explicit type in CVariant instead of isFoo
Added operator== to CVariant
Added array and map iterators to CVariant
Added CVariant constructor which takes a string pointer and length
Added append to CVariant
Added isMember to CVariant
Removed debug in CVariant
...
Conflicts:
Makefile.in
configure.in
project/VS2010Express/XBMC.vcxproj
xbmc/interfaces/json-rpc/AudioLibrary.cpp
xbmc/interfaces/json-rpc/FileItemHandler.cpp
xbmc/interfaces/json-rpc/FileItemHandler.h
xbmc/interfaces/json-rpc/VideoLibrary.cpp
Diffstat (limited to 'lib/jsoncpp/test/pyjsontestrunner.py')
-rw-r--r-- | lib/jsoncpp/test/pyjsontestrunner.py | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/lib/jsoncpp/test/pyjsontestrunner.py b/lib/jsoncpp/test/pyjsontestrunner.py deleted file mode 100644 index 504f3db2e7..0000000000 --- a/lib/jsoncpp/test/pyjsontestrunner.py +++ /dev/null @@ -1,64 +0,0 @@ -# Simple implementation of a json test runner to run the test against json-py. - -import sys -import os.path -import json -import types - -if len(sys.argv) != 2: - print "Usage: %s input-json-file", sys.argv[0] - sys.exit(3) - -input_path = sys.argv[1] -base_path = os.path.splitext(input_path)[0] -actual_path = base_path + '.actual' -rewrite_path = base_path + '.rewrite' -rewrite_actual_path = base_path + '.actual-rewrite' - -def valueTreeToString( fout, value, path = '.' ): - ty = type(value) - if ty is types.DictType: - fout.write( '%s={}\n' % path ) - suffix = path[-1] != '.' and '.' or '' - names = value.keys() - names.sort() - for name in names: - valueTreeToString( fout, value[name], path + suffix + name ) - elif ty is types.ListType: - fout.write( '%s=[]\n' % path ) - for index, childValue in zip( xrange(0,len(value)), value ): - valueTreeToString( fout, childValue, path + '[%d]' % index ) - elif ty is types.StringType: - fout.write( '%s="%s"\n' % (path,value) ) - elif ty is types.IntType: - fout.write( '%s=%d\n' % (path,value) ) - elif ty is types.FloatType: - fout.write( '%s=%.16g\n' % (path,value) ) - elif value is True: - fout.write( '%s=true\n' % path ) - elif value is False: - fout.write( '%s=false\n' % path ) - elif value is None: - fout.write( '%s=null\n' % path ) - else: - assert False and "Unexpected value type" - -def parseAndSaveValueTree( input, actual_path ): - root = json.loads( input ) - fout = file( actual_path, 'wt' ) - valueTreeToString( fout, root ) - fout.close() - return root - -def rewriteValueTree( value, rewrite_path ): - rewrite = json.dumps( value ) - #rewrite = rewrite[1:-1] # Somehow the string is quoted ! jsonpy bug ? - file( rewrite_path, 'wt').write( rewrite + '\n' ) - return rewrite - -input = file( input_path, 'rt' ).read() -root = parseAndSaveValueTree( input, actual_path ) -rewrite = rewriteValueTree( json.write( root ), rewrite_path ) -rewrite_root = parseAndSaveValueTree( rewrite, rewrite_actual_path ) - -sys.exit( 0 ) |