[pypy-svn] pypy ootype-virtualrefs: add an ootype partial version of rlocale.numeric_formatting: it is of course not fully implemented, but it should at least allow translation to work
antocuni
commits-noreply at bitbucket.org
Thu Apr 7 14:23:02 CEST 2011
Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: ootype-virtualrefs
Changeset: r43195:aac08fe66ae0
Date: 2011-04-07 14:01 +0200
http://bitbucket.org/pypy/pypy/changeset/aac08fe66ae0/
Log: add an ootype partial version of rlocale.numeric_formatting: it is
of course not fully implemented, but it should at least allow
translation to work
diff --git a/pypy/rlib/rlocale.py b/pypy/rlib/rlocale.py
--- a/pypy/rlib/rlocale.py
+++ b/pypy/rlib/rlocale.py
@@ -7,6 +7,7 @@
from pypy.rpython.lltypesystem import rffi, lltype
from pypy.translator.tool.cbuild import ExternalCompilationInfo
from pypy.rpython.tool import rffi_platform as platform
+from pypy.rpython.extfunc import register_external
class LocaleError(Exception):
def __init__(self, message):
@@ -173,6 +174,13 @@
grouping = rffi.charp2str(conv.c_grouping)
return decimal_point, thousands_sep, grouping
+def oo_numeric_formatting():
+ return '.', '', ''
+
+register_external(numeric_formatting, [], (str, str, str),
+ ooimpl=oo_numeric_formatting)
+
+
_setlocale = external('setlocale', [rffi.INT, rffi.CCHARP], rffi.CCHARP)
def setlocale(category, locale):
More information about the Pypy-commit
mailing list