diff bindings/python/pyadb.py @ 719:e3f1cf653c30

wooo! direct insert works! at least for the rather limited cases I've tests. Bad news is that I seem to have found a rather nasty bug in the query code I wrote back in september. (segfaults around line 471 if the query returns no results...)
author map01bf
date Fri, 25 Jun 2010 09:08:56 +0000
parents 159becb0701e
children 2fad8cfdb2d8
line wrap: on
line diff
--- a/bindings/python/pyadb.py	Thu Jun 24 16:38:32 2010 +0000
+++ b/bindings/python/pyadb.py	Fri Jun 25 09:08:56 2010 +0000
@@ -78,7 +78,7 @@
 			args["key"]=str(key)
 		if featFile:
 			if not _pyadb._pyadb_insertFromFile(**args):
-				raise(RuntimeError, "Insertion from file failed for an unknown reason.")
+				raise RuntimeError("Insertion from file failed for an unknown reason.")
 			else:
 				self._updateDBAttributes()
 				return
@@ -87,8 +87,9 @@
 			args["nDim"], args["nVect"] = args["features"].shape
 			args["features"] = args["features"].flatten()
 			print "args: " + str(args)
-			if not _pyadb._pyadb_insertFromArray(**args):
-				raise(RuntimeError, "Direct data insertion failed for an unknown reason.")
+			ok = _pyadb._pyadb_insertFromArray(**args)
+			if not (ok==0):
+				raise RuntimeError("Direct data insertion failed for an unknown reason. err code = %i"%ok)
 			else:
 				self._updateDBAttributes()
 				return