This commit was manufactured by cvs2svn to create tag 'r_1_0_1_c_1'.

This commit is contained in:
(no author)
2004-09-26 21:47:08 +00:00
parent 59913d32f4
commit 38061e2abf
75 changed files with 56 additions and 6442 deletions

View File

@ -16,11 +16,11 @@ MySQLdb.converters module.
__author__ = "Andy Dustman <andy@dustman.net>"
__revision__ = """$Revision$"""[11:-2]
version_info = (
1,
0,
9,
3,
"beta",
3)
1,
"gamma",
1)
if version_info[3] == "final": __version__ = "%d.%d.%d" % version_info[:3]
else: __version__ = "%d.%d.%d%1.1s%d" % version_info[:5]
@ -53,6 +53,7 @@ NUMBER = DBAPISet(FIELD_TYPE.DECIMAL, FIELD_TYPE.DOUBLE, FIELD_TYPE.FLOAT,
DATE = DBAPISet(FIELD_TYPE.DATE, FIELD_TYPE.NEWDATE)
TIME = DBAPISet(FIELD_TYPE.TIME)
TIMESTAMP = DBAPISet(FIELD_TYPE.TIMESTAMP, FIELD_TYPE.DATETIME)
DATETIME = TIMESTAMP
ROWID = DBAPISet()
def Binary(x): return str(x)

View File

@ -130,7 +130,7 @@ conversions = {
FIELD_TYPE.SET: Str2Set,
FIELD_TYPE.TIMESTAMP: mysql_timestamp_converter,
FIELD_TYPE.DATETIME: DateTime_or_None,
FIELD_TYPE.TIME: Time_or_None,
FIELD_TYPE.TIME: TimeDelta_or_None,
FIELD_TYPE.DATE: Date_or_None,
FIELD_TYPE.BLOB: [
(FLAG.BINARY, char_array),

View File

@ -149,7 +149,7 @@ class BaseCursor:
try:
q = [ query % qargs[0] ]
for a in qargs[1:]: q.append( qv % a )
except TypeError, msg:
except TypeError, msg:
if msg.args[0] in ("not enough arguments for format string",
"not all arguments converted"):
self.errorhandler(self, ProgrammingError, msg.args[0])

View File

@ -29,7 +29,7 @@ def format_DATE(d):
def format_TIME(d):
"""Format a DateTime object as a time value."""
return d.strftime("%H:%M:%S")
return d.strftime("%d %H:%M:%S")
def format_TIMESTAMP(d):
"""Format a DateTime object as an ISO timestamp."""

View File

@ -26,7 +26,10 @@ def TimestampFromTicks(ticks):
"""Convert UNIX ticks into a datetime instance."""
return apply(datetime, localtime(ticks)[:6])
format_TIME = format_TIMESTAMP = format_DATE = str
format_TIME = format_DATE = str
def format_TIMESTAMP(d):
return d.strftime("%Y-%m-%d %H:%M:%S")
def DateTime_or_None(s):
if ' ' in s:
@ -47,7 +50,7 @@ def TimeDelta_or_None(s):
try:
h, m, s = s.split(':')
td = timedelta(hours=int(h), minutes=int(m), seconds=int(s),
microseconds=int(modf(float(s)[0]))*1000000)
microseconds=int(modf(float(s))[0])*1000000)
if h < 0:
return -td
else:

View File

@ -4,6 +4,12 @@ Warning:
already answered, I reserve the right to verbally abuse you.
Binary Packages:
I don't plan to make binary packages any more. However, if someone
contributes one, I will make it available.
Prerequisites:
Python 1.5.2 or higher
@ -13,26 +19,13 @@ Prerequisites:
* Versions lower than 1.5.2 WON'T WORK.
* All versions from 1.5.2 should work. 1.6.x versions have not been
tested. 2.1.3 and 2.2.3 have both been tested. 2.0.x has not been
recently tested. 2.3 (alpha) support is coming summer 2003.
tested. All of the recent testing has been done with 2.3.x.
* Red Hat Linux:
o Make sure you have the Python development headers
and libraries (python-devel).
o For Python-2.x versions, this is python2-devel.
o Note that Red Hat Linux, up to version 7.3, installs
Python-1.5.2 as the python package. Starting sometime with 7.x,
Python-2.x is available as the python2 package.
o It appears that the next Red Hat release (probably 8.0) will
install Python-2.2.1 as the python package and drop 1.5.2.
* The python.org RPM packages follow the Red Hat 7.x conventions.
Python-2.1.3 RPMS install as the python2.1 package.
Distutils 1.0.2 or higher
@ -51,21 +44,18 @@ Prerequisites:
* Versions lower than 3.22.19 might not work.
* MySQL-4.1 is not yet supported, but should be by summer 2003.
Current release 4.1.0 (alpha).
* MySQL-4.1 is not yet supported, and probably won't be until
MySQLdb-1.3 or 2.0. Current release 4.1.2 (alpha).
* MySQL-4.0 is supported. Current release 4.0.12.
* MySQL-4.0 is supported, and all recent testing is with 4.0.x.
* MySQL-3.23 is supported. Current release: 3.23.56.
* MySQL-3.23 is supported, but slightly deprecated.
* MySQL-3.22 is deprecated in favor of 3.23, but still supported.
* Red Hat Linux packages:
o XXX May be out of date for Red Hat 8.0 and newer
o mysql-devel to compile; doesn't seem to come with the
thread-safe client library
o mysql-devel to compile
o mysql and/or mysql-devel to run
@ -79,8 +69,6 @@ Prerequisites:
o MySQL-shared to run if you compiled with MySQL-shared installed
* I prefer the MySQL.com packages to the Red Hat packages.
* Transactions (particularly InnoDB tables) are supported for
MySQL-3.23 and up. You may need a special package from your
vendor with this support turned on.
@ -101,7 +89,11 @@ Prerequisites:
* Most free software-based systems already have this, usually gcc.
* If you have some Windows flavor, you have to pay extra for this.
* Most commercial UNIX platforms also come with a C compiler, or
you can also use gcc.
* If you have some Windows flavor, you usually have to pay extra
for this, or you can use Cygwin.
Building and installing
@ -158,15 +150,19 @@ Building and installing
Finally, putting it together:
$ tar xfz MySQL-python-0.9.3.tar.gz
$ cd MySQL-python-0.9.3
$ export mysqlversion="4.0.12"
$ tar xfz MySQL-python-1.0.0.tar.gz
$ cd MySQL-python-1.0.0
$ export mysqlversion="4.0.20"
$ export mysqlclient="mysqlclient_r"
$ export mysqloptlibs="ssl crypto"
$ python setup.py build
$ su
# python setup.py install
NOTE: You must export environment variables for setup.py to see
them. Depending on what shell you prefer, you may need to use
"export" or "set -x" (bash and other Bourne-like shells) or "setenv"
(csh-like shells).
Windows
@ -214,15 +210,12 @@ Building and installing
Gentoo Linux
It's in the portage tree.
It's in the portage tree. Gentoo is also my development platform.
# emerge sync
# emerge mysql-python
# emerge zmysqlda # if you use Zope
Note that zmysqlda will pull in mysql-python-py2.1 automatically
as Zope still officially requires Python-2.1.3.
*BSD
MySQL-python is a ported package in FreeBSD, NetBSD, and OpenBSD,
@ -242,4 +235,4 @@ License
Andy Dustman <andy@dustman.net>
2003-04-19
2004-06-06 (D-Day + 60)

View File

@ -1,5 +1,5 @@
#define version_info "(0,9,3,'beta',3)"
#define __version__ "0.9.3"
#define version_info "(1,0,1,'gamma',1)"
#define __version__ "1.0.0c1"
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -32,10 +32,10 @@ PERFORMANCE OF THIS SOFTWARE.
#ifdef MS_WIN32
#include <windows.h>
#endif /* MS_WIN32 */
#ifndef uint
#define uint unsigned int
#endif
#endif /* MS_WIN32 */
#include "structmember.h"
#include "mysql.h"
@ -211,7 +211,7 @@ static PyObject *_mysql_server_init(
"args must be a sequence");
goto finish;
}
cmd_argc = PySequence_Size(cmd_args);
cmd_argc = PySequence_Length(cmd_args);
if (cmd_argc == -1) {
PyErr_SetString(PyExc_TypeError,
"args could not be sized");
@ -236,7 +236,7 @@ static PyObject *_mysql_server_init(
"groups must be a sequence");
goto finish;
}
groupc = PySequence_Size(groups);
groupc = PySequence_Length(groups);
if (groupc == -1) {
PyErr_SetString(PyExc_TypeError,
"groups could not be sized");
@ -254,7 +254,7 @@ static PyObject *_mysql_server_init(
}
groups_c[i] = s;
}
groups_c[groupc+1] = (char *)NULL;
groups_c[groupc] = (char *)NULL;
}
/* even though this may block, don't give up the interpreter lock
so that the server can't be initialized multiple times. */
@ -363,7 +363,7 @@ _mysql_ResultObject_Initialize(
Py_INCREF(Py_None);
}
if (PySequence_Check(fun)) {
int j, n2=PySequence_Size(fun);
int j, n2=PySequence_Length(fun);
PyObject *fun2=NULL;
for (j=0; j<n2; j++) {
PyObject *t = PySequence_GetItem(fun, j);
@ -434,7 +434,7 @@ _mysql_ConnectionObject_Initialize(
MYSQL *conn=NULL;
PyObject *conv = NULL;
PyObject *ssl = NULL;
PyObject *value = NULL;;
PyObject *value = NULL;
char *key = NULL, *cert = NULL, *ca = NULL,
*capath = NULL, *cipher = NULL;
char *host = NULL, *user = NULL, *passwd = NULL,

View File

@ -1,5 +1,5 @@
[bdist_rpm]
doc_files = README doc/*.?tml CHANGELOG
doc_files = README doc/*.??ml CHANGELOG
vendor = MySQL-python SourceForge Project
packager = Andy Dustman <andy@dustman.net>
distribution-name = Red Hat Linux

View File

@ -10,7 +10,7 @@ import string
YES = 1
NO = 0
mysqlclient = os.getenv('mysqlclient', 'mysqlclient')
mysqlclient = os.environ.get('mysqlclient', 'mysqlclient')
mysqlversion = tuple(map(int, string.split(os.getenv('mysqlversion', '3.23.32'), '.')))
mysqloptlibs = string.split(os.getenv('mysqloptlibs', ''))
embedded_server = (mysqlclient == 'mysqld')
@ -18,15 +18,17 @@ embedded_server = (mysqlclient == 'mysqld')
name = "MySQL-%s" % os.path.basename(sys.executable)
if embedded_server:
name = name + "-embedded"
version = "0.9.3b3"
version = "1.0.1c1"
# include files and library locations should cover most platforms
include_dirs = [
'/usr/include/mysql', '/usr/local/include/mysql',
'/usr/local/mysql/include',
'/usr/local/mysql/include/mysql'
]
library_dirs = [
'/usr/lib/mysql', '/usr/local/lib/mysql',
'/usr/local/mysql/lib',
'/usr/local/mysql/lib/mysql'
]
@ -64,6 +66,8 @@ elif sys.platform == "sunos5": # Solaris 2.8 + gcc
elif sys.platform == "win32": # Ugh
include_dirs = [r'c:\mysql\include']
library_dirs = [r'c:\mysql\lib\opt']
libraries.remove('z')
libraries.remove('crypt')
libraries.extend(['zlib', 'msvcrt', 'libcmt', 'wsock32', 'advapi32'])
extra_objects = [r'c:\mysql\lib\opt\mysqlclient.lib']
elif sys.platform == "cygwin":
@ -71,8 +75,8 @@ elif sys.platform == "cygwin":
library_dirs = ['/c/mysql/lib']
extra_compile_args.append('-DMS_WIN32')
elif sys.platform[:6] == "darwin": # Mac OS X
include_dirs.append('/sw/include')
library_dirs.append('/sw/lib')
include_dirs.append('/sw/include/mysql')
library_dirs.append('/sw/lib/mysql')
extra_link_args.append('-flat_namespace')
elif sys.platform == 'linux2' and os.environ.get('HOSTTYPE') == 'alpha':
libraries.extend(['ots', 'cpml'])