Update of /usr/cvs/Public/pygresql/module
In directory druid.net:/tmp/cvs-serv15599/module
Modified Files:
pgmodule.c setup.py
Log Message:
Some adaptions for Py 2.6 and Windows.
To see the diffs for this commit:
http://www.druid.net/pygresql/viewcvs.cgi/cvs/pygresql/module/pgmodule.c.diff?r1=1.82&r2=1.83
Index: pgmodule.c
===================================================================
RCS file: /usr/cvs/Public/pygresql/module/pgmodule.c,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -r1.82 -r1.83
--- pgmodule.c 1 Nov 2008 18:15:53 -0000 1.82
+++ pgmodule.c 21 Nov 2008 17:08:17 -0000 1.83
@@ -1,5 +1,5 @@
/*
- * $Id: pgmodule.c,v 1.82 2008/11/01 18:15:53 cito Exp $
+ * $Id: pgmodule.c,v 1.83 2008/11/21 17:08:17 cito Exp $
* PyGres, version 2.2 A Python interface for PostgreSQL database. Written by
* D'Arcy J.M. Cain, ([EMAIL PROTECTED]). Based heavily on code written by
* Pascal Andre, [EMAIL PROTECTED] Copyright (c) 1995, Pascal Andre
@@ -48,12 +48,18 @@
static const char *PyPgVersion = "4.0";
+#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
+typedef int Py_ssize_t;
+#define PY_SSIZE_T_MAX INT_MAX
+#define PY_SSIZE_T_MIN INT_MIN
+#endif
+
/* taken from fileobject.c */
#define BUF(v) PyString_AS_STRING((PyStringObject *)(v))
/* default values */
#define MODULE_NAME "pgsql"
-#define ARRAYSIZE 1
+#define PG_ARRAYSIZE 1
/* flags for object validity checks */
#define CHECK_OPEN 1
@@ -82,15 +88,15 @@
#ifndef NO_DIRECT
#define DIRECT_ACCESS 1 /* enables direct access functions */
-#endif /* NO_DIRECT */
+#endif
#ifndef NO_LARGE
#define LARGE_OBJECTS 1 /* enables large objects support */
-#endif /* NO_LARGE */
+#endif
#ifndef NO_DEF_VAR
#define DEFAULT_VARS 1 /* enables default variables use */
-#endif /* NO_DEF_VAR */
+#endif
/* In 7.4 PQfreeNotify was deprecated and PQfreemem is used instead.
A macro exists in 7.4 for backwards compatibility. */
@@ -449,7 +455,7 @@
npgobj->pgcnx = pgcnx;
npgobj->last_result = NULL;
npgobj->valid = 1;
- npgobj->arraysize = ARRAYSIZE;
+ npgobj->arraysize = PG_ARRAYSIZE;
return npgobj;
}
@@ -2459,8 +2465,8 @@
PyObject *list,
*sublist,
*item;
- PyObject *(*getitem) (PyObject *, int);
- PyObject *(*getsubitem) (PyObject *, int);
+ PyObject *(*getitem) (PyObject *, Py_ssize_t);
+ PyObject *(*getsubitem) (PyObject *, Py_ssize_t);
int i,
j,
m,
http://www.druid.net/pygresql/viewcvs.cgi/cvs/pygresql/module/setup.py.diff?r1=1.26&r2=1.27
Index: setup.py
===================================================================
RCS file: /usr/cvs/Public/pygresql/module/setup.py,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- setup.py 21 Nov 2008 13:55:22 -0000 1.26
+++ setup.py 21 Nov 2008 17:08:17 -0000 1.27
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-# $Id: setup.py,v 1.26 2008/11/21 13:55:22 cito Exp $
+# $Id: setup.py,v 1.27 2008/11/21 17:08:17 cito Exp $
"""Setup script for PyGreSQL version 4.0
@@ -9,7 +9,7 @@
* setup script created 2000/04 Mark Alexander <[EMAIL PROTECTED]>
* tweaked 2000/05 Jeremy Hylton <[EMAIL PROTECTED]>
* win32 support 2001/01 by Gerhard Haering <[EMAIL PROTECTED]>
-* tweaked 2006/02 Christoph Zwerschke <[EMAIL PROTECTED]>
+* tweaked 2006/02 and 2008/11 by Christoph Zwerschke <[EMAIL PROTECTED]>
Prerequisites to be installed:
* Python including devel package (header files and distutils)
@@ -24,19 +24,15 @@
python setup.py build # to build the module
python setup.py install # to install it
-For Win32, you should have the Microsoft Visual C++ compiler and
-the Microsoft .NET Framework SDK installed and on your search path.
-If you want to use the free Microsoft Visual C++ Toolkit 2003 compiler,
-you need to patch distutils (www.vrplumber.com/programming/mstoolkit/).
-Alternatively, you can use MinGW (www.mingw.org) for building on Win32:
+You should use MinGW (www.mingw.org) for building on Win32:
python setup.py build -c mingw32 install # use MinGW
-Note that the official Python distribution is now using msvcr71 instead
-of msvcrt as its common runtime library. So, if you are using MinGW to build
-PyGreSQL, you should edit the file "%MinGWpath%/lib/gcc/%MinGWversion%/specs"
+Note that Python newer than version 2.3 is using msvcr71 instead of msvcrt
+as its common runtime library. So, if you are using MinGW to build PyGreSQL,
+you should edit the file "%MinGWpath%/lib/gcc/%MinGWversion%/specs"
and change the entry that reads -lmsvcrt to -lmsvcr71.
-See www.python.org/doc/current/inst/ for more information
-on using distutils to install Python programs.
+See docs.python.org/doc/install/ for more information on
+using distutils to install Python programs.
"""
@@ -67,6 +63,7 @@
The directory will contain a copy of the PostgreSQL server header files,
where all features which are not necessary for PyGreSQL are disabled.
+
"""
os.mkdir('include')
for f in os.listdir(pg_include_dir_server):
@@ -74,10 +71,17 @@
continue
d = open(os.path.join(pg_include_dir_server, f)).read()
if f == 'pg_config.h':
- d += '\n'
- d += '#undef ENABLE_NLS\n'
- d += '#undef USE_REPL_SNPRINTF\n'
- d += '#undef USE_SSL\n'
+ d += '\n'.join(('',
+ '#undef ENABLE_NLS',
+ '#undef USE_REPL_SNPRINTF',
+ '#undef USE_SSL',
+ '#undef USE_ZLIB',
+ '#undef HAVE_STDINT_H',
+ '#undef HAVE_SYS_TIME_H',
+ '#undef HAVE_UNISTD_H',
+ '#define _CRT_SECURE_NO_WARNINGS 1',
+ '#define _USE_32BIT_TIME_T 1',
+ ''))
open(os.path.join('include', f), 'w').write(d)
def rm_include():
@@ -115,6 +119,8 @@
author="D'Arcy J. M. Cain",
author_email="[EMAIL PROTECTED]",
url="http://www.pygresql.org",
+ download_url = "ftp://ftp.pygresql.org/pub/distrib/",
+ platforms = ["any"],
license="Python",
py_modules=['pg', 'pgdb'],
ext_modules=[Extension(
@@ -132,6 +138,7 @@
"Programming Language :: C",
"Programming Language :: Python",
"Topic :: Database",
+ "Topic :: Database :: Front-Ends",
"Topic :: Software Development :: Libraries :: Python Modules"
]
)
_______________________________________________
PyGreSQL mailing list
[email protected]
http://mailman.vex.net/mailman/listinfo/pygresql