Reviewers: ,
Please review this at http://codereview.tryton.org/145001/ Affected files: M doc/installation.rst M setup.py M tryton/gui/main.py M tryton/gui/window/view_form/screen/screen.py M tryton/gui/window/view_form/view/list.py M tryton/jsonrpc.py M tryton/pyson.py Index: doc/installation.rst =================================================================== --- a/doc/installation.rst +++ b/doc/installation.rst @@ -8,7 +8,7 @@ * pygtk 2.6 or later (http://www.pygtk.org/) * librsvg (http://librsvg.sourceforge.net/) * python-dateutil (http://labix.org/python-dateutil) - * simplejson (http://undefined.org/python/#simplejson) + * Optional: simplejson (http://undefined.org/python/#simplejson) * Optional: pytz (http://pytz.sourceforge.net/) Installation Index: setup.py =================================================================== --- a/setup.py +++ b/setup.py @@ -149,6 +149,7 @@ ], extras_require={ 'timezone': ['pytz'], + 'simplejson': ['simplejson'], }, **args ) Index: tryton/gui/main.py =================================================================== --- a/tryton/gui/main.py +++ b/tryton/gui/main.py @@ -9,7 +9,10 @@ import urllib import gobject import gtk -import json +try: + import simplejson as json +except ImportError: + import json import webbrowser import tryton.rpc as rpc from tryton.config import CONFIG, TRYTON_ICON, PIXMAPS_DIR, DATA_DIR, \ Index: tryton/gui/window/view_form/screen/screen.py =================================================================== --- a/tryton/gui/window/view_form/screen/screen.py +++ b/tryton/gui/window/view_form/screen/screen.py @@ -2,7 +2,10 @@ #this repository contains the full copyright notices and license terms. "Screen" import gobject -import json +try: + import simplejson as json +except ImportError: + import json import copy import collections import xml.dom.minidom Index: tryton/gui/window/view_form/view/list.py =================================================================== --- a/tryton/gui/window/view_form/view/list.py +++ b/tryton/gui/window/view_form/view/list.py @@ -3,7 +3,10 @@ import gobject import gtk import sys -import json +try: + import simplejson as json +except ImportError: + import json import tryton.rpc as rpc import locale from interface import ParserView Index: tryton/jsonrpc.py =================================================================== --- a/tryton/jsonrpc.py +++ b/tryton/jsonrpc.py @@ -1,7 +1,10 @@ #This file is part of Tryton. The COPYRIGHT file at the top level of #this repository contains the full copyright notices and license terms. import xmlrpclib -import json +try: + import simplejson as json +except ImportError: + import json import ssl import httplib from decimal import Decimal Index: tryton/pyson.py =================================================================== --- a/tryton/pyson.py +++ b/tryton/pyson.py @@ -1,7 +1,10 @@ #This file is part of Tryton. The COPYRIGHT file at the top level of #this repository contains the full copyright notices and license terms. import sys -import json +try: + import simplejson as json +except ImportError: + import json import datetime from functools import reduce -- [email protected] mailing list
