Changeset 740 for trunk/pgmodule.c


Ignore:
Timestamp:
Jan 13, 2016, 9:35:55 PM (4 years ago)
Author:
cito
Message:

Reformat some error messages and docstrings

Try to achieve a somewhat consistent style of docstrings and error
messages in the trunk. The docstrings use PEP 257, with a slight
variation between C code and Python code. The error messages are
capitalized and do not end with a period. (I prefer the periods,
but most Python code I have seen doesn't use them.)

(I know, a foolish consistency is the hobgoblin of little minds.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pgmodule.c

    r737 r740  
    240240        if (!(typ = PyMem_Malloc(sizeof(int) * nfields)))
    241241        {
    242                 PyErr_SetString(PyExc_MemoryError, "memory error in getresult().");
     242                PyErr_SetString(PyExc_MemoryError, "Memory error in getresult()");
    243243                return NULL;
    244244        }
     
    355355        if (!self->valid)
    356356        {
    357                 set_dberror(OperationalError, "connection has been closed.", NULL);
     357                set_dberror(OperationalError, "Connection has been closed", NULL);
    358358                return 0;
    359359        }
     
    512512                        {
    513513                                PyErr_SetString(PyExc_MemoryError,
    514                                         "Not enough memory for formatting the query result.");
     514                                        "Not enough memory for formatting the query result");
    515515                                return NULL;
    516516                        }
     
    519519                        PyMem_Free(sizes);
    520520                        PyErr_SetString(PyExc_MemoryError,
    521                                 "Not enough memory for formatting the query result.");
     521                                "Not enough memory for formatting the query result");
    522522                        return NULL;
    523523                }
     
    541541        if (!self->lo_oid)
    542542        {
    543                 set_dberror(IntegrityError, "object is not valid (null oid).", NULL);
     543                set_dberror(IntegrityError, "Object is not valid (null oid)", NULL);
    544544                return 0;
    545545        }
     
    549549                if (self->lo_fd < 0)
    550550                {
    551                         PyErr_SetString(PyExc_IOError, "object is not opened.");
     551                        PyErr_SetString(PyExc_IOError, "Object is not opened");
    552552                        return 0;
    553553                }
     
    558558                if (self->lo_fd >= 0)
    559559                {
    560                         PyErr_SetString(PyExc_IOError, "object is already opened.");
     560                        PyErr_SetString(PyExc_IOError, "Object is already opened");
    561561                        return 0;
    562562                }
     
    596596/* opens large object */
    597597static char largeOpen__doc__[] =
    598 "open(mode) -- open access to large object with specified mode "
    599 "(INV_READ, INV_WRITE constants defined by module).";
     598"open(mode) -- open access to large object with specified mode\n\n"
     599"The mode must be one of INV_READ, INV_WRITE (module level constants).\n";
    600600
    601601static PyObject *
     
    608608        if (!PyArg_ParseTuple(args, "i", &mode))
    609609        {
    610                 PyErr_SetString(PyExc_TypeError, "open(mode), with mode(integer).");
     610                PyErr_SetString(PyExc_TypeError, "open(mode), with mode(integer)");
    611611                return NULL;
    612612        }
     
    619619        if ((fd = lo_open(self->pgcnx->cnx, self->lo_oid, mode)) < 0)
    620620        {
    621                 PyErr_SetString(PyExc_IOError, "can't open large object.");
     621                PyErr_SetString(PyExc_IOError, "Can't open large object");
    622622                return NULL;
    623623        }
     
    631631/* close large object */
    632632static char largeClose__doc__[] =
    633 "close() -- close access to large object data.";
     633"close() -- close access to large object data";
    634634
    635635static PyObject *
     
    640640        {
    641641                PyErr_SetString(PyExc_TypeError,
    642                         "method close() takes no parameters.");
     642                        "Method close() takes no parameters");
    643643                return NULL;
    644644        }
     
    651651        if (lo_close(self->pgcnx->cnx, self->lo_fd))
    652652        {
    653                 PyErr_SetString(PyExc_IOError, "error while closing large object fd.");
     653                PyErr_SetString(PyExc_IOError, "Error while closing large object fd");
    654654                return NULL;
    655655        }
     
    663663/* reads from large object */
    664664static char largeRead__doc__[] =
    665 "read(integer) -- read from large object to sized string. "
    666 "Object must be opened in read mode before calling this method.";
     665"read(size) -- read from large object to sized string\n\n"
     666"Object must be opened in read mode before calling this method.\n";
    667667
    668668static PyObject *
     
    675675        if (!PyArg_ParseTuple(args, "i", &size))
    676676        {
    677                 PyErr_SetString(PyExc_TypeError, "read(size), with size (integer).");
     677                PyErr_SetString(PyExc_TypeError, "read(size), with size (integer)");
    678678                return NULL;
    679679        }
     
    681681        if (size <= 0)
    682682        {
    683                 PyErr_SetString(PyExc_ValueError, "size must be positive.");
     683                PyErr_SetString(PyExc_ValueError, "Parameter size must be positive");
    684684                return NULL;
    685685        }
     
    695695                PyBytes_AS_STRING((PyBytesObject *)(buffer)), size)) < 0)
    696696        {
    697                 PyErr_SetString(PyExc_IOError, "error while reading.");
     697                PyErr_SetString(PyExc_IOError, "Error while reading");
    698698                Py_XDECREF(buffer);
    699699                return NULL;
     
    707707/* write to large object */
    708708static char largeWrite__doc__[] =
    709 "write(string) -- write sized string to large object. "
    710 "Object must be opened in read mode before calling this method.";
     709"write(string) -- write sized string to large object\n\n"
     710"Object must be opened in read mode before calling this method.\n";
    711711
    712712static PyObject *
     
    721721        {
    722722                PyErr_SetString(PyExc_TypeError,
    723                         "write(buffer), with buffer (sized string).");
     723                        "write(buffer), with buffer (sized string)");
    724724                return NULL;
    725725        }
     
    733733                                                 bufsize)) < bufsize)
    734734        {
    735                 PyErr_SetString(PyExc_IOError, "buffer truncated during write.");
     735                PyErr_SetString(PyExc_IOError, "Buffer truncated during write");
    736736                return NULL;
    737737        }
     
    744744/* go to position in large object */
    745745static char largeSeek__doc__[] =
    746 "seek(off, whence) -- move to specified position. Object must be opened "
    747 "before calling this method. whence can be SEEK_SET, SEEK_CUR or SEEK_END, "
    748 "constants defined by module.";
     746"seek(offset, whence) -- move to specified position\n\n"
     747"Object must be opened before calling this method. The whence option\n"
     748"can be SEEK_SET, SEEK_CUR or SEEK_END (module level constants).\n";
    749749
    750750static PyObject *
     
    760760        {
    761761                PyErr_SetString(PyExc_TypeError,
    762                         "lseek(offset, whence), with offset and whence (integers).");
     762                        "lseek(offset, whence), with offset and whence (integers)");
    763763                return NULL;
    764764        }
     
    771771        if ((ret = lo_lseek(self->pgcnx->cnx, self->lo_fd, offset, whence)) == -1)
    772772        {
    773                 PyErr_SetString(PyExc_IOError, "error while moving cursor.");
     773                PyErr_SetString(PyExc_IOError, "Error while moving cursor");
    774774                return NULL;
    775775        }
     
    781781/* gets large object size */
    782782static char largeSize__doc__[] =
    783 "size() -- return large object size. "
    784 "Object must be opened before calling this method.";
     783"size() -- return large object size\n\n"
     784"The object must be opened before calling this method.\n";
    785785
    786786static PyObject *
     
    794794        {
    795795                PyErr_SetString(PyExc_TypeError,
    796                         "method size() takes no parameters.");
     796                        "Method size() takes no parameters");
    797797                return NULL;
    798798        }
     
    805805        if ((start = lo_tell(self->pgcnx->cnx, self->lo_fd)) == -1)
    806806        {
    807                 PyErr_SetString(PyExc_IOError, "error while getting current position.");
     807                PyErr_SetString(PyExc_IOError, "Error while getting current position");
    808808                return NULL;
    809809        }
     
    812812        if ((end = lo_lseek(self->pgcnx->cnx, self->lo_fd, 0, SEEK_END)) == -1)
    813813        {
    814                 PyErr_SetString(PyExc_IOError, "error while getting end position.");
     814                PyErr_SetString(PyExc_IOError, "Error while getting end position");
    815815                return NULL;
    816816        }
    817817
    818818        /* move back to start position */
    819         if ((start = lo_lseek(self->pgcnx->cnx, self->lo_fd, start, SEEK_SET)) == -1)
     819        if ((start = lo_lseek(
     820                self->pgcnx->cnx, self->lo_fd, start, SEEK_SET)) == -1)
    820821        {
    821822                PyErr_SetString(PyExc_IOError,
    822                         "error while moving back to first position.");
     823                        "Error while moving back to first position");
    823824                return NULL;
    824825        }
     
    830831/* gets large object cursor position */
    831832static char largeTell__doc__[] =
    832 "tell() -- give current position in large object. "
    833 "Object must be opened before calling this method.";
     833"tell() -- give current position in large object\n\n"
     834"The object must be opened before calling this method.\n";
    834835
    835836static PyObject *
     
    842843        {
    843844                PyErr_SetString(PyExc_TypeError,
    844                         "method tell() takes no parameters.");
     845                        "Method tell() takes no parameters");
    845846                return NULL;
    846847        }
     
    853854        if ((start = lo_tell(self->pgcnx->cnx, self->lo_fd)) == -1)
    854855        {
    855                 PyErr_SetString(PyExc_IOError, "error while getting position.");
     856                PyErr_SetString(PyExc_IOError, "Error while getting position");
    856857                return NULL;
    857858        }
     
    863864/* exports large object as unix file */
    864865static char largeExport__doc__[] =
    865 "export(string) -- export large object data to specified file. "
    866 "Object must be closed when calling this method.";
     866"export(filename) -- export large object data to specified file\n\n"
     867"The object must be closed when calling this method.\n";
    867868
    868869static PyObject *
     
    879880        {
    880881                PyErr_SetString(PyExc_TypeError,
    881                         "export(filename), with filename (string).");
     882                        "export(filename), with filename (string)");
    882883                return NULL;
    883884        }
     
    886887        if (!lo_export(self->pgcnx->cnx, self->lo_oid, name))
    887888        {
    888                 PyErr_SetString(PyExc_IOError, "error while exporting large object.");
     889                PyErr_SetString(PyExc_IOError, "Error while exporting large object");
    889890                return NULL;
    890891        }
     
    896897/* deletes a large object */
    897898static char largeUnlink__doc__[] =
    898 "unlink() -- destroy large object. "
    899 "Object must be closed when calling this method.";
     899"unlink() -- destroy large object\n\n"
     900"The object must be closed when calling this method.\n";
    900901
    901902static PyObject *
     
    906907        {
    907908                PyErr_SetString(PyExc_TypeError,
    908                         "method unlink() takes no parameters.");
     909                        "Method unlink() takes no parameters");
    909910                return NULL;
    910911        }
     
    917918        if (!lo_unlink(self->pgcnx->cnx, self->lo_oid))
    918919        {
    919                 PyErr_SetString(PyExc_IOError, "error while unlinking large object");
     920                PyErr_SetString(PyExc_IOError, "Error while unlinking large object");
    920921                return NULL;
    921922        }
     
    10621063/* source creation */
    10631064static char connSource__doc__[] =
    1064 "source() -- creates a new source object for this connection";
     1065"source() -- create a new source object for this connection";
    10651066
    10661067static PyObject *
     
    10761077        if (!PyArg_ParseTuple(args, ""))
    10771078        {
    1078                 PyErr_SetString(PyExc_TypeError, "method source() takes no parameter.");
     1079                PyErr_SetString(PyExc_TypeError,
     1080                        "Method source() takes no parameter");
    10791081                return NULL;
    10801082        }
     
    10961098/* database query */
    10971099static char connQuery__doc__[] =
    1098 "query(sql, [args]) -- creates a new query object for this connection, using"
    1099 " sql (string) request and optionally a tuple with positional parameters.";
     1100"query(sql, [arg]) -- create a new query object for this connection\n\n"
     1101"You must pass the SQL (string) request and you can optionally pass\n"
     1102"a tuple with positional parameters.\n";
    11001103
    11011104static PyObject *
     
    11131116        if (!self->cnx)
    11141117        {
    1115                 PyErr_SetString(PyExc_TypeError, "Connection is not valid.");
     1118                PyErr_SetString(PyExc_TypeError, "Connection is not valid");
    11161119                return NULL;
    11171120        }
     
    11391142        {
    11401143                PyErr_SetString(PyExc_TypeError,
    1141                         "query command must be a string.");
     1144                        "Query command must be a string");
    11421145                return NULL;
    11431146        }
     
    11501153        {
    11511154                param_obj = PySequence_Fast(param_obj,
    1152                         "query parameters must be a sequence.");
     1155                        "Query parameters must be a sequence");
    11531156                if (!param_obj)
    11541157                {
     
    11871190                        Py_XDECREF(query_obj);
    11881191                        Py_XDECREF(param_obj);
    1189                         PyErr_SetString(PyExc_MemoryError, "memory error in query().");
     1192                        PyErr_SetString(PyExc_MemoryError, "Memory error in query()");
    11901193                        return NULL;
    11911194                }
     
    12331236                                        Py_XDECREF(param_obj);
    12341237                                        PyErr_SetString(PyExc_TypeError,
    1235                                                 "query parameter has no string representation");
     1238                                                "Query parameter has no string representation");
    12361239                                        return NULL;
    12371240                                }
     
    12741277                {
    12751278                        case PGRES_EMPTY_QUERY:
    1276                                 PyErr_SetString(PyExc_ValueError, "empty query.");
     1279                                PyErr_SetString(PyExc_ValueError, "Empty query");
    12771280                                break;
    12781281                        case PGRES_BAD_RESPONSE:
     
    13071310                                return Py_None;
    13081311                        default:
    1309                                 set_dberror(InternalError,
    1310                                         "internal error: unknown result status.", result);
     1312                                set_dberror(InternalError, "Unknown result status", result);
    13111313                }
    13121314
     
    13291331#ifdef DIRECT_ACCESS
    13301332static char connPutLine__doc__[] =
    1331 "putline() -- sends a line directly to the backend";
     1333"putline(line) -- send a line directly to the backend";
    13321334
    13331335/* direct access function: putline */
     
    13401342        if (!self->cnx)
    13411343        {
    1342                 PyErr_SetString(PyExc_TypeError, "Connection is not valid.");
     1344                PyErr_SetString(PyExc_TypeError, "Connection is not valid");
    13431345                return NULL;
    13441346        }
     
    13471349        if (!PyArg_ParseTuple(args, "s#", &line, &line_length))
    13481350        {
    1349                 PyErr_SetString(PyExc_TypeError, "putline(line), with line (string).");
     1351                PyErr_SetString(PyExc_TypeError, "putline(line), with line (string)");
    13501352                return NULL;
    13511353        }
     
    13631365/* direct access function: getline */
    13641366static char connGetLine__doc__[] =
    1365 "getline() -- gets a line directly from the backend.";
     1367"getline() -- get a line directly from the backend";
    13661368
    13671369static PyObject *
     
    13731375        if (!self->cnx)
    13741376        {
    1375                 PyErr_SetString(PyExc_TypeError, "Connection is not valid.");
     1377                PyErr_SetString(PyExc_TypeError, "Connection is not valid");
    13761378                return NULL;
    13771379        }
     
    13811383        {
    13821384                PyErr_SetString(PyExc_TypeError,
    1383                         "method getline() takes no parameters.");
     1385                        "Method getline() takes no parameters");
    13841386                return NULL;
    13851387        }
     
    13921394                        break;
    13931395                case 1:
    1394                         PyErr_SetString(PyExc_MemoryError, "buffer overflow");
     1396                        PyErr_SetString(PyExc_MemoryError, "Buffer overflow");
    13951397                        str = NULL;
    13961398                        break;
     
    14061408/* direct access function: end copy */
    14071409static char connEndCopy__doc__[] =
    1408 "endcopy() -- synchronizes client and server";
     1410"endcopy() -- synchronize client and server";
    14091411
    14101412static PyObject *
     
    14131415        if (!self->cnx)
    14141416        {
    1415                 PyErr_SetString(PyExc_TypeError, "Connection is not valid.");
     1417                PyErr_SetString(PyExc_TypeError, "Connection is not valid");
    14161418                return NULL;
    14171419        }
     
    14211423        {
    14221424                PyErr_SetString(PyExc_TypeError,
    1423                         "method endcopy() takes no parameters.");
     1425                        "Method endcopy() takes no parameters");
    14241426                return NULL;
    14251427        }
     
    14451447/* insert table */
    14461448static char connInsertTable__doc__[] =
    1447 "inserttable(string, list) -- insert list in table. The fields in the "
    1448 "list must be in the same order as in the table.";
     1449"inserttable(table, data) -- insert list into table\n\n"
     1450"The fields in the list must be in the same order as in the table.\n";
    14491451
    14501452static PyObject *
     
    14691471        if (!self->cnx)
    14701472        {
    1471                 PyErr_SetString(PyExc_TypeError, "Connection is not valid.");
     1473                PyErr_SetString(PyExc_TypeError, "Connection is not valid");
    14721474                return NULL;
    14731475        }
     
    14781480                PyErr_SetString(PyExc_TypeError,
    14791481                        "inserttable(table, content), with table (string) "
    1480                         "and content (list).");
     1482                        "and content (list)");
    14811483                return NULL;
    14821484        }
     
    14961498        {
    14971499                PyErr_SetString(PyExc_TypeError,
    1498                         "second arg must be some kind of array.");
     1500                        "Second arg must be some kind of array");
    14991501                return NULL;
    15001502        }
     
    15041506        {
    15051507                PyErr_SetString(PyExc_MemoryError,
    1506                         "can't allocate insert buffer.");
     1508                        "Can't allocate insert buffer");
    15071509                return NULL;
    15081510        }
     
    15451547                {
    15461548                        PyErr_SetString(PyExc_TypeError,
    1547                                 "second arg must contain some kind of arrays.");
     1549                                "Second arg must contain some kind of arrays");
    15481550                        return NULL;
    15491551                }
     
    15541556                                PyMem_Free(buffer);
    15551557                                PyErr_SetString(PyExc_TypeError,
    1556                                         "arrays contained in second arg must have same size.");
     1558                                        "Arrays contained in second arg must have same size");
    15571559                                return NULL;
    15581560                        }
     
    16501652                                PyMem_Free(buffer);
    16511653                                PyErr_SetString(PyExc_MemoryError,
    1652                                         "insert buffer overflow.");
     1654                                        "Insert buffer overflow");
    16531655                                return NULL;
    16541656                        }
     
    16931695/* get transaction state */
    16941696static char connTransaction__doc__[] =
    1695 "Returns the current transaction status.";
     1697"transaction() -- return the current transaction status";
    16961698
    16971699static PyObject *
     
    17001702        if (!self->cnx)
    17011703        {
    1702                 PyErr_SetString(PyExc_TypeError, "Connection is not valid.");
     1704                PyErr_SetString(PyExc_TypeError, "Connection is not valid");
    17031705                return NULL;
    17041706        }
     
    17081710        {
    17091711                PyErr_SetString(PyExc_TypeError,
    1710                         "method transaction() takes no parameters.");
     1712                        "Method transaction() takes no parameters");
    17111713                return NULL;
    17121714        }
     
    17171719/* get parameter setting */
    17181720static char connParameter__doc__[] =
    1719 "Looks up a current parameter setting.";
     1721"parameter() -- look up a current parameter setting";
    17201722
    17211723static PyObject *
     
    17261728        if (!self->cnx)
    17271729        {
    1728                 PyErr_SetString(PyExc_TypeError, "Connection is not valid.");
     1730                PyErr_SetString(PyExc_TypeError, "Connection is not valid");
    17291731                return NULL;
    17301732        }
     
    17341736        {
    17351737                PyErr_SetString(PyExc_TypeError,
    1736                         "parameter(name), with name (string).");
     1738                        "parameter(name), with name (string)");
    17371739                return NULL;
    17381740        }
     
    17521754/* escape literal */
    17531755static char connEscapeLiteral__doc__[] =
    1754 "escape_literal(str) -- escape a literal constant for use within SQL.";
     1756"escape_literal(str) -- escape a literal constant for use within SQL";
    17551757
    17561758static PyObject *
     
    17601762                           *to_obj; /* string object to return */
    17611763        char       *from, /* our string argument as encoded string */
    1762                            *to; /* the result as encoded string */
     1764                           *to; /* the result as encoded string */
    17631765        Py_ssize_t      from_length; /* length of string */
    17641766        size_t          to_length; /* length of result */
     
    17821784        else
    17831785        {
    1784                 PyErr_SetString(PyExc_TypeError, "escape_literal() expects a string.");
     1786                PyErr_SetString(PyExc_TypeError, "escape_literal() expects a string");
    17851787                return NULL;
    17861788        }
     
    18021804/* escape identifier */
    18031805static char connEscapeIdentifier__doc__[] =
    1804 "escape_identifier(str) -- escape an identifier for use within SQL.";
     1806"escape_identifier(str) -- escape an identifier for use within SQL";
    18051807
    18061808static PyObject *
     
    18101812                           *to_obj; /* string object to return */
    18111813        char       *from, /* our string argument as encoded string */
    1812                            *to; /* the result as encoded string */
     1814                           *to; /* the result as encoded string */
    18131815        Py_ssize_t      from_length; /* length of string */
    18141816        size_t          to_length; /* length of result */
     
    18331835        {
    18341836                PyErr_SetString(PyExc_TypeError,
    1835                         "escape_identifier() expects a string.");
     1837                        "escape_identifier() expects a string");
    18361838                return NULL;
    18371839        }
     
    18551857/* escape string */
    18561858static char connEscapeString__doc__[] =
    1857 "escape_string(str) -- escape a string for use within SQL.";
     1859"escape_string(str) -- escape a string for use within SQL";
    18581860
    18591861static PyObject *
     
    18631865                           *to_obj; /* string object to return */
    18641866        char       *from, /* our string argument as encoded string */
    1865                            *to; /* the result as encoded string */
     1867                           *to; /* the result as encoded string */
    18661868        Py_ssize_t      from_length; /* length of string */
    18671869        size_t          to_length; /* length of result */
     
    18851887        else
    18861888        {
    1887                 PyErr_SetString(PyExc_TypeError, "escape_string() expects a string.");
     1889                PyErr_SetString(PyExc_TypeError, "escape_string() expects a string");
    18881890                return NULL;
    18891891        }
     
    19111913/* escape bytea */
    19121914static char connEscapeBytea__doc__[] =
    1913 "escape_bytea(data) -- escape binary data for use within SQL as type bytea.";
     1915"escape_bytea(data) -- escape binary data for use within SQL as type bytea";
    19141916
    19151917static PyObject *
     
    19191921                           *to_obj; /* string object to return */
    19201922        char       *from, /* our string argument as encoded string */
    1921                            *to; /* the result as encoded string */
     1923                           *to; /* the result as encoded string */
    19221924        Py_ssize_t      from_length; /* length of string */
    19231925        size_t          to_length; /* length of result */
     
    19411943        else
    19421944        {
    1943                 PyErr_SetString(PyExc_TypeError, "escape_bytea() expects a string.");
     1945                PyErr_SetString(PyExc_TypeError, "escape_bytea() expects a string");
    19441946                return NULL;
    19451947        }
    19461948
    19471949        to = (char *)PQescapeByteaConn(self->cnx,
    1948                 (unsigned char *)from, (size_t)from_length, &to_length);
     1950                (unsigned char *)from, (size_t)from_length, &to_length);
    19491951
    19501952        Py_XDECREF(from_obj);
     
    19621964/* creates large object */
    19631965static char connCreateLO__doc__[] =
    1964 "locreate() -- creates a new large object in the database.";
     1966"locreate(mode) -- create a new large object in the database";
    19651967
    19661968static PyObject *
     
    19781980        {
    19791981                PyErr_SetString(PyExc_TypeError,
    1980                         "locreate(mode), with mode (integer).");
     1982                        "locreate(mode), with mode (integer)");
    19811983                return NULL;
    19821984        }
     
    19861988        if (lo_oid == 0)
    19871989        {
    1988                 set_dberror(OperationalError, "can't create large object.", NULL);
     1990                set_dberror(OperationalError, "Can't create large object", NULL);
    19891991                return NULL;
    19901992        }
     
    19951997/* init from already known oid */
    19961998static char connGetLO__doc__[] =
    1997 "getlo(long) -- create a large object instance for the specified oid.";
     1999"getlo(oid) -- create a large object instance for the specified oid";
    19982000
    19992001static PyObject *
     
    20092011        if (!PyArg_ParseTuple(args, "i", &lo_oid))
    20102012        {
    2011                 PyErr_SetString(PyExc_TypeError, "getlo(oid), with oid (integer).");
     2013                PyErr_SetString(PyExc_TypeError, "getlo(oid), with oid (integer)");
    20122014                return NULL;
    20132015        }
     
    20152017        if (!lo_oid)
    20162018        {
    2017                 PyErr_SetString(PyExc_ValueError, "the object oid can't be null.");
     2019                PyErr_SetString(PyExc_ValueError, "The object oid can't be null");
    20182020                return NULL;
    20192021        }
     
    20252027/* import unix file */
    20262028static char connImportLO__doc__[] =
    2027 "loimport(string) -- create a new large object from specified file.";
     2029"loimport(name) -- create a new large object from specified file";
    20282030
    20292031static PyObject *
     
    20402042        if (!PyArg_ParseTuple(args, "s", &name))
    20412043        {
    2042                 PyErr_SetString(PyExc_TypeError, "loimport(name), with name (string).");
     2044                PyErr_SetString(PyExc_TypeError, "loimport(name), with name (string)");
    20432045                return NULL;
    20442046        }
     
    20482050        if (lo_oid == 0)
    20492051        {
    2050                 set_dberror(OperationalError, "can't create large object.", NULL);
     2052                set_dberror(OperationalError, "Can't create large object", NULL);
    20512053                return NULL;
    20522054        }
     
    20582060/* resets connection */
    20592061static char connReset__doc__[] =
    2060 "reset() -- reset connection with current parameters. All derived queries "
    2061 "and large objects derived from this connection will not be usable after "
    2062 "this call.";
     2062"reset() -- reset connection with current parameters\n\n"
     2063"All derived queries and large objects derived from this connection\n"
     2064"will not be usable after this call.\n";
    20632065
    20642066static PyObject *
     
    20672069        if (!self->cnx)
    20682070        {
    2069                 PyErr_SetString(PyExc_TypeError, "Connection is not valid.");
     2071                PyErr_SetString(PyExc_TypeError, "Connection is not valid");
    20702072                return NULL;
    20712073        }
     
    20752077        {
    20762078                PyErr_SetString(PyExc_TypeError,
    2077                         "method reset() takes no parameters.");
     2079                        "Method reset() takes no parameters");
    20782080                return NULL;
    20792081        }
     
    20872089/* cancels current command */
    20882090static char connCancel__doc__[] =
    2089 "cancel() -- abandon processing of the current command.";
     2091"cancel() -- abandon processing of the current command";
    20902092
    20912093static PyObject *
     
    20942096        if (!self->cnx)
    20952097        {
    2096                 PyErr_SetString(PyExc_TypeError, "Connection is not valid.");
     2098                PyErr_SetString(PyExc_TypeError, "Connection is not valid");
    20972099                return NULL;
    20982100        }
     
    21022104        {
    21032105                PyErr_SetString(PyExc_TypeError,
    2104                         "method cancel() takes no parameters.");
     2106                        "Method cancel() takes no parameters");
    21052107                return NULL;
    21062108        }
     
    21122114/* get connection socket */
    21132115static char connFileno__doc__[] =
    2114 "fileno() -- return database connection socket file handle.";
     2116"fileno() -- return database connection socket file handle";
    21152117
    21162118static PyObject *
     
    21192121        if (!self->cnx)
    21202122        {
    2121                 PyErr_SetString(PyExc_TypeError, "Connection is not valid.");
     2123                PyErr_SetString(PyExc_TypeError, "Connection is not valid");
    21222124                return NULL;
    21232125        }
     
    21272129        {
    21282130                PyErr_SetString(PyExc_TypeError,
    2129                         "method fileno() takes no parameters.");
     2131                        "Method fileno() takes no parameters");
    21302132                return NULL;
    21312133        }
     
    21402142/* set notice receiver callback function */
    21412143static char connSetNoticeReceiver__doc__[] =
    2142 "set_notice_receiver() -- set the current notice receiver.";
     2144"set_notice_receiver() -- set the current notice receiver";
    21432145
    21442146static PyObject *
     
    21582160                }
    21592161                else
    2160                         PyErr_SetString(PyExc_TypeError, "notice receiver must be callable");
     2162                        PyErr_SetString(PyExc_TypeError,
     2163                                "Notice receiver must be callable");
    21612164        }
    21622165        return ret;
     
    21652168/* get notice receiver callback function */
    21662169static char connGetNoticeReceiver__doc__[] =
    2167 "get_notice_receiver() -- get the current notice receiver.";
     2170"get_notice_receiver() -- get the current notice receiver";
    21682171
    21692172static PyObject *
     
    21822185        {
    21832186                PyErr_SetString(PyExc_TypeError,
    2184                         "method get_notice_receiver() takes no parameters.");
     2187                        "Method get_notice_receiver() takes no parameters");
    21852188        }
    21862189        return ret;
     
    21892192/* close without deleting */
    21902193static char connClose__doc__[] =
    2191 "close() -- close connection. All instances of the connection object and "
    2192 "derived objects (queries and large objects) can no longer be used after "
    2193 "this call.";
     2194"close() -- close connection\n\n"
     2195"All instances of the connection object and derived objects\n"
     2196"(queries and large objects) can no longer be used after this call.\n";
    21942197
    21952198static PyObject *
     
    21992202        if (!PyArg_ParseTuple(args, ""))
    22002203        {
    2201                 PyErr_SetString(PyExc_TypeError, "close().");
     2204                PyErr_SetString(PyExc_TypeError, "close()");
    22022205                return NULL;
    22032206        }
     
    22212224/* gets asynchronous notify */
    22222225static char connGetNotify__doc__[] =
    2223 "getnotify() -- get database notify for this connection.";
     2226"getnotify() -- get database notify for this connection";
    22242227
    22252228static PyObject *
     
    22302233        if (!self->cnx)
    22312234        {
    2232                 PyErr_SetString(PyExc_TypeError, "Connection is not valid.");
     2235                PyErr_SetString(PyExc_TypeError, "Connection is not valid");
    22332236                return NULL;
    22342237        }
     
    22382241        {
    22392242                PyErr_SetString(PyExc_TypeError,
    2240                         "method getnotify() takes no parameters.");
     2243                        "Method getnotify() takes no parameters");
    22412244                return NULL;
    22422245        }
     
    23642367        if (strcmp(name, "close") && !self->cnx)
    23652368        {
    2366                 PyErr_SetString(PyExc_TypeError, "Connection is not valid.");
     2369                PyErr_SetString(PyExc_TypeError, "Connection is not valid");
    23672370                return NULL;
    23682371        }
     
    24552458        if (!self->valid)
    24562459        {
    2457                 set_dberror(OperationalError, "object has been closed", NULL);
     2460                set_dberror(OperationalError, "Object has been closed", NULL);
    24582461                return 0;
    24592462        }
     
    24612464        if ((level & CHECK_RESULT) && !self->result)
    24622465        {
    2463                 set_dberror(DatabaseError, "no result.", NULL);
     2466                set_dberror(DatabaseError, "No result", NULL);
    24642467                return 0;
    24652468        }
     
    24682471        {
    24692472                set_dberror(DatabaseError,
    2470                         "last query did not return tuples.", self->result);
     2473                        "Last query did not return tuples", self->result);
    24712474                return 0;
    24722475        }
     
    24912494/* closes object */
    24922495static char sourceClose__doc__[] =
    2493 "close() -- close query object without deleting it. "
    2494 "All instances of the query object can no longer be used after this call.";
     2496"close() -- close query object without deleting it\n\n"
     2497"All instances of the query object can no longer be used after this call.\n";
    24952498
    24962499static PyObject *
     
    25002503        if (!PyArg_ParseTuple(args, ""))
    25012504        {
    2502                 PyErr_SetString(PyExc_TypeError, "method close() takes no parameter.");
     2505                PyErr_SetString(PyExc_TypeError, "Method close() takes no parameter");
    25032506                return NULL;
    25042507        }
     
    25212524/* database query */
    25222525static char sourceExecute__doc__[] =
    2523 "execute(sql) -- execute a SQL statement (string).\n "
    2524 "On success, this call returns the number of affected rows, "
    2525 "or None for DQL (SELECT, ...) statements.\n"
    2526 "The fetch (fetch(), fetchone() and fetchall()) methods can be used "
    2527 "to get result rows.";
     2526"execute(sql) -- execute a SQL statement (string)\n\n"
     2527"On success, this call returns the number of affected rows, or None\n"
     2528"for DQL (SELECT, ...) statements.  The fetch (fetch(), fetchone()\n"
     2529"and fetchall()) methods can be used to get result rows.\n";
    25282530
    25292531static PyObject *
     
    25632565        else
    25642566        {
    2565                 PyErr_SetString(PyExc_TypeError, "executed sql must be a string.");
     2567                PyErr_SetString(PyExc_TypeError, "Executed SQL must be a string");
    25662568                return NULL;
    25672569        }
     
    26212623                /* query failed */
    26222624                case PGRES_EMPTY_QUERY:
    2623                         PyErr_SetString(PyExc_ValueError, "empty query.");
     2625                        PyErr_SetString(PyExc_ValueError, "Empty query");
    26242626                        break;
    26252627                case PGRES_BAD_RESPONSE:
     
    26302632                        break;
    26312633                default:
    2632                         set_dberror(InternalError, "internal error: "
    2633                                 "unknown result status.", self->result);
     2634                        set_dberror(InternalError, "Internal error: "
     2635                                "unknown result status", self->result);
    26342636        }
    26352637
     
    26432645/* gets oid status for last query (valid for INSERTs, 0 for other) */
    26442646static char sourceStatusOID__doc__[] =
    2645 "oidstatus() -- return oid of last inserted row (if available).";
     2647"oidstatus() -- return oid of last inserted row (if available)";
    26462648
    26472649static PyObject *
     
    26582660        {
    26592661                PyErr_SetString(PyExc_TypeError,
    2660                         "method oidstatus() takes no parameters.");
     2662                        "Method oidstatus() takes no parameters");
    26612663                return NULL;
    26622664        }
     
    26742676/* fetches rows from last result */
    26752677static char sourceFetch__doc__[] =
    2676 "fetch(num) -- return the next num rows from the last result in a list. "
    2677 "If num parameter is omitted arraysize attribute value is used. "
    2678 "If size equals -1, all rows are fetched.";
     2678"fetch(num) -- return the next num rows from the last result in a list\n\n"
     2679"If num parameter is omitted arraysize attribute value is used.\n"
     2680"If size equals -1, all rows are fetched.\n";
    26792681
    26802682static PyObject *
     
    26982700        {
    26992701                PyErr_SetString(PyExc_TypeError,
    2700                         "fetch(num), with num (integer, optional).");
     2702                        "fetch(num), with num (integer, optional)");
    27012703                return NULL;
    27022704        }
     
    27742776                char            errbuf[256];
    27752777                PyOS_snprintf(errbuf, sizeof(errbuf),
    2776                         "method %s() takes no parameter.", __movename[move]);
     2778                        "Method %s() takes no parameter", __movename[move]);
    27772779                PyErr_SetString(PyExc_TypeError, errbuf);
    27782780                return NULL;
     
    28042806/* move to first result row */
    28052807static char sourceMoveFirst__doc__[] =
    2806 "movefirst() -- move to first result row.";
     2808"movefirst() -- move to first result row";
    28072809
    28082810static PyObject *
     
    28142816/* move to last result row */
    28152817static char sourceMoveLast__doc__[] =
    2816 "movelast() -- move to last valid result row.";
     2818"movelast() -- move to last valid result row";
    28172819
    28182820static PyObject *
     
    28242826/* move to next result row */
    28252827static char sourceMoveNext__doc__[] =
    2826 "movenext() -- move to next result row.";
     2828"movenext() -- move to next result row";
    28272829
    28282830static PyObject *
     
    28342836/* move to previous result row */
    28352837static char sourceMovePrev__doc__[] =
    2836 "moveprev() -- move to previous result row.";
     2838"moveprev() -- move to previous result row";
    28372839
    28382840static PyObject *
     
    28442846/* put copy data */
    28452847static char sourcePutData__doc__[] =
    2846 "getdata(buffer) -- send data to server during copy from stdin.";
     2848"getdata(buffer) -- send data to server during copy from stdin";
    28472849
    28482850static PyObject *
     
    29042906        {
    29052907                PyErr_SetString(PyExc_TypeError,
    2906                         "putdata() expects a buffer, None or an exception.");
     2908                        "putdata() expects a buffer, None or an exception");
    29072909                return NULL;
    29082910        }
     
    29102912        /* checks validity */
    29112913        if (!check_source_obj(self, CHECK_CNX | CHECK_RESULT) ||
    2912                         !self->pgcnx->cnx ||
    2913                         PQresultStatus(self->result) != PGRES_COPY_IN)
     2914                        !self->pgcnx->cnx ||
     2915                        PQresultStatus(self->result) != PGRES_COPY_IN)
    29142916        {
    29152917                PyErr_SetString(PyExc_IOError,
    2916                         "connection is invalid or not in copy_in state.");
     2918                        "Connection is invalid or not in copy_in state");
    29172919                Py_XDECREF(buffer_obj);
    29182920                return NULL;
     
    29752977/* get copy data */
    29762978static char sourceGetData__doc__[] =
    2977 "getdata(decode) -- receive data to server during copy to stdout.";
     2979"getdata(decode) -- receive data to server during copy to stdout";
    29782980
    29792981static PyObject *
     
    29983000        /* checks validity */
    29993001        if (!check_source_obj(self, CHECK_CNX | CHECK_RESULT) ||
    3000                         !self->pgcnx->cnx ||
    3001                         PQresultStatus(self->result) != PGRES_COPY_OUT)
     3002                        !self->pgcnx->cnx ||
     3003                        PQresultStatus(self->result) != PGRES_COPY_OUT)
    30023004        {
    30033005                PyErr_SetString(PyExc_IOError,
    3004                         "connection is invalid or not in copy_out state.");
     3006                        "Connection is invalid or not in copy_out state");
    30053007                return NULL;
    30063008        }
     
    30763078        if (num < 0 || num >= self->num_fields)
    30773079        {
    3078                 PyErr_SetString(PyExc_ValueError, "Unknown field.");
     3080                PyErr_SetString(PyExc_ValueError, "Unknown field");
    30793081                return -1;
    30803082        }
     
    31063108/* lists fields info */
    31073109static char sourceListInfo__doc__[] =
    3108 "listinfo() -- return information for all fields "
    3109 "(position, name, type oid).";
     3110"listinfo() -- get information for all fields (position, name, type oid)";
    31103111
    31113112static PyObject *
     
    31243125        {
    31253126                PyErr_SetString(PyExc_TypeError,
    3126                         "method listinfo() takes no parameter.");
     3127                        "Method listinfo() takes no parameter");
    31273128                return NULL;
    31283129        }
     
    31493150/* list fields information for last result */
    31503151static char sourceFieldInfo__doc__[] =
    3151 "fieldinfo(string|integer) -- return specified field information "
    3152 "(position, name, type oid).";
     3152"fieldinfo(desc) -- get specified field info (position, name, type oid)";
    31533153
    31543154static PyObject *
     
    31563156{
    31573157        static const char short_usage[] =
    3158         "fieldinfo(desc), with desc (string|integer).";
     3158        "fieldinfo(desc), with desc (string|integer)";
    31593159        int                     num;
    31603160        PyObject   *param;
     
    31773177/* retrieve field value */
    31783178static char sourceField__doc__[] =
    3179 "field(string|integer) -- return specified field value.";
     3179"field(desc) -- return specified field value";
    31803180
    31813181static PyObject *
     
    31833183{
    31843184        static const char short_usage[] =
    3185         "field(desc), with desc (string|integer).";
     3185        "field(desc), with desc (string|integer)";
    31863186        int                     num;
    31873187        PyObject   *param;
     
    32943294                if (!PyInt_Check(v))
    32953295                {
    3296                         PyErr_SetString(PyExc_TypeError, "arraysize must be integer.");
     3296                        PyErr_SetString(PyExc_TypeError, "arraysize must be integer");
    32973297                        return -1;
    32983298                }
     
    33033303
    33043304        /* unknown attribute */
    3305         PyErr_SetString(PyExc_TypeError, "not a writable attribute.");
     3305        PyErr_SetString(PyExc_TypeError, "Not a writable attribute");
    33063306        return -1;
    33073307}
     
    33613361/* connects to a database */
    33623362static char pgConnect__doc__[] =
    3363 "connect(dbname, host, port, opt) -- connect to a PostgreSQL database "
    3364 "using specified parameters (optionals, keywords aware).";
     3363"connect(dbname, host, port, opt) -- connect to a PostgreSQL database\n\n"
     3364"The connection uses the specified parameters (optional, keywords aware).\n";
    33653365
    33663366static PyObject *
     
    34553455/* get number of rows */
    34563456static char queryNTuples__doc__[] =
    3457 "ntuples() -- returns number of tuples returned by query.";
     3457"ntuples() -- return number of tuples returned by query";
    34583458
    34593459static PyObject *
     
    34643464        {
    34653465                PyErr_SetString(PyExc_TypeError,
    3466                         "method ntuples() takes no parameters.");
     3466                        "Method ntuples() takes no parameters");
    34673467                return NULL;
    34683468        }
     
    34733473/* list fields names from query result */
    34743474static char queryListFields__doc__[] =
    3475 "listfields() -- Lists field names from result.";
     3475"listfields() -- List field names from result";
    34763476
    34773477static PyObject *
     
    34883488        {
    34893489                PyErr_SetString(PyExc_TypeError,
    3490                         "method listfields() takes no parameters.");
     3490                        "Method listfields() takes no parameters");
    34913491                return NULL;
    34923492        }
     
    35083508/* get field name from last result */
    35093509static char queryFieldName__doc__[] =
    3510 "fieldname() -- returns name of field from result from its position.";
     3510"fieldname(num) -- return name of field from result from its position";
    35113511
    35123512static PyObject *
     
    35203520        {
    35213521                PyErr_SetString(PyExc_TypeError,
    3522                         "fieldname(number), with number(integer).");
     3522                        "fieldname(number), with number(integer)");
    35233523                return NULL;
    35243524        }
     
    35273527        if (i >= PQnfields(self->result))
    35283528        {
    3529                 PyErr_SetString(PyExc_ValueError, "invalid field number.");
     3529                PyErr_SetString(PyExc_ValueError, "Invalid field number");
    35303530                return NULL;
    35313531        }
     
    35383538/* gets fields number from name in last result */
    35393539static char queryFieldNumber__doc__[] =
    3540 "fieldnum() -- returns position in query for field from its name.";
     3540"fieldnum(name) -- return position in query for field from its name";
    35413541
    35423542static PyObject *
     
    35493549        if (!PyArg_ParseTuple(args, "s", &name))
    35503550        {
    3551                 PyErr_SetString(PyExc_TypeError, "fieldnum(name), with name (string).");
     3551                PyErr_SetString(PyExc_TypeError, "fieldnum(name), with name (string)");
    35523552                return NULL;
    35533553        }
     
    35563556        if ((num = PQfnumber(self->result, name)) == -1)
    35573557        {
    3558                 PyErr_SetString(PyExc_ValueError, "Unknown field.");
     3558                PyErr_SetString(PyExc_ValueError, "Unknown field");
    35593559                return NULL;
    35603560        }
     
    35653565/* retrieves last result */
    35663566static char queryGetResult__doc__[] =
    3567 "getresult() -- Gets the result of a query.  The result is returned "
    3568 "as a list of rows, each one a tuple of fields in the order returned "
    3569 "by the server.";
     3567"getresult() -- Get the result of a query\n\n"
     3568"The result is returned as a list of rows, each one a tuple of fields\n"
     3569"in the order returned by the server.\n";
    35703570
    35713571static PyObject *
     
    35853585        {
    35863586                PyErr_SetString(PyExc_TypeError,
    3587                         "method getresult() takes no parameters.");
     3587                        "Method getresult() takes no parameters");
    35883588                return NULL;
    35893589        }
     
    37363736/* retrieves last result as a list of dictionaries*/
    37373737static char queryDictResult__doc__[] =
    3738 "dictresult() -- Gets the result of a query.  The result is returned "
    3739 "as a list of rows, each one a dictionary with the field names used "
    3740 "as the labels.";
     3738"dictresult() -- Get the result of a query\n\n"
     3739"The result is returned as a list of rows, each one a dictionary with\n"
     3740"the field names used as the labels.\n";
    37413741
    37423742static PyObject *
     
    37563756        {
    37573757                PyErr_SetString(PyExc_TypeError,
    3758                         "method dictresult() takes no parameters.");
     3758                        "Method dictresult() takes no parameters");
    37593759                return NULL;
    37603760        }
     
    39083908/* retrieves last result as named tuples */
    39093909static char queryNamedResult__doc__[] =
    3910 "namedresult() -- Gets the result of a query.  The result is returned "
    3911 "as a list of rows, each one a tuple of fields in the order returned "
    3912 "by the server.";
     3910"namedresult() -- Get the result of a query\n\n"
     3911"The result is returned as a list of rows, each one a tuple of fields\n"
     3912"in the order returned by the server.\n";
    39133913
    39143914static PyObject *
     
    39223922        {
    39233923                PyErr_SetString(PyExc_TypeError,
    3924                         "method namedresult() takes no parameters.");
     3924                        "Method namedresult() takes no parameters");
    39253925                return NULL;
    39263926        }
     
    39293929        {
    39303930                PyErr_SetString(PyExc_TypeError,
    3931                         "named tuples are not supported.");
     3931                        "Named tuples are not supported");
    39323932                return NULL;
    39333933        }
     
    39533953        if (!res)
    39543954        {
    3955                 PyErr_SetString(PyExc_TypeError, "Cannot get current notice.");
     3955                PyErr_SetString(PyExc_TypeError, "Cannot get current notice");
    39563956                return NULL;
    39573957        }
     
    41174117/* escape string */
    41184118static char pgEscapeString__doc__[] =
    4119 "escape_string(str) -- escape a string for use within SQL.";
     4119"escape_string(string) -- escape a string for use within SQL";
    41204120
    41214121static PyObject *
     
    41254125                           *to_obj; /* string object to return */
    41264126        char       *from, /* our string argument as encoded string */
    4127                            *to; /* the result as encoded string */
     4127                           *to; /* the result as encoded string */
    41284128        Py_ssize_t      from_length; /* length of string */
    41294129        size_t          to_length; /* length of result */
     
    41474147        else
    41484148        {
    4149                 PyErr_SetString(PyExc_TypeError, "escape_string() expects a string.");
     4149                PyErr_SetString(PyExc_TypeError, "escape_string() expects a string");
    41504150                return NULL;
    41514151        }
     
    41724172/* escape bytea */
    41734173static char pgEscapeBytea__doc__[] =
    4174 "escape_bytea(data) -- escape binary data for use within SQL as type bytea.";
     4174"escape_bytea(data) -- escape binary data for use within SQL as type bytea";
    41754175
    41764176static PyObject *
     
    41804180                           *to_obj; /* string object to return */
    41814181        char       *from, /* our string argument as encoded string */
    4182                            *to; /* the result as encoded string */
     4182                           *to; /* the result as encoded string */
    41834183        Py_ssize_t      from_length; /* length of string */
    41844184        size_t          to_length; /* length of result */
     
    42024202        else
    42034203        {
    4204                 PyErr_SetString(PyExc_TypeError, "escape_bytea() expects a string.");
     4204                PyErr_SetString(PyExc_TypeError, "escape_bytea() expects a string");
    42054205                return NULL;
    42064206        }
     
    42224222/* unescape bytea */
    42234223static char pgUnescapeBytea__doc__[] =
    4224 "unescape_bytea(str) -- unescape bytea data that has been retrieved as text.";
     4224"unescape_bytea(string) -- unescape bytea data retrieved as text";
    42254225
    42264226static PyObject
     
    42304230                           *to_obj; /* string object to return */
    42314231        char       *from, /* our string argument as encoded string */
    4232                            *to; /* the result as encoded string */
     4232                           *to; /* the result as encoded string */
    42334233        Py_ssize_t      from_length; /* length of string */
    42344234        size_t          to_length; /* length of result */
     
    42504250        else
    42514251        {
    4252                 PyErr_SetString(PyExc_TypeError, "unescape_bytea() expects a string.");
     4252                PyErr_SetString(PyExc_TypeError, "unescape_bytea() expects a string");
    42534253                return NULL;
    42544254        }
     
    42664266/* get decimal point */
    42674267static char pgGetDecimalPoint__doc__[] =
    4268 "get_decimal_point() -- get decimal point to be used for money values.";
     4268"get_decimal_point() -- get decimal point to be used for money values";
    42694269
    42704270static PyObject *
     
    42954295/* set decimal point */
    42964296static char pgSetDecimalPoint__doc__[] =
    4297 "set_decimal_point(char) -- set decimal point to be used for money values.";
     4297"set_decimal_point(char) -- set decimal point to be used for money values";
    42984298
    42994299static PyObject *
     
    43094309                        s = "\0";
    43104310                else if (*s && (*(s+1) || !strchr(".,;: '*/_`|", *s)))
    4311                         s = NULL;
     4311                        s = NULL;
    43124312        }
    43134313
     
    43264326/* get decimal type */
    43274327static char pgGetDecimal__doc__[] =
    4328 "get_decimal() -- set a decimal type to be used for numeric values.";
     4328"get_decimal() -- set a decimal type to be used for numeric values";
    43294329
    43304330static PyObject *
     
    43444344/* set decimal type */
    43454345static char pgSetDecimal__doc__[] =
    4346 "set_decimal(cls) -- set a decimal type to be used for numeric values.";
     4346"set_decimal(cls) -- set a decimal type to be used for numeric values";
    43474347
    43484348static PyObject *
     
    43664366                else
    43674367                        PyErr_SetString(PyExc_TypeError,
    4368                                 "decimal type must be None or callable");
     4368                                "Decimal type must be None or callable");
    43694369        }
    43704370
     
    43744374/* get usage of bool values */
    43754375static char pgGetBool__doc__[] =
    4376 "get_bool() -- check whether boolean values are converted to bool.";
     4376"get_bool() -- check whether boolean values are converted to bool";
    43774377
    43784378static PyObject *
     
    43924392/* set usage of bool values */
    43934393static char pgSetBool__doc__[] =
    4394 "set_bool(bool) -- set whether boolean values should be converted to bool.";
     4394"set_bool(on) -- set whether boolean values should be converted to bool";
    43954395
    43964396static PyObject *
     
    44124412/* get named result factory */
    44134413static char pgGetNamedresult__doc__[] =
    4414 "get_namedresult(cls) -- get the function used for getting named results.";
     4414"get_namedresult(cls) -- get the function used for getting named results";
    44154415
    44164416static PyObject *
     
    44304430/* set named result factory */
    44314431static char pgSetNamedresult__doc__[] =
    4432 "set_namedresult(cls) -- set a function to be used for getting named results.";
     4432"set_namedresult(cls) -- set a function to be used for getting named results";
    44334433
    44344434static PyObject *
     
    44464446                }
    44474447                else
    4448                         PyErr_SetString(PyExc_TypeError, "parameter must be callable");
     4448                        PyErr_SetString(PyExc_TypeError, "Parameter must be callable");
    44494449        }
    44504450
     
    44564456/* gets default host */
    44574457static char pgGetDefHost__doc__[] =
    4458 "get_defhost() -- return default database host.";
     4458"get_defhost() -- return default database host";
    44594459
    44604460static PyObject *
     
    44654465        {
    44664466                PyErr_SetString(PyExc_TypeError,
    4467                         "method get_defhost() takes no parameter.");
     4467                        "Method get_defhost() takes no parameter");
    44684468                return NULL;
    44694469        }
     
    44754475/* sets default host */
    44764476static char pgSetDefHost__doc__[] =
    4477 "set_defhost(string) -- set default database host. Return previous value.";
     4477"set_defhost(string) -- set default database host and return previous value";
    44784478
    44794479static PyObject *
     
    44874487        {
    44884488                PyErr_SetString(PyExc_TypeError,
    4489                         "set_defhost(name), with name (string/None).");
     4489                        "set_defhost(name), with name (string/None)");
    44904490                return NULL;
    44914491        }
     
    45074507/* gets default base */
    45084508static char pgGetDefBase__doc__[] =
    4509 "get_defbase() -- return default database name.";
     4509"get_defbase() -- return default database name";
    45104510
    45114511static PyObject *
     
    45164516        {
    45174517                PyErr_SetString(PyExc_TypeError,
    4518                         "method get_defbase() takes no parameter.");
     4518                        "Method get_defbase() takes no parameter");
    45194519                return NULL;
    45204520        }
     
    45264526/* sets default base */
    45274527static char pgSetDefBase__doc__[] =
    4528 "set_defbase(string) -- set default database name. Return previous value";
     4528"set_defbase(string) -- set default database name and return previous value";
    45294529
    45304530static PyObject *
     
    45384538        {
    45394539                PyErr_SetString(PyExc_TypeError,
    4540                         "set_defbase(name), with name (string/None).");
     4540                        "set_defbase(name), with name (string/None)");
    45414541                return NULL;
    45424542        }
     
    45584558/* gets default options */
    45594559static char pgGetDefOpt__doc__[] =
    4560 "get_defopt() -- return default database options.";
     4560"get_defopt() -- return default database options";
    45614561
    45624562static PyObject *
     
    45674567        {
    45684568                PyErr_SetString(PyExc_TypeError,
    4569                         "method get_defopt() takes no parameter.");
     4569                        "Method get_defopt() takes no parameter");
    45704570                return NULL;
    45714571        }
     
    45774577/* sets default opt */
    45784578static char pgSetDefOpt__doc__[] =
    4579 "set_defopt(string) -- set default database options. Return previous value.";
     4579"set_defopt(string) -- set default options and return previous value";
    45804580
    45814581static PyObject *
     
    45894589        {
    45904590                PyErr_SetString(PyExc_TypeError,
    4591                         "set_defopt(name), with name (string/None).");
     4591                        "set_defopt(name), with name (string/None)");
    45924592                return NULL;
    45934593        }
     
    46094609/* gets default username */
    46104610static char pgGetDefUser__doc__[] =
    4611 "get_defuser() -- return default database username.";
     4611"get_defuser() -- return default database username";
    46124612
    46134613static PyObject *
     
    46184618        {
    46194619                PyErr_SetString(PyExc_TypeError,
    4620                         "method get_defuser() takes no parameter.");
     4620                        "Method get_defuser() takes no parameter");
    46214621
    46224622                return NULL;
     
    46304630
    46314631static char pgSetDefUser__doc__[] =
    4632 "set_defuser() -- set default database username. Return previous value.";
     4632"set_defuser(name) -- set default username and return previous value";
    46334633
    46344634static PyObject *
     
    46424642        {
    46434643                PyErr_SetString(PyExc_TypeError,
    4644                         "set_defuser(name), with name (string/None).");
     4644                        "set_defuser(name), with name (string/None)");
    46454645                return NULL;
    46464646        }
     
    46624662/* sets default password */
    46634663static char pgSetDefPassword__doc__[] =
    4664 "set_defpasswd() -- set default database password.";
     4664"set_defpasswd(password) -- set default database password";
    46654665
    46664666static PyObject *
     
    46734673        {
    46744674                PyErr_SetString(PyExc_TypeError,
    4675                         "set_defpasswd(password), with password (string/None).");
     4675                        "set_defpasswd(password), with password (string/None)");
    46764676                return NULL;
    46774677        }
     
    46914691/* gets default port */
    46924692static char pgGetDefPort__doc__[] =
    4693 "get_defport() -- return default database port.";
     4693"get_defport() -- return default database port";
    46944694
    46954695static PyObject *
     
    47004700        {
    47014701                PyErr_SetString(PyExc_TypeError,
    4702                         "method get_defport() takes no parameter.");
     4702                        "Method get_defport() takes no parameter");
    47034703                return NULL;
    47044704        }
     
    47104710/* sets default port */
    47114711static char pgSetDefPort__doc__[] =
    4712 "set_defport(integer) -- set default database port. Return previous value.";
     4712"set_defport(port) -- set default port and return previous value";
    47134713
    47144714static PyObject *
     
    47224722        {
    47234723                PyErr_SetString(PyExc_TypeError, "set_defport(port), with port "
    4724                         "(positive integer/-1).");
     4724                        "(positive integer/-1)");
    47254725                return NULL;
    47264726        }
Note: See TracChangeset for help on using the changeset viewer.