Revision: 579
          http://rpy.svn.sourceforge.net/rpy/?rev=579&view=rev
Author:   lgautier
Date:     2008-07-17 15:01:27 +0000 (Thu, 17 Jul 2008)

Log Message:
-----------
rinterface:

- set R default console output to "print"
- disable R's stack checking (to avoid avoid crashes when 
multithreading)
- set_term_ui for Win32

Modified Paths:
--------------
    branches/rpy_nextgen/rpy/rinterface/__init__.py
    branches/rpy_nextgen/rpy/rinterface/rinterface.c
    branches/rpy_nextgen/setup.py

Modified: branches/rpy_nextgen/rpy/rinterface/__init__.py
===================================================================
--- branches/rpy_nextgen/rpy/rinterface/__init__.py     2008-07-14 15:21:49 UTC 
(rev 578)
+++ branches/rpy_nextgen/rpy/rinterface/__init__.py     2008-07-17 15:01:27 UTC 
(rev 579)
@@ -35,8 +35,6 @@
 
 from rpy2.rinterface.rinterface import *
 
-
-
 class StrSexpVector(SexpVector):
     def __init__(self, v):        
         super(StrSexpVector, self).__init__(v, STRSXP)
@@ -51,3 +49,10 @@
     def __init__(self, v):        
         super(StrSexpVector, self).__init__(v, REALSXP)
 
+
+# wrapper because print is strangely not a function
+# Python prior to version 3.0
+def consolePrint(x):
+    print(x)
+
+setWriteConsole(consolePrint)

Modified: branches/rpy_nextgen/rpy/rinterface/rinterface.c
===================================================================
--- branches/rpy_nextgen/rpy/rinterface/rinterface.c    2008-07-14 15:21:49 UTC 
(rev 578)
+++ branches/rpy_nextgen/rpy/rinterface/rinterface.c    2008-07-17 15:01:27 UTC 
(rev 579)
@@ -75,6 +75,11 @@
 
 //#define RPY_VERBOSE
 
+#if Win32
+extern __declspec(dllimport) uintptr_t R_CStackLimit; /* C stack limit */
+#endif
+
+
 /* Back-compatibility with Python 2.4 */
 #if (PY_VERSION_HEX < 0x02050000)
 typedef int Py_ssize_t;
@@ -249,6 +254,14 @@
   int status = 1;
   Rf_initialize_R(n_args, options);
   R_Interactive = TRUE;
+
+  /* Taken from JRI:
+   * disable stack checking, because threads will thow it off */
+  R_CStackLimit = (uintptr_t) -1;
+  
+  #ifdef Win32
+  setup_term_ui();
+  #endif
   setup_Rmainloop();
 
   Py_XDECREF(embeddedR_isInitialized);

Modified: branches/rpy_nextgen/setup.py
===================================================================
--- branches/rpy_nextgen/setup.py       2008-07-14 15:21:49 UTC (rev 578)
+++ branches/rpy_nextgen/setup.py       2008-07-17 15:01:27 UTC (rev 579)
@@ -4,7 +4,7 @@
 
 
 pack_name = 'rpy2'
-pack_version = '2.0.0-a1'
+pack_version = '2.0.0-dev'
 
 RHOMES = os.getenv('RHOMES')
 
@@ -87,10 +87,18 @@
 
     #f_in.close()
     #f_out.close()
+    
 
+    #FIXME: crude way (will break in many cases)
+    #check how to get how to have a configure step
     define_macros = []
-    if sys.platform != 'win32':
+
+    if sys.platform == 'win32':
+        define_macros.append(('Win32', 1))
+    else:
         define_macros.append(('R_INTERFACE_PTRS', 1))
+
+    define_macros.append(('CSTACK_DEFNS', 1))
     
     rinterface_ext = Extension(
             pack_name + '.rinterface.rinterface',
@@ -130,6 +138,7 @@
       description = "Python interface to the R language",
       url = "http://rpy.sourceforge.net";,
       license = "(L)GPL",
+      author = "Laurent Gautier <[EMAIL PROTECTED]>",
       ext_modules = rinterface_exts,
       package_dir = pack_dir,
       packages = [pack_name,


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to