@@ -0,0 +1,1529 @@
+#!/usr/bin/env python%0A# encoding: utf-8%0A%22%22%22%0Ahujson.py - extended json - tries to be compatible with simplejson%0A%0Ahujson can encode additional types like decimal and datetime into valid json.%0A%0ACreated by Maximillian Dornseif on 2010-09-10.%0ACopyright (c) 2010, 2012 HUDORA. All rights reserved.%0A%22%22%22%0A%0A%0Aimport json%0Aimport datetime%0A%0A%0Adef _unknown_handler(value):%0A    %22%22%22Helfer f%C3%BCr json.dmps()) - stammt aus hujson%22%22%22%0A    if isinstance(value, datetime.date):%0A        return str(value)%0A    elif isinstance(value, datetime.datetime):%0A        return value.isoformat() + 'Z'%0A    elif hasattr(value, 'properties') and callable(value.properties):%0A        return dict(%5B(key, getattr(value, key)) for key in value.properties().keys()%5D)%0A    elif 'google.appengine.api.users.User' in str(type(value)):%0A        return %22%25s/%25s%22 %25 (value.user_id(), value.email())%0A    elif 'google.appengine.api.datastore_types.Key' in str(type(value)):%0A        return str(value)%0A    elif hasattr(value, 'as_dict') and callable(value.as_dict):%0A        # helpful for structured.Struct() Objects%0A        return value.as_dict()%0A    elif hasattr(value, 'dict_mit_positionen') and callable(value.dict_mit_positionen):%0A        # helpful for our internal data-modelling%0A        return value.dict_mit_positionen()%0A    raise TypeError(%22%25s(%25s)%22 %25 (type(value), value))%0A%0A%0Adef dumps(val, indent=' '):%0A    return json.dumps(val, sort_keys=True, indent=bool(indent), ensure_ascii=True,%0A                      default=_unknown_handler)%0A%0A%0Adef loads(data):%0A    return json.loads(data)%0A

hujson2 uses Python2.6 JSON