Applied patches to fix docstrings.

This commit is contained in:
Federico Di Gregorio 2005-10-17 06:17:34 +00:00
parent 8e453ce176
commit 5715a74388
4 changed files with 41 additions and 5 deletions

View File

@ -1,3 +1,9 @@
2005-10-17 Federico Di Gregorio <fog@initd.org>
* psycopg/connection_type.c: fixed docstring for .cursor().
* psycopg/psycopgmodule.c: added useful docstring for .connect().
2005-10-08 Federico Di Gregorio <fog@initd.org>
* psycopg/connection_type.c: isolation level upper bound set to 2.

8
NEWS
View File

@ -5,6 +5,14 @@ What's new in psycopg 2.0 rc 1
* Fixed all known bugs.
* The initial isolation level is now read from the server and
.set_isolation_level() now takes values defined in psycopg2.extensions.
* .callproc() implemented as a SELECT of the given procedure.
* Better docstrings for a few functions/methods.
What's new in psycopg 2.0 beta 4
--------------------------------

View File

@ -37,10 +37,11 @@
/* cursor method - allocate a new cursor */
#define psyco_conn_cursor_doc \
"cursor(factory=psycopg.cursor) -> new cursor\n\n" \
"Return a new cursor. The 'factory' argument can be used to create\n" \
"non-standard cursors by passing a class different from the default.\n" \
"Note that the new class *should* be a sub-class of psycopg.cursor."
"cursor(cursor_factory=psycopg.cursor) -> new cursor\n\n" \
"Return a new cursor. The 'cursor_factory' argument can be used to\n" \
"create non-standard cursors by passing a class different from the\n" \
"default. Note that the new class *should* be a sub-class of\n" \
"'psycopg2.cursor'.\n"
static PyObject *
psyco_conn_cursor(connectionObject *self, PyObject *args, PyObject *keywds)

View File

@ -59,7 +59,27 @@ PyObject *psycoEncodings = NULL;
PyObject *decimalType = NULL;
/** connect module-level function **/
#define psyco_connect_doc "connect(dsn, ...) -> new connection object"
#define psyco_connect_doc \
"connect(dsn, ...) -> new connection object\n\n" \
"This function supports two different but equivalent sets of arguments.\n" \
"A single data source name or 'dsn' string can be used to specify the\n" \
"connection parameters, as follows:\n\n" \
" psycopg2.connect(\"dbname=xxx user=xxx ...\")\n\n" \
"If 'dsn' is not provided it is possible to pass the parameters as\n" \
"keyword arguments; e.g.,\n\n" \
" psycopg2.connect(database='xxx', user='xxx', ...)\n\n" \
"The full list of available parameters is:\n\n" \
" dbname -- database name (only in 'dsn')\n" \
" database -- database name (only as keyword argument)\n" \
" host -- host address (defaults to UNIX socket if not provided)\n" \
" port -- port number (defaults to 5432 if not provided)\n" \
" user -- user name used to authenticate\n" \
" password -- password used to authenticate\n" \
" sslmode -- SSL mode (see PostgreSQL documentation)\n\n" \
"If the 'connection_factory' keyword argument is not provided this\n" \
"function always return an instance of the 'psycopg2.connection' class.\n" \
"Else the given sub-class of 'psycopg2.connection' will be used to\n" \
"instantiate the connection object.\n"
static int
_psyco_connect_fill_dsn(char *dsn, char *kw, char *v, int i)
@ -241,6 +261,7 @@ static encodingPair encodings[] = {
{"SQL_ASCII", "ascii"},
{"LATIN1", "latin_1"},
{"UNICODE", "utf_8"},
{"UTF8", "utf_8"},
/* some compatibility stuff */
{"latin-1", "latin_1"},