[Informixdb-cvs] SF.net SVN: informixdb: [165] trunk/informixdb
Brought to you by:
chaese,
f-apolloner
From: <ch...@us...> - 2007-10-14 17:40:35
|
Revision: 165 http://informixdb.svn.sourceforge.net/informixdb/?rev=165&view=rev Author: chaese Date: 2007-10-14 10:40:37 -0700 (Sun, 14 Oct 2007) Log Message: ----------- Since we publish server version information, it might be useful to publish version information about the client too, i.e. the ESQL version, for symmetry. Modified Paths: -------------- trunk/informixdb/ext/_informixdb.ec trunk/informixdb/setup.py Modified: trunk/informixdb/ext/_informixdb.ec =================================================================== --- trunk/informixdb/ext/_informixdb.ec 2007-10-13 22:07:31 UTC (rev 164) +++ trunk/informixdb/ext/_informixdb.ec 2007-10-14 17:40:37 UTC (rev 165) @@ -113,6 +113,7 @@ */ #define DEFERRED_ADDRESS(ADDR) 0 #include <signal.h> +#include "esqlver.h" /************************* Error handling *************************/ @@ -728,6 +729,8 @@ PyObject *binary_types; PyObject *dbms_name; PyObject *dbms_version; + PyObject *driver_name; + PyObject *driver_version; int can_describe_input; } Connection; @@ -881,6 +884,10 @@ "Name of the database engine." }, { "dbms_version", T_OBJECT_EX, offsetof(Connection, dbms_version), READONLY, "Version of the database engine." }, + { "driver_name", T_OBJECT_EX, offsetof(Connection, driver_name), READONLY, + "Name of the client driver." }, + { "driver_version", T_OBJECT_EX, offsetof(Connection, driver_version), READONLY, + "Version of the client driver." }, { NULL } }; @@ -3195,6 +3202,8 @@ self->dbms_name = PyString_FromString("Unknown"); self->dbms_version = PyString_FromString(version); } + self->driver_name = PyString_FromString(DRIVER_NAME); + self->driver_version = PyString_FromString(DRIVER_VERSION); return 0; } Modified: trunk/informixdb/setup.py =================================================================== --- trunk/informixdb/setup.py 2007-10-13 22:07:31 UTC (rev 164) +++ trunk/informixdb/setup.py 2007-10-14 17:40:37 UTC (rev 165) @@ -61,21 +61,31 @@ self.esql_parts.append('-static') # determine esql version - esqlver = re.compile(r"(IBM)?.*ESQL Version (\d+)\.(\d+)") + driver_name = "INFORMIX-ESQL" + driver_version = "Unknown" + esqlver = re.compile(r"(IBM)?.*ESQL Version ((\d+)\.(\d+)[^ ]*)") cout = os.popen(' '.join(self.esql_parts[0:1] + [ '-V' ]),'r') esqlversion = None for line in cout: matchobj = esqlver.match(line) if matchobj: matchgroups = matchobj.groups() - esqlversion = int(matchgroups[1] + matchgroups[2]) + driver_version = matchgroups[1].strip() + esqlversion = int(matchgroups[2] + matchgroups[3]) if matchgroups[0]=="IBM": # Assume ESQL 9.xx for any IBM branded CSDK. + driver_name = "IBM Informix-ESQL" esqlversion = 960 if esqlversion==None: esqlversion = 850 if esqlversion >= 900: self.esql_parts.append("-EDHAVE_ESQL9") + f = open(os.path.join("ext","esqlver.h"), "w") + f.write("""\ +#define DRIVER_NAME "%(driver_name)s" +#define DRIVER_VERSION "%(driver_version)s" +""" % locals()) + f.close() # find esql libs/objects cout = os.popen(' '.join(self.esql_parts + [ '-libs' ]),'r') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |