summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFederico Di Gregorio <fog@initd.org>2005-10-17 06:17:34 +0000
committerFederico Di Gregorio <fog@initd.org>2005-10-17 06:17:34 +0000
commit5715a74388ab86f7aba4692e8acdbc83bf200b22 (patch)
tree6408cf7997075e15dd2543aa97b0051bf67b19f6
parent8e453ce176e5e125b011e009e159ac36c66411c0 (diff)
downloadpsycopg2-5715a74388ab86f7aba4692e8acdbc83bf200b22.tar.gz
Applied patches to fix docstrings.
-rw-r--r--ChangeLog6
-rw-r--r--NEWS8
-rw-r--r--psycopg/connection_type.c9
-rw-r--r--psycopg/psycopgmodule.c23
4 files changed, 41 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index c8e154e..3ec5360 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/NEWS b/NEWS
index 1b2e863..c717965 100644
--- a/NEWS
+++ b/NEWS
@@ -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
--------------------------------
diff --git a/psycopg/connection_type.c b/psycopg/connection_type.c
index 8b185e6..7a32b8b 100644
--- a/psycopg/connection_type.c
+++ b/psycopg/connection_type.c
@@ -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)
diff --git a/psycopg/psycopgmodule.c b/psycopg/psycopgmodule.c
index dcff7bc..5702d1d 100644
--- a/psycopg/psycopgmodule.c
+++ b/psycopg/psycopgmodule.c
@@ -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"},