Use cdecimal if available

review185002
This commit is contained in:
Cédric Krier committed 2012-01-04 19:54:30 +01:00
1 parent eb6f2d754d
commit 33268ddf7f
5 files changed
+29 -1

No files matched your search

+1
View File
@@ -20,6 +20,7 @@ Prerequisites
* Optional: unoconv http://dag.wieers.com/home-made/unoconv/)
* Optional: sphinx (http://sphinx.pocoo.org/)
* Optional: simplejson (http://undefined.org/python/#simplejson)
* Optional: cdecimal (http://www.bytereef.org/mpdecimal/index.html)
Install Tryton
==============
+1
View File
@@ -71,6 +71,7 @@ setup(name=PACKAGE,
'graphviz': ['pydot'],
'timezone': ['pytz'],
'simplejson': ['simplejson'],
'cdecimal': ['cdecimal'],
},
zip_safe=False,
test_suite='trytond.tests',
+11 -1
View File
@@ -1,6 +1,16 @@
#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 ConfigParser, os, sys
import sys
try:
import cdecimal
# Use cdecimal globally
if 'decimal' not in sys.modules:
sys.modules['decimal'] = cdecimal
except ImportError:
import decimal
sys.modules['cdecimal'] = decimal
import os
import ConfigParser
def get_hostname(netloc):
if '[' in netloc and ']' in netloc:
+8
View File
@@ -2,6 +2,14 @@
# -*- coding: utf-8 -*-
#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
try:
import cdecimal
if 'decimal' not in sys.modules:
sys.modules['decimal'] = cdecimal
except ImportError:
import decimal
sys.modules['cdecimal'] = decimal
import unittest
from decimal import Decimal
import datetime
+8
View File
@@ -2,6 +2,14 @@
# -*- coding: utf-8 -*-
#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
try:
import cdecimal
if 'decimal' not in sys.modules:
sys.modules['decimal'] = cdecimal
except ImportError:
import decimal
sys.modules['cdecimal'] = decimal
import unittest
import datetime
from decimal import Decimal