[pypy-svn] r69431 - in pypy/trunk/pypy/module/oracle: . test

afa at codespeak.net afa at codespeak.net
Thu Nov 19 11:45:47 CET 2009


Author: afa
Date: Thu Nov 19 11:45:47 2009
New Revision: 69431

Modified:
   pypy/trunk/pypy/module/oracle/interp_cursor.py
   pypy/trunk/pypy/module/oracle/test/test_cursor.py
Log:
add cursor.setoutputsize()


Modified: pypy/trunk/pypy/module/oracle/interp_cursor.py
==============================================================================
--- pypy/trunk/pypy/module/oracle/interp_cursor.py	(original)
+++ pypy/trunk/pypy/module/oracle/interp_cursor.py	Thu Nov 19 11:45:47 2009
@@ -29,6 +29,8 @@
         self.bindList = None
         self.bindDict = None
         self.numbersAsStrings = False
+        self.outputSize = -1
+        self.outputSizeColumn = -1
 
         self.inputTypeHandler = None
         self.outputTypeHandler = None
@@ -987,7 +989,7 @@
         self.bindList = None
         self.bindDict = None
 
-        self.setInputSizes = 1
+        self.setInputSizes = True
 
         # process each input
         if kw_w:
@@ -1009,6 +1011,12 @@
             return space.newlist(self.bindList)
     setinputsizes.unwrap_spec = ['self', ObjSpace, Arguments]
 
+    def setoutputsize(self, space, outputSize, outputSizeColumn=-1):
+        self.outputSize = outputSize
+        self.outputSizeColumn = outputSizeColumn
+    setoutputsize.unwrap_spec = ['self', ObjSpace, int, int]
+
+
 def cursor_arraysize_get(space, obj):
     return space.wrap(obj.arraySize)
 def cursor_arraysize_set(space, obj, w_value):
@@ -1053,6 +1061,8 @@
                           unwrap_spec=W_Cursor.arrayvar.unwrap_spec),
     setinputsizes = interp2app(W_Cursor.setinputsizes,
                                unwrap_spec=W_Cursor.setinputsizes.unwrap_spec),
+    setoutputsize = interp2app(W_Cursor.setoutputsize,
+                               unwrap_spec=W_Cursor.setoutputsize.unwrap_spec),
 
     __iter__ = interp2app(W_Cursor.descr_iter),
     next = interp2app(W_Cursor.descr_next),

Modified: pypy/trunk/pypy/module/oracle/test/test_cursor.py
==============================================================================
--- pypy/trunk/pypy/module/oracle/test/test_cursor.py	(original)
+++ pypy/trunk/pypy/module/oracle/test/test_cursor.py	Thu Nov 19 11:45:47 2009
@@ -174,3 +174,8 @@
             ('NULLABLECOL', oracle.NUMBER, 39, 22, 38, 0, 1),
             ]
         assert got == expected
+
+    def test_outputsize(self):
+        cur = self.cnx.cursor()
+        cur.setoutputsize(25000)
+        cur.setoutputsize(25000, 2)



More information about the Pypy-commit mailing list