From 467d7b99a2f6de2a7389b3d524eb594e854e0ecb Mon Sep 17 00:00:00 2001 From: Mark Huang <mlhuang@cs.princeton.edu> Date: Wed, 8 Nov 2006 21:37:49 +0000 Subject: [PATCH 1/1] psycopg2-2.0.5.1 from initd.org --- psycopg2/AUTHORS | 8 + psycopg2/ChangeLog | 1219 ++++++++++++ psycopg2/INSTALL | 48 + psycopg2/LICENSE | 60 + psycopg2/MANIFEST | 222 +++ psycopg2/MANIFEST.in | 12 + psycopg2/PKG-INFO | 35 + psycopg2/README | 39 + psycopg2/ZPsycopgDA/DA.py | 375 ++++ psycopg2/ZPsycopgDA/__init__.py | 31 + psycopg2/ZPsycopgDA/db.py | 206 ++ psycopg2/ZPsycopgDA/dtml/add.dtml | 96 + psycopg2/ZPsycopgDA/dtml/browse.dtml | 11 + psycopg2/ZPsycopgDA/dtml/edit.dtml | 67 + psycopg2/ZPsycopgDA/dtml/table_info.dtml | 7 + psycopg2/ZPsycopgDA/icons/bin.gif | Bin 0 -> 924 bytes psycopg2/ZPsycopgDA/icons/date.gif | Bin 0 -> 930 bytes psycopg2/ZPsycopgDA/icons/datetime.gif | Bin 0 -> 925 bytes psycopg2/ZPsycopgDA/icons/field.gif | Bin 0 -> 915 bytes psycopg2/ZPsycopgDA/icons/float.gif | Bin 0 -> 929 bytes psycopg2/ZPsycopgDA/icons/int.gif | Bin 0 -> 918 bytes psycopg2/ZPsycopgDA/icons/stable.gif | Bin 0 -> 884 bytes psycopg2/ZPsycopgDA/icons/table.gif | Bin 0 -> 878 bytes psycopg2/ZPsycopgDA/icons/text.gif | Bin 0 -> 918 bytes psycopg2/ZPsycopgDA/icons/time.gif | Bin 0 -> 926 bytes psycopg2/ZPsycopgDA/icons/view.gif | Bin 0 -> 893 bytes psycopg2/ZPsycopgDA/icons/what.gif | Bin 0 -> 894 bytes psycopg2/ZPsycopgDA/pool.py | 51 + psycopg2/debian/changelog | 12 + psycopg2/debian/control | 51 + psycopg2/debian/copyright | 10 + psycopg2/debian/rules | 4 + psycopg2/doc/ChangeLog-1.x | 1744 +++++++++++++++++ psycopg2/doc/HACKING | 43 + psycopg2/doc/SUCCESS | 114 ++ psycopg2/doc/TODO | 33 + psycopg2/doc/api-screen.css | 138 ++ psycopg2/doc/api/epydoc.css | 138 ++ psycopg2/doc/api/index.html | 15 + .../api/private/__builtin__.list-class.html | 817 ++++++++ .../api/private/__builtin__.object-class.html | 270 +++ .../api/private/__builtin__.type-class.html | 384 ++++ .../api/private/datetime.tzinfo-class.html | 239 +++ psycopg2/doc/api/private/epydoc.css | 138 ++ .../private/exceptions.Exception-class.html | 128 ++ .../exceptions.StandardError-class.html | 102 + psycopg2/doc/api/private/frames.html | 15 + psycopg2/doc/api/private/help.html | 231 +++ psycopg2/doc/api/private/index.html | 15 + psycopg2/doc/api/private/indices.html | 666 +++++++ psycopg2/doc/api/private/psycopg2-module.html | 336 ++++ .../api/private/psycopg2.DataError-class.html | 103 + .../private/psycopg2.DatabaseError-class.html | 110 ++ .../doc/api/private/psycopg2.Error-class.html | 105 + .../psycopg2.IntegrityError-class.html | 103 + .../psycopg2.InterfaceError-class.html | 101 + .../private/psycopg2.InternalError-class.html | 103 + .../psycopg2.NotSupportedError-class.html | 103 + .../psycopg2.OperationalError-class.html | 103 + .../psycopg2.ProgrammingError-class.html | 103 + .../api/private/psycopg2.Warning-class.html | 99 + .../api/private/psycopg2._psycopg-module.html | 1072 ++++++++++ .../psycopg2._psycopg.ISQLQuote-class.html | 221 +++ .../psycopg2._psycopg.connection-class.html | 405 ++++ .../psycopg2._psycopg.cursor-class.html | 599 ++++++ .../private/psycopg2.extensions-module.html | 418 ++++ .../api/private/psycopg2.extras-module.html | 91 + .../psycopg2.extras.DictConnection-class.html | 202 ++ .../psycopg2.extras.DictCursor-class.html | 359 ++++ .../psycopg2.extras.DictRow-class.html | 376 ++++ .../private/psycopg2.extras.SQL_IN-class.html | 171 ++ .../doc/api/private/psycopg2.pool-module.html | 126 ++ ...pg2.pool.AbstractConnectionPool-class.html | 247 +++ ...2.pool.PersistentConnectionPool-class.html | 237 +++ .../psycopg2.pool.PoolError-class.html | 99 + ...copg2.pool.SimpleConnectionPool-class.html | 222 +++ ...pg2.pool.ThreadedConnectionPool-class.html | 236 +++ .../api/private/psycopg2.psycopg1-module.html | 121 ++ .../psycopg2.psycopg1.connection-class.html | 221 +++ .../psycopg2.psycopg1.cursor-class.html | 308 +++ .../doc/api/private/psycopg2.tz-module.html | 193 ++ ...psycopg2.tz.FixedOffsetTimezone-class.html | 273 +++ .../psycopg2.tz.LocalTimezone-class.html | 209 ++ psycopg2/doc/api/private/toc-everything.html | 134 ++ .../doc/api/private/toc-psycopg2-module.html | 58 + .../private/toc-psycopg2._psycopg-module.html | 78 + .../toc-psycopg2.extensions-module.html | 47 + .../private/toc-psycopg2.extras-module.html | 32 + .../api/private/toc-psycopg2.pool-module.html | 40 + .../private/toc-psycopg2.psycopg1-module.html | 34 + .../api/private/toc-psycopg2.tz-module.html | 37 + psycopg2/doc/api/private/toc.html | 39 + psycopg2/doc/api/private/trees.html | 196 ++ .../api/public/__builtin__.list-class.html | 817 ++++++++ .../api/public/__builtin__.object-class.html | 267 +++ .../api/public/__builtin__.type-class.html | 384 ++++ .../doc/api/public/datetime.tzinfo-class.html | 239 +++ psycopg2/doc/api/public/epydoc.css | 138 ++ .../public/exceptions.Exception-class.html | 128 ++ .../exceptions.StandardError-class.html | 102 + psycopg2/doc/api/public/frames.html | 15 + psycopg2/doc/api/public/help.html | 231 +++ psycopg2/doc/api/public/index.html | 15 + psycopg2/doc/api/public/indices.html | 418 ++++ psycopg2/doc/api/public/psycopg2-module.html | 335 ++++ .../api/public/psycopg2.DataError-class.html | 103 + .../public/psycopg2.DatabaseError-class.html | 110 ++ .../doc/api/public/psycopg2.Error-class.html | 105 + .../public/psycopg2.IntegrityError-class.html | 103 + .../public/psycopg2.InterfaceError-class.html | 101 + .../public/psycopg2.InternalError-class.html | 103 + .../psycopg2.NotSupportedError-class.html | 103 + .../psycopg2.OperationalError-class.html | 103 + .../psycopg2.ProgrammingError-class.html | 103 + .../api/public/psycopg2.Warning-class.html | 99 + .../api/public/psycopg2._psycopg-module.html | 1001 ++++++++++ .../public/psycopg2.extensions-module.html | 418 ++++ .../api/public/psycopg2.extras-module.html | 91 + .../psycopg2.extras.DictConnection-class.html | 137 ++ .../psycopg2.extras.DictCursor-class.html | 205 ++ .../public/psycopg2.extras.DictRow-class.html | 376 ++++ .../public/psycopg2.extras.SQL_IN-class.html | 171 ++ .../doc/api/public/psycopg2.pool-module.html | 126 ++ ...pg2.pool.AbstractConnectionPool-class.html | 169 ++ ...2.pool.PersistentConnectionPool-class.html | 210 ++ .../public/psycopg2.pool.PoolError-class.html | 99 + ...copg2.pool.SimpleConnectionPool-class.html | 139 ++ ...pg2.pool.ThreadedConnectionPool-class.html | 209 ++ .../api/public/psycopg2.psycopg1-module.html | 121 ++ .../psycopg2.psycopg1.connection-class.html | 156 ++ .../psycopg2.psycopg1.cursor-class.html | 161 ++ .../doc/api/public/psycopg2.tz-module.html | 193 ++ ...psycopg2.tz.FixedOffsetTimezone-class.html | 213 ++ .../psycopg2.tz.LocalTimezone-class.html | 196 ++ psycopg2/doc/api/public/toc-everything.html | 90 + .../doc/api/public/toc-psycopg2-module.html | 57 + .../public/toc-psycopg2._psycopg-module.html | 73 + .../toc-psycopg2.extensions-module.html | 47 + .../public/toc-psycopg2.extras-module.html | 32 + .../api/public/toc-psycopg2.pool-module.html | 40 + .../public/toc-psycopg2.psycopg1-module.html | 34 + .../api/public/toc-psycopg2.tz-module.html | 37 + psycopg2/doc/api/public/toc.html | 38 + psycopg2/doc/api/public/trees.html | 174 ++ psycopg2/doc/async.txt | 67 + psycopg2/doc/extensions.html | 219 +++ psycopg2/doc/extensions.rst | 260 +++ psycopg2/examples/binary.py | 89 + psycopg2/examples/copy_from.py | 178 ++ psycopg2/examples/copy_to.py | 104 + psycopg2/examples/cursor.py | 63 + psycopg2/examples/dialtone.py | 144 ++ psycopg2/examples/dict.py | 45 + psycopg2/examples/dt.py | 99 + psycopg2/examples/encoding.py | 105 + psycopg2/examples/fetch.py | 81 + psycopg2/examples/lastrowid.py | 59 + psycopg2/examples/mogrify.py | 47 + psycopg2/examples/myfirstrecipe.py | 122 ++ psycopg2/examples/notify.py | 43 + psycopg2/examples/simple.py | 53 + psycopg2/examples/somehackers.jpg | Bin 0 -> 22565 bytes psycopg2/examples/threads.py | 160 ++ psycopg2/examples/tz.py | 69 + psycopg2/examples/usercast.py | 126 ++ psycopg2/examples/whereareyou.jpg | Bin 0 -> 34980 bytes psycopg2/lib/__init__.py | 72 + psycopg2/lib/extensions.py | 69 + psycopg2/lib/extras.py | 235 +++ psycopg2/lib/pool.py | 236 +++ psycopg2/lib/psycopg1.py | 87 + psycopg2/lib/tz.py | 100 + psycopg2/psycopg/adapter_asis.c | 227 +++ psycopg2/psycopg/adapter_asis.h | 51 + psycopg2/psycopg/adapter_binary.c | 382 ++++ psycopg2/psycopg/adapter_binary.h | 53 + psycopg2/psycopg/adapter_datetime.c | 461 +++++ psycopg2/psycopg/adapter_datetime.h | 107 + psycopg2/psycopg/adapter_list.c | 297 +++ psycopg2/psycopg/adapter_list.h | 49 + psycopg2/psycopg/adapter_mxdatetime.c | 446 +++++ psycopg2/psycopg/adapter_mxdatetime.h | 94 + psycopg2/psycopg/adapter_pboolean.c | 238 +++ psycopg2/psycopg/adapter_pboolean.h | 51 + psycopg2/psycopg/adapter_qstring.c | 393 ++++ psycopg2/psycopg/adapter_qstring.h | 53 + psycopg2/psycopg/config.h | 118 ++ psycopg2/psycopg/connection.h | 97 + psycopg2/psycopg/connection_int.c | 303 +++ psycopg2/psycopg/connection_type.c | 422 ++++ psycopg2/psycopg/cursor.h | 103 + psycopg2/psycopg/cursor_int.c | 47 + psycopg2/psycopg/cursor_type.c | 1553 +++++++++++++++ psycopg2/psycopg/microprotocols.c | 161 ++ psycopg2/psycopg/microprotocols.h | 60 + psycopg2/psycopg/microprotocols_proto.c | 216 ++ psycopg2/psycopg/microprotocols_proto.h | 45 + psycopg2/psycopg/pgtypes.h | 65 + psycopg2/psycopg/pgversion.h | 2 + psycopg2/psycopg/pqpath.c | 883 +++++++++ psycopg2/psycopg/pqpath.h | 41 + psycopg2/psycopg/psycopg.h | 142 ++ psycopg2/psycopg/psycopgmodule.c | 672 +++++++ psycopg2/psycopg/python.h | 43 + psycopg2/psycopg/typecast.c | 563 ++++++ psycopg2/psycopg/typecast.h | 85 + psycopg2/psycopg/typecast_array.c | 258 +++ psycopg2/psycopg/typecast_basic.c | 141 ++ psycopg2/psycopg/typecast_binary.c | 191 ++ psycopg2/psycopg/typecast_binary.h | 47 + psycopg2/psycopg/typecast_builtins.c | 60 + psycopg2/psycopg/typecast_datetime.c | 279 +++ psycopg2/psycopg/typecast_mxdatetime.c | 231 +++ psycopg2/scripts/buildtypes.py | 124 ++ psycopg2/scripts/ext2html.py | 169 ++ psycopg2/scripts/makedocs.py | 15 + psycopg2/scripts/maketypes.sh | 41 + psycopg2/setup.cfg | 46 + psycopg2/setup.py | 293 +++ psycopg2/tests/dbapi20.py | 850 ++++++++ psycopg2/tests/extras_dictcursor.py | 47 + psycopg2/tests/test_psycopg2_dbapi20.py | 35 + psycopg2/tests/types_basic.py | 87 + 223 files changed, 39768 insertions(+) create mode 100644 psycopg2/AUTHORS create mode 100644 psycopg2/ChangeLog create mode 100644 psycopg2/INSTALL create mode 100644 psycopg2/LICENSE create mode 100644 psycopg2/MANIFEST create mode 100644 psycopg2/MANIFEST.in create mode 100644 psycopg2/PKG-INFO create mode 100644 psycopg2/README create mode 100644 psycopg2/ZPsycopgDA/DA.py create mode 100644 psycopg2/ZPsycopgDA/__init__.py create mode 100644 psycopg2/ZPsycopgDA/db.py create mode 100644 psycopg2/ZPsycopgDA/dtml/add.dtml create mode 100644 psycopg2/ZPsycopgDA/dtml/browse.dtml create mode 100644 psycopg2/ZPsycopgDA/dtml/edit.dtml create mode 100644 psycopg2/ZPsycopgDA/dtml/table_info.dtml create mode 100644 psycopg2/ZPsycopgDA/icons/bin.gif create mode 100644 psycopg2/ZPsycopgDA/icons/date.gif create mode 100644 psycopg2/ZPsycopgDA/icons/datetime.gif create mode 100644 psycopg2/ZPsycopgDA/icons/field.gif create mode 100644 psycopg2/ZPsycopgDA/icons/float.gif create mode 100644 psycopg2/ZPsycopgDA/icons/int.gif create mode 100644 psycopg2/ZPsycopgDA/icons/stable.gif create mode 100644 psycopg2/ZPsycopgDA/icons/table.gif create mode 100644 psycopg2/ZPsycopgDA/icons/text.gif create mode 100644 psycopg2/ZPsycopgDA/icons/time.gif create mode 100644 psycopg2/ZPsycopgDA/icons/view.gif create mode 100644 psycopg2/ZPsycopgDA/icons/what.gif create mode 100644 psycopg2/ZPsycopgDA/pool.py create mode 100644 psycopg2/debian/changelog create mode 100644 psycopg2/debian/control create mode 100644 psycopg2/debian/copyright create mode 100755 psycopg2/debian/rules create mode 100644 psycopg2/doc/ChangeLog-1.x create mode 100644 psycopg2/doc/HACKING create mode 100644 psycopg2/doc/SUCCESS create mode 100644 psycopg2/doc/TODO create mode 100644 psycopg2/doc/api-screen.css create mode 100644 psycopg2/doc/api/epydoc.css create mode 100644 psycopg2/doc/api/index.html create mode 100644 psycopg2/doc/api/private/__builtin__.list-class.html create mode 100644 psycopg2/doc/api/private/__builtin__.object-class.html create mode 100644 psycopg2/doc/api/private/__builtin__.type-class.html create mode 100644 psycopg2/doc/api/private/datetime.tzinfo-class.html create mode 100644 psycopg2/doc/api/private/epydoc.css create mode 100644 psycopg2/doc/api/private/exceptions.Exception-class.html create mode 100644 psycopg2/doc/api/private/exceptions.StandardError-class.html create mode 100644 psycopg2/doc/api/private/frames.html create mode 100644 psycopg2/doc/api/private/help.html create mode 100644 psycopg2/doc/api/private/index.html create mode 100644 psycopg2/doc/api/private/indices.html create mode 100644 psycopg2/doc/api/private/psycopg2-module.html create mode 100644 psycopg2/doc/api/private/psycopg2.DataError-class.html create mode 100644 psycopg2/doc/api/private/psycopg2.DatabaseError-class.html create mode 100644 psycopg2/doc/api/private/psycopg2.Error-class.html create mode 100644 psycopg2/doc/api/private/psycopg2.IntegrityError-class.html create mode 100644 psycopg2/doc/api/private/psycopg2.InterfaceError-class.html create mode 100644 psycopg2/doc/api/private/psycopg2.InternalError-class.html create mode 100644 psycopg2/doc/api/private/psycopg2.NotSupportedError-class.html create mode 100644 psycopg2/doc/api/private/psycopg2.OperationalError-class.html create mode 100644 psycopg2/doc/api/private/psycopg2.ProgrammingError-class.html create mode 100644 psycopg2/doc/api/private/psycopg2.Warning-class.html create mode 100644 psycopg2/doc/api/private/psycopg2._psycopg-module.html create mode 100644 psycopg2/doc/api/private/psycopg2._psycopg.ISQLQuote-class.html create mode 100644 psycopg2/doc/api/private/psycopg2._psycopg.connection-class.html create mode 100644 psycopg2/doc/api/private/psycopg2._psycopg.cursor-class.html create mode 100644 psycopg2/doc/api/private/psycopg2.extensions-module.html create mode 100644 psycopg2/doc/api/private/psycopg2.extras-module.html create mode 100644 psycopg2/doc/api/private/psycopg2.extras.DictConnection-class.html create mode 100644 psycopg2/doc/api/private/psycopg2.extras.DictCursor-class.html create mode 100644 psycopg2/doc/api/private/psycopg2.extras.DictRow-class.html create mode 100644 psycopg2/doc/api/private/psycopg2.extras.SQL_IN-class.html create mode 100644 psycopg2/doc/api/private/psycopg2.pool-module.html create mode 100644 psycopg2/doc/api/private/psycopg2.pool.AbstractConnectionPool-class.html create mode 100644 psycopg2/doc/api/private/psycopg2.pool.PersistentConnectionPool-class.html create mode 100644 psycopg2/doc/api/private/psycopg2.pool.PoolError-class.html create mode 100644 psycopg2/doc/api/private/psycopg2.pool.SimpleConnectionPool-class.html create mode 100644 psycopg2/doc/api/private/psycopg2.pool.ThreadedConnectionPool-class.html create mode 100644 psycopg2/doc/api/private/psycopg2.psycopg1-module.html create mode 100644 psycopg2/doc/api/private/psycopg2.psycopg1.connection-class.html create mode 100644 psycopg2/doc/api/private/psycopg2.psycopg1.cursor-class.html create mode 100644 psycopg2/doc/api/private/psycopg2.tz-module.html create mode 100644 psycopg2/doc/api/private/psycopg2.tz.FixedOffsetTimezone-class.html create mode 100644 psycopg2/doc/api/private/psycopg2.tz.LocalTimezone-class.html create mode 100644 psycopg2/doc/api/private/toc-everything.html create mode 100644 psycopg2/doc/api/private/toc-psycopg2-module.html create mode 100644 psycopg2/doc/api/private/toc-psycopg2._psycopg-module.html create mode 100644 psycopg2/doc/api/private/toc-psycopg2.extensions-module.html create mode 100644 psycopg2/doc/api/private/toc-psycopg2.extras-module.html create mode 100644 psycopg2/doc/api/private/toc-psycopg2.pool-module.html create mode 100644 psycopg2/doc/api/private/toc-psycopg2.psycopg1-module.html create mode 100644 psycopg2/doc/api/private/toc-psycopg2.tz-module.html create mode 100644 psycopg2/doc/api/private/toc.html create mode 100644 psycopg2/doc/api/private/trees.html create mode 100644 psycopg2/doc/api/public/__builtin__.list-class.html create mode 100644 psycopg2/doc/api/public/__builtin__.object-class.html create mode 100644 psycopg2/doc/api/public/__builtin__.type-class.html create mode 100644 psycopg2/doc/api/public/datetime.tzinfo-class.html create mode 100644 psycopg2/doc/api/public/epydoc.css create mode 100644 psycopg2/doc/api/public/exceptions.Exception-class.html create mode 100644 psycopg2/doc/api/public/exceptions.StandardError-class.html create mode 100644 psycopg2/doc/api/public/frames.html create mode 100644 psycopg2/doc/api/public/help.html create mode 100644 psycopg2/doc/api/public/index.html create mode 100644 psycopg2/doc/api/public/indices.html create mode 100644 psycopg2/doc/api/public/psycopg2-module.html create mode 100644 psycopg2/doc/api/public/psycopg2.DataError-class.html create mode 100644 psycopg2/doc/api/public/psycopg2.DatabaseError-class.html create mode 100644 psycopg2/doc/api/public/psycopg2.Error-class.html create mode 100644 psycopg2/doc/api/public/psycopg2.IntegrityError-class.html create mode 100644 psycopg2/doc/api/public/psycopg2.InterfaceError-class.html create mode 100644 psycopg2/doc/api/public/psycopg2.InternalError-class.html create mode 100644 psycopg2/doc/api/public/psycopg2.NotSupportedError-class.html create mode 100644 psycopg2/doc/api/public/psycopg2.OperationalError-class.html create mode 100644 psycopg2/doc/api/public/psycopg2.ProgrammingError-class.html create mode 100644 psycopg2/doc/api/public/psycopg2.Warning-class.html create mode 100644 psycopg2/doc/api/public/psycopg2._psycopg-module.html create mode 100644 psycopg2/doc/api/public/psycopg2.extensions-module.html create mode 100644 psycopg2/doc/api/public/psycopg2.extras-module.html create mode 100644 psycopg2/doc/api/public/psycopg2.extras.DictConnection-class.html create mode 100644 psycopg2/doc/api/public/psycopg2.extras.DictCursor-class.html create mode 100644 psycopg2/doc/api/public/psycopg2.extras.DictRow-class.html create mode 100644 psycopg2/doc/api/public/psycopg2.extras.SQL_IN-class.html create mode 100644 psycopg2/doc/api/public/psycopg2.pool-module.html create mode 100644 psycopg2/doc/api/public/psycopg2.pool.AbstractConnectionPool-class.html create mode 100644 psycopg2/doc/api/public/psycopg2.pool.PersistentConnectionPool-class.html create mode 100644 psycopg2/doc/api/public/psycopg2.pool.PoolError-class.html create mode 100644 psycopg2/doc/api/public/psycopg2.pool.SimpleConnectionPool-class.html create mode 100644 psycopg2/doc/api/public/psycopg2.pool.ThreadedConnectionPool-class.html create mode 100644 psycopg2/doc/api/public/psycopg2.psycopg1-module.html create mode 100644 psycopg2/doc/api/public/psycopg2.psycopg1.connection-class.html create mode 100644 psycopg2/doc/api/public/psycopg2.psycopg1.cursor-class.html create mode 100644 psycopg2/doc/api/public/psycopg2.tz-module.html create mode 100644 psycopg2/doc/api/public/psycopg2.tz.FixedOffsetTimezone-class.html create mode 100644 psycopg2/doc/api/public/psycopg2.tz.LocalTimezone-class.html create mode 100644 psycopg2/doc/api/public/toc-everything.html create mode 100644 psycopg2/doc/api/public/toc-psycopg2-module.html create mode 100644 psycopg2/doc/api/public/toc-psycopg2._psycopg-module.html create mode 100644 psycopg2/doc/api/public/toc-psycopg2.extensions-module.html create mode 100644 psycopg2/doc/api/public/toc-psycopg2.extras-module.html create mode 100644 psycopg2/doc/api/public/toc-psycopg2.pool-module.html create mode 100644 psycopg2/doc/api/public/toc-psycopg2.psycopg1-module.html create mode 100644 psycopg2/doc/api/public/toc-psycopg2.tz-module.html create mode 100644 psycopg2/doc/api/public/toc.html create mode 100644 psycopg2/doc/api/public/trees.html create mode 100644 psycopg2/doc/async.txt create mode 100644 psycopg2/doc/extensions.html create mode 100644 psycopg2/doc/extensions.rst create mode 100644 psycopg2/examples/binary.py create mode 100644 psycopg2/examples/copy_from.py create mode 100644 psycopg2/examples/copy_to.py create mode 100644 psycopg2/examples/cursor.py create mode 100644 psycopg2/examples/dialtone.py create mode 100644 psycopg2/examples/dict.py create mode 100644 psycopg2/examples/dt.py create mode 100644 psycopg2/examples/encoding.py create mode 100644 psycopg2/examples/fetch.py create mode 100644 psycopg2/examples/lastrowid.py create mode 100644 psycopg2/examples/mogrify.py create mode 100644 psycopg2/examples/myfirstrecipe.py create mode 100644 psycopg2/examples/notify.py create mode 100644 psycopg2/examples/simple.py create mode 100644 psycopg2/examples/somehackers.jpg create mode 100644 psycopg2/examples/threads.py create mode 100644 psycopg2/examples/tz.py create mode 100644 psycopg2/examples/usercast.py create mode 100644 psycopg2/examples/whereareyou.jpg create mode 100644 psycopg2/lib/__init__.py create mode 100644 psycopg2/lib/extensions.py create mode 100644 psycopg2/lib/extras.py create mode 100644 psycopg2/lib/pool.py create mode 100644 psycopg2/lib/psycopg1.py create mode 100644 psycopg2/lib/tz.py create mode 100644 psycopg2/psycopg/adapter_asis.c create mode 100644 psycopg2/psycopg/adapter_asis.h create mode 100644 psycopg2/psycopg/adapter_binary.c create mode 100644 psycopg2/psycopg/adapter_binary.h create mode 100644 psycopg2/psycopg/adapter_datetime.c create mode 100644 psycopg2/psycopg/adapter_datetime.h create mode 100644 psycopg2/psycopg/adapter_list.c create mode 100644 psycopg2/psycopg/adapter_list.h create mode 100644 psycopg2/psycopg/adapter_mxdatetime.c create mode 100644 psycopg2/psycopg/adapter_mxdatetime.h create mode 100644 psycopg2/psycopg/adapter_pboolean.c create mode 100644 psycopg2/psycopg/adapter_pboolean.h create mode 100644 psycopg2/psycopg/adapter_qstring.c create mode 100644 psycopg2/psycopg/adapter_qstring.h create mode 100644 psycopg2/psycopg/config.h create mode 100644 psycopg2/psycopg/connection.h create mode 100644 psycopg2/psycopg/connection_int.c create mode 100644 psycopg2/psycopg/connection_type.c create mode 100644 psycopg2/psycopg/cursor.h create mode 100644 psycopg2/psycopg/cursor_int.c create mode 100644 psycopg2/psycopg/cursor_type.c create mode 100644 psycopg2/psycopg/microprotocols.c create mode 100644 psycopg2/psycopg/microprotocols.h create mode 100644 psycopg2/psycopg/microprotocols_proto.c create mode 100644 psycopg2/psycopg/microprotocols_proto.h create mode 100644 psycopg2/psycopg/pgtypes.h create mode 100644 psycopg2/psycopg/pgversion.h create mode 100644 psycopg2/psycopg/pqpath.c create mode 100644 psycopg2/psycopg/pqpath.h create mode 100644 psycopg2/psycopg/psycopg.h create mode 100644 psycopg2/psycopg/psycopgmodule.c create mode 100644 psycopg2/psycopg/python.h create mode 100644 psycopg2/psycopg/typecast.c create mode 100644 psycopg2/psycopg/typecast.h create mode 100644 psycopg2/psycopg/typecast_array.c create mode 100644 psycopg2/psycopg/typecast_basic.c create mode 100644 psycopg2/psycopg/typecast_binary.c create mode 100644 psycopg2/psycopg/typecast_binary.h create mode 100644 psycopg2/psycopg/typecast_builtins.c create mode 100644 psycopg2/psycopg/typecast_datetime.c create mode 100644 psycopg2/psycopg/typecast_mxdatetime.c create mode 100644 psycopg2/scripts/buildtypes.py create mode 100755 psycopg2/scripts/ext2html.py create mode 100755 psycopg2/scripts/makedocs.py create mode 100755 psycopg2/scripts/maketypes.sh create mode 100644 psycopg2/setup.cfg create mode 100644 psycopg2/setup.py create mode 100644 psycopg2/tests/dbapi20.py create mode 100644 psycopg2/tests/extras_dictcursor.py create mode 100644 psycopg2/tests/test_psycopg2_dbapi20.py create mode 100644 psycopg2/tests/types_basic.py diff --git a/psycopg2/AUTHORS b/psycopg2/AUTHORS new file mode 100644 index 00000000..44c77fc8 --- /dev/null +++ b/psycopg2/AUTHORS @@ -0,0 +1,8 @@ +Main authors: + Federico Di Gregorio <fog@debian.org> + +For the win32 port: + Jason Erickson <jerickso@indian.com> (most of his changes are still in 2.0) + +Additional Help: + diff --git a/psycopg2/ChangeLog b/psycopg2/ChangeLog new file mode 100644 index 00000000..b273e20d --- /dev/null +++ b/psycopg2/ChangeLog @@ -0,0 +1,1219 @@ +2006-09-02 Federico Di Gregorio <fog@initd.org> + + * Release 2.0.5.1. + + * psycopg/cursor_type.c: applied patch from Jason Erickson to + build on MSVC and older gcc. + +2006-09-01 Federico Di Gregorio <fog@initd.org> + + * Release 2.0.5. + + * Fixed patch from #119, see tracker for details. + + * Preparing release 2.0.5. + + * psycopg/psycopgmodule.c: fixed filling of connection errors + to include OperationalError. + + * setup.py: removed pydatetime option from initialize_options + to make sure that the value in setup.cfg is used. + + * psycopg/psycopgmodule.c: applied patch from jdahlin (#120) + to have .connect() accept either a string or int as the port + parameter. + + * psycopg/adapter_binary.c: applied patch from jdahlin (#119) + to fix the segfault on empty binary buffers. + + * psycopg/connection_type.c: added .status attribute to expose + the internal status. + + * psycopg/pqpath.c: applied patch from intgr (#117) to fix + segfault on null queries. + + * psycopg/cursor_type.c: applied patch from intgr (#116) to + fix bad keyword naming and segfault in .executemany(). + + * ZPsycopgDA/DA.py: applied ImageFile patch from Charlie + Clark. + + * lib/pool.py: applied logging patch from Charlie Clark. + It will probably get a makeup and be moved to the top-level + module later. + +2006-08-02 Federico Di Gregorio <fog@initd.org> + + * Release 2.0.4. + + * Fixed bug in float conversion (check for NULL string was + erroneously removed in 2.0.3!) + +2006-07-31 Federico Di Gregorio <fog@initd.org> + + * Release 2.0.3. + + * psycopg/cursor_type.c: applied patch from jbellis (#113) to + allow column selection in .copy_from(). + + * psycopg/psycopgmodule.c: fixed memory leak in custom exceptions + (applied patch from #114). + +2006-07-26 Federico Di Gregorio <fog@initd.org> + + * psycopg/adapter_datetime.c (pydatetime_str): fixed error + in conversion of microseconds for intervals and better algo + (thanks to Mario Frasca.) + +2006-06-18 Federico Di Gregorio <fog@initd.org> + + * psycopg/adapter_binary.c: same as below. + + * psycopg/adapter_qstring.c: does not segfault anymore if + .getquoted() is called without preparing the qstring with + the connection. + +2006-06-15 Federico Di Gregorio <fog@initd.org> + + * psycopg/typecast_basic.c: fixed problem with bogus + conversion when importing gtk (that was crazy, I didn't + understand why it happened but the new code just fixes it.) + + * ZPsycopgDA/db.py: better type analisys, using an hash + instead of a series of if (variation on patch from Charlie + Clark.) + +2006-06-11 Federico Di Gregorio <fog@initd.org> + + * Release 2.0.2. + + * psycopg/typecast_array.c (typecast_array_cleanup): fixed a + problem with typecast_array_cleanup always returning the new + string length shorter by 1 (Closes: #93). + + * psycopg/adapter_binary.c: as below. + + * psycopg/adapter_qstring.c: wrapped #warning in #ifdef __GCC__ + because other compilers don't have it and it will just break + compilation (patch from jason, our great win32 builder). + + * psycopg/adapter_list.c: applied patch to adapt an empty list + into an empty array and not to NULL (from iGGy, closes: #108). + + * psycopg/cursor_type.c: applied patch from wkv to avoid + under-allocating query space when the parameters are not of the + right type (Closes: #110). + + * psycopg/connection_int.c: applied patch from wkv to avoid off + by one allocation of connection encoding string (Closes: #109). + +2006-06-09 Federico Di Gregorio <fog@initd.org> + + * Release 2.0.1. + + * Fixed some buglets in ZPsycopgDA (was unable to load due + to shorter version number in psycopg module.) + +2006-06-08 Federico Di Gregorio <fog@initd.org> + + * Release 2.0. + + * ZPsycopgDA/DA.py: removed Browse table for 2.0 release; we'll + add it back later. + +2006-05-26 Federico Di Gregorio <fog@initd.org> + + * Applied better PostgreSQL patch from AA. + +2006-05-24 Federico Di Gregorio <fog@initd.org> + + * Enabled 8.1.4 security fix only when the version is >= 8.1.4, fall + back to old code otherwise. + + * psycopg/adapter_qstring.c: now quote using PQescapeStringConn if + available. + + * psycopg/adapter_binary.c: now quote using PQescapeByteaConn if + available. + +2006-04-38 Federico Di Gregorio <fog@initd.org> + + * setup.py: fixed little problem with mx_include_dir as suggested + by kvc (this closes #102). + +2006-04-24 Federico Di Gregorio <fog@initd.org> + + * psycopg/adapter_pboolean.c: added the possibility to format boolean + values as "true" and "false" instead of "'t'" and "'f'". + +2006-03-08 Federico Di Gregorio <fog@initd.org> + + * lib/extras.py: added .next() to DictCursot to support iteration. + +2006-03-02 Federico Di Gregorio <fog@initd.org> + + * psycopg/typecast_array.c (typecast_array_tokenize): removed cast + to build without warnings on 64 bit arches. + +2006-02-11 Federico Di Gregorio <fog@initd.org> + + * Release 2.0 beta 8. + + * psycopg/config.h: applied patch from Jason to fix handle leak on + win32, as documented in #92. + +2006-02-11 Federico Di Gregorio <fog@initd.org> + + * Release 2.0 beta 7. + + * psycopg/psycopgmodule.c: applied fix for memory overflow in + connect() (reported by solt, #91.) + + * setup.py: applied patch from lbruno. + +2006-01-11 Federico Di Gregorio <fog@initd.org> + + * setup.py: does not report an error in pg_config unless the pg_config + was explicitly set (allows for building with old options.) + +2006-01-06 Daniele Varrazzo <daniele.varrazzo@gmail.com> + + * setup.py: libpq.dll not used anymore. win32 setup uses pg_config too. + +2006-01-05 Federico Di Gregorio <fog@initd.org> + + * psycopg/psycopgmodule.c (psyco_set_error): added function to set extra + parameters on ProgrammingError instances. Also modified all occurances of + PyErr_SetString(ProgrammingError,...) to psycopg_set_error(). + + * setup.{cfg,py}: we now use pg_config to locate PostgreSQL libraries + and headers (modified patch from lbruno, see #70.) + +2006-01-01 Federico Di Gregorio <fog@initd.org> + + * Preparing release 2 beta 7. + + * MANIFEST.in: we now distrbute pre-built documentation (still need + to add to setup.py the code necessary to build docs as part of the + build process.) + + * psycopg/connection_int.c: PostgreSQL encoding names are now force + uppercase (after all PostgreSQL documentation reports them this way.) + +2005-12-11 Federico Di Gregorio <fog@initd.org> + + * psycopg/typecast_array.c (typecast_array_cleanup): added functio + to cleanup the "[...]=" part of an array result. This probably will + need some more work for nested arrays but it fixed every test I was + able to write. (Closes: #80) + +2005-12-11 Federico Di Gregorio <fog@initd.org> + + * setup.py: half-applied patch from Tavis to specify mx_include_dir + in setup.cfg. + + * psycopg/typecast.c (typecast_parse_time): cz limit in the while + loop is 6, not 5. This solve the problem with "fractionary" time zones + and fixes #78. + +2005-12-06 Federico Di Gregorio <fog@initd.org> + + * lib/extras.py: added .callproc() to DictCursor as suggested + by Philip Semanchuk. + +2005-11-29 Federico Di Gregorio <fog@initd.org> + + * MANIFEST.in: added docs/async.txt. (Closes: #75) + +2005-11-26 Daniele Varrazzo <daniele.varrazzo@gmail.com> + + * psycopg/psycopgmodule.c: fixed exceptions refcount. + + * Fixed lots of doctrings and added Epydoc-generated docs support. + +2005-11-24 Federico Di Gregorio <fog@initd.org> + + * sandbox: added all the test and creash-me files to the repository. + + * psycopg/typecast.c (typecast_dealloc): now directly calls + PyObject_Del to avoid to segfault. + +2005-11-20 Federico Di Gregorio <fog@initd.org> + + * psycopg/typecast.c: fixed problem with microseconds conversion by + applying slightly modified patch from Ronnie Mackay. + +2005-11-19 Federico Di Gregorio <fog@initd.org> + + * lib/extensions.py: COMMITED -> COMMITTED. (Closes: #73) + + * doc/extensions.rst: included Daniele's work after minor cosmetic changes + like using the new constants instead of numbers for transaction isolation + levels. + +2005-11-17 Federico Di Gregorio <fog@initd.org> + + * ZPsycopgDA/pool.py: fixed connections leak by using the new name + (PersistentConnectionPool) for the old connection pool class. + +2005-11-16 Federico Di Gregorio <fog@initd.org> + + * Preparing release 2.0 beta 6. + + * psycopg/adapter_mxdatetime.c: fixed all problems with mx conversions. + + * psycopg/typecast.c: now the timezone is set correctly even if there + are no microseconds and/or the offset is 0; + + * examples/encoding.py: fixed example by using python utf8 encoding for + the whole file. + + * lib/__init__.py: very nice hack from Harald Armin Massa to allow + py2exe and similar tools to do their work without problems. + +2005-11-15 Federico Di Gregorio <fog@initd.org> + + * psycopg/psycopgmodule.c: now bails out with correct exception when one + of the needed modules can't be imported (should fix #32.) + +2005-11-14 Federico Di Gregorio <fog@initd.org> + + * psycopg/typecast.c: added typecast_parse_date and typecast_parse_time + functions to do locale-safe date/time parsing. This would probably also + speed-up psycopg a little bit. + +2005-11-07 Federico Di Gregorio <fog@initd.org> + + * psycopg/pqpath.c: fixed problem with uninitialized value (all this was + started by replacing calloc() calls with PyMem_Malloc().) + +2005-11-04 Federico Di Gregorio <fog@initd.org> + + * psycopg/typecast.c: a lot of changes: + - made typecast a new-style type + - removed coerce code and implemented the richcompare protocol that + allows to compare objects of different types + - much better __cmp__ method that allows to compare two typecast + objects and returns True if any two of the mapped oids match + - any object that can be used as an int works as right-hand operand + in __cmp__ operations + + * psycopg/typecast_datetime.c: now typecast_PYINTERVAL_cast limit the + scan to 'len' characters in the string (should fix #65.) + +2005-11-03 Federico Di Gregorio <fog@initd.org> + + * Applied patch from Daniele Varazzo to enable Decimal on Python + 2.3 when the module is available (run-time check, nice.) + +2005-10-26 Federico Di Gregorio <fog@initd.org> + + * setup.cfg: added include_dirs line for SUSE 9.3. + +2005-10-22 Federico Di Gregorio <fog@initd.org> + + * psycopg/cursor_type.c: added support for named cursors: + - .fetchXXX() methods now execute a FETCH if the cursor is named + - .execute() executes a DECLARE if the cursor is named + - .execute() fails if a named cursor is used in autocommit + - .executemany() can't be called on named cursors + - .scroll() executes a MOVE if the cursor is named + - .close() executes a CLOSE if the cursor is named + Also, a "transaction mark" was added to both the connection and the + cursor and an exception is raised when using a named cursor unless the + two marks correspond. + + * psycopg/connection_int.c: snprintf->PyOS_snprintf. + + * psycopg/psycopgmodule.c: snprintf->PyOS_snprintf. + + * psycopg/cursor_type.c: changed self->query type from C string to + PyObject* to better manage queries in named cursors. + + * psycopg/psycopgmodule.c: cleaned up exception names (now the errors + is printed as psycopg2.Error and not as the confusing + psycopg2._psycopg.Error.) + +2005-10-20 Federico Di Gregorio <fog@initd.org> + + * lib/pool.py: renamed ThreadedConnectionPool to PersistentConnectionPool + and added a connection pool that allows multiple connections per thread + as ThreadedConnectionPool (courtesy of Daniele Varrazzo.) + +2005-10-19 Federico Di Gregorio <fog@initd.org> + + * Releasing 2.0 beta 5. + + * psycopg/adapter_mxdatetime.c: reverted to old strftime method to format + mx.DateTime objects; the new method didn't worked in some corner-cases. + This makes impossible to have more than 2 decimal places for seconds but + at least we get the time right every time. + +2005-10-18 Federico Di Gregorio <fog@initd.org> + + * NOTIFY is back end working. + + * psycopg/connection_type.c: fixed problem with initialization of + notifies list (also fixed small memory leak in connection dealloc.) + + * examples/notify.py: added NOTIFY example. + + * psycopg/cursor_type.c: added per-cursor type-casters dictionaries. + +2005-10-18 Federico Di Gregorio <fog@initd.org> + + * psycopg/typecast.c: temporary fix to typecasting objects to return + False for any comparaison except an integer in self.values (i.e., we + don't raise an exception anymore on a coerce error.) Epydoc is now + happy. + + * psycopg/config.h: ZETA config.h patch from Charlie Clark. + + * examples/threads.py: fixed small typo: psycopg -> psycopg2. + + * Big cleanup of unsigned chars to tame gcc 4. + + * Big cleanup of module names (i.e., psycopg2._psycopg everywhere.) + + * psycopg/config.h: added fake localtime_r for platforms missing it + + * psycopg/cursor_type.c: cursors now have a FixedOffsetTimezone + tzinfo_factory by default. + + * psycopg/adapter_datetime.c: added tzinfo argument to psycopg2.Time and + psycopg2.Timestamp. Also now TimestampFromTicks sets the tzinfo object + to psycopg2.tz.LOCAL. + +2005-10-17 Federico Di Gregorio <fog@initd.org> + + * psycopg/adapter_datetime.c: we now use localtime() instead of gmtime() + to accound for the local time-zone in timestamps. + + * 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. + + * lib/psycopg1.py: explicitly set isolation level to 2 on .connect() + to mimic psycopg 1 behaviour. + + * psycopg/connection_int.c: now set isolation level from + default_transaction_isolation backend environment value. + + * psycopg/pqpath.c: removed serialization level 3: now everybody + (except me) has to use the mnemonics defined in psycopg2.extensions. + + * lib/extensions.py: Added mnemonics for serialization levels. + +2005-10-02 Federico Di Gregorio <fog@debian.org> + + * psycopg/cursor_type.c (psyco_curs_callproc): applied callproc + patch from Matt Goodall (added a check on _psyco_curs_execute + return value and substituted malloc/free with PyMem versions.) + +2005-10-01 Federico Di Gregorio <fog@debian.org> + + * psycopg/connection_int.c: fixed segfault by moving PyErr_Format + after GIL acquisition (closes: #50). + + * psycopg/connection_type.c: applied patch from Matt Goodall to + fix some doc strings. + +2005-09-23 Federico Di Gregorio <fog@debian.org> + + * lib/pool.py: applied patch from piro to avoid the scan of the + whole connection array on getconn(). + +2005-09-12 Federico Di Gregorio <fog@initd.org> + + * lib/pool.py: Applied psycopg->psycopg2 patch to from bug #35. + + * ZpsycopgDA/db.py: fixed problem with OperationalError that + resulted in cryptic message to Zope users ("'OperationalError' is + not defined".) + +2005-08-23 Federico Di Gregorio <fog@debian.org> + + * setup.py: applied patch from Daniele Varrazzo to avoid segfaults + when compiling with migw for Python 2.4.x. + + * psycopg/adapter_mxdatetime.c (mxdatetime_str): ported code from 1.1.x + to convert mxDateTime object preserving the precision of fractional + seconds. + +2005-08-22 Federico Di Gregorio <fog@debian.org> + + * ZPsycopgDA/*.py: psycopg -> psycopg2. + + * setup.py: modified to install the module components under + psycopg2 on windows too (thanks to Daniele Varrazzo.) + +2005-08-07 Federico Di Gregorio <fog@debian.org> + + * psycopg/config.h: added __sun__ to the symbols checked for round() + +2005-07-21 Federico Di Gregorio <fog@debian.org> + + * psycopg/adapter_datetime.c (psyco_XXXFromTicks): fixed the 1900 + years offset reported by Jeroen van Dongen (see ticket #33). + +2005-07-17 Federico Di Gregorio <fog@debian.org> + + * Release 2.0 beta 4. + + * lib/extras.py (DictConnection.cursor): added DictConnection to + make easier to retrieve data in DictRows. + +2005-06-24 Federico Di Gregorio <fog@initd.org> + + * psycopg/typecast_datetime.c (typecast_PYINTERVAL_cast): applied patch + from Geert Jansen to fix interval bug due to overflow. + +2005-06-18 Federico Di Gregorio <fog@initd.org> + + * setup.cfg: some clarifications and include_dirs example for Mandrake. + + * ZPsycopgDA/DA.py: DTMLFile -> HTMLFile everywhere to fix zope + cut&paste problems. + + * MANIFEST.in: added missing files to do bdist_rpm. + + * lib/psycopg1.py: fixed .dictfetchrow() to return None if fetchone() + returns None instead of raising an exception. + + * ZPsycopgDA/icons: replaced corrupted icons with good ones. + +2005-06-13 Federico Di Gregorio <fog@initd.org> + + * psycopg/psycopgmodule.c (psyco_connect): changed the port keyword + parameter type to int (instead of string); this should fix #23. + + * psycopg/cursor_type.c (_psyco_curs_execute): now checks for + empty queries and raise a ProgrammingError if appropriate (closes: + #24). + + * setup.py: psycopg module renamed to psycopg2. + +2005-06-02 Federico Di Gregorio <fog@debian.org> + + * psycopg/cursor_type.c (_psyco_curs_execute): fixed segfault when + not passing string or unicode to .execute(). + +2005-06-01 Federico Di Gregorio <fog@debian.org> + + * examples/fetch.py: added example about using DECLARE CURSOR. + + * psycopg/adapter_datetime.c (psyco_TimestampFromTicks): "Hmmm, + looks like someone forgot that C expects months to start counting + from 0, but the Python date routines start counting from 1." That + was me: fixed. + +2005-05-31 Federico Di Gregorio <fog@debian.org> + + * psycopg/cursor_type.c (_psyco_curs_execute): if a + UnicodeEncodeError is raised during the converion of a unicode + query we let it propagate insead of segfaulting. + +2005-5-27 Federico Di Gregorio, <fog@lana.initd.org> + + * tests/types_basic.py: fixed float and binary tests. + +2005-05-26 Federico Di Gregorio <fog@debian.org> + + * Release 2.0b3. + + * ZPsycopgDA/db.py (DB.convert_description): isolated description + conversion (and fixed the conversion as per #18). + + * ZPsycopgDA/DA.py: fixed again; this time Zope should work for + real. :/ Also fixed the type-casters (psycopg 2 added the extra + cursor parameter) as reported in #18. + + * psycopg/psycopgmodule.c (init_psycopg): fixed Python 2.2 build. + +2005-05-19 Federico Di Gregorio <fog@debian.org> + + * Release 2.0b2. + + * lib/extras.py (DictRow): Some extra methods for DictRow. + + * psycopg/cursor_type.c (_psyco_curs_execute): added explict check + to avoid using None as bound variables (very importand for cursor + subclasses calling cursor.execute(self, query, None). + +2005-05-18 Federico Di Gregorio <fog@debian.org> + + * ZPsycopgDA/DA.py (ALLOWED_PSYCOPG_VERSIONS): updated to work + with 2.0b2 only (will support only the exact version untill final + 2.0 release.) + + * setup.py: Applied combined patch from Daniele Varrazzo and Jason + Erickson to build on win32 using MSVC or mingw. + +2005-05-15 Federico Di Gregorio <fog@debian.org> + + * psycopg/microprotocols.c (microprotocols_adapt): fixed memory + leak on None as suggested by gh (closes: #16). + +2005-05-10 Federico Di Gregorio <fog@debian.org> + + * lib/extras.py (DictRow): we now save a reference to the index + itself and not to the cursor to avoid problems while accessing + DictRow objects after reusing the cursor for a different query + (using Kevin Jacobs db_row would be much better but DictRow is + just an example, right?) + +2005-05-09 Federico Di Gregorio <fog@debian.org> + + * Release 2.0 beta 1. + + * psycopg/typecast_datetime.c (typecast_PYDATETIME_cast): fixed a + typo (pyDateTimeModuleP->pyDateTimeTypeP) that was causing errors + with infinite datetime values. + + * psycopg/adapter_binary.c (binary_str): Py_XINCREF on the buffer + that can be NULL on error. + + * psycopg/typecast_binary.*: applied slightly modified + chunk/buffer object patch to allow round-trip of buffer objects + (BYTEA columns.) + + * psycopg/cursor_type.c (psyco_curs_executemany): applied slightly + fixed patch from wrobell to allow iterators in .executemany(). + +2005-04-18 Federico Di Gregorio <fog@debian.org> + + * MANIFEST.in: included debian directory. + +2005-04-10 Federico Di Gregorio <fog@debian.org> + + * psycopg/adapter_list.*: added list adapter. + + * psycopg/microprotocols.c (microprotocol_getquoted): moved + _mogrify_getquoted into utility function in the microprotocols + library. + + * setup.py: Added extensive error message on missing datetime + headers. + + * Applied mingw patch from Daniele Varazzo. + +2005-04-03 Federico Di Gregorio <fog@debian.org> + + * lib/psycopg1.py (connection.autocommit): added compatibility + .autocommit() method. + + * psycopg/psycopgmodule.c (psyco_connect): factory -> + connection_factory. + + * lib/psycopg1.py: added psycopg 1.1.x compatibility module. + +2005-03-29 Federico Di Gregorio <fog@debian.org> + + * Applied patch to fix tuple count. + + * psycopg/pqpath.c (pq_is_busy): Staring from bug report from + Jason Erickson fixed segfaults due to calling Python function + without holding the GIL. + +2005-03-24 Federico Di Gregorio <fog@debian.org> + + * psycopg/adapter_binary.c (binary_escape): propagated Andrea's + fix to binary adapter. + + * psycopg/adapter_qstring.c (qstring_quote): applied patch from + Andrea Arcangeli to fix allocation failures (>4Gb) on 64 bit + arches. + + * psycopg/typecast_array.c (typecast_array_tokenize): much better + tokenization code. + +2005-03-23 Federico Di Gregorio <fog@debian.org> + + * psycopg/typecast_basic.c: all the basic casters now respect the + passed string length. + + * psycopg/typecast.c (typecast_cast): set curs->caster to self + during the type-casting. + + * psycopg/cursor_type.c: added "typecaster" attribute to the + cursor (this is safe, cursors can't be shared among threads and + the attribute is RO.) + +2005-03-22 Federico Di Gregorio <fog@debian.org> + + * psycopg/typecast_array.c: added some more structure to implement + array typecasting. + + * scripts/buildtypes.py: new version to include array data. + +2005-03-15 Federico Di Gregorio <fog@debian.org> + + * lib/extensions.py: Added AsIs import. + +2005-03-12 Federico Di Gregorio <fog@debian.org> + + * psycopg/cursor.h: removed "qattr", not used anymore and added + "cast", holding the typecaster currently in use. + + * Release 1.99.13. + + * psycopg/cursor_type.c (psyco_curs_executemany): implemented as a + wrapper to extract python arguments and then call + _psyco_curs_execute(). + + * psycopg/cursor_type.c (_psyco_curs_execute): splitted away + python argument parsing from the real execute code, to later allow + for .executemany(). + + * psycopg/cursor_type.c (_psyco_curs_buildrow_fill): modified to + call typecast_cast(). + + * psycopg/typecast.c (typecast_call/typecast_cast): modified + typecast_call to use the new typecast_cast that avoids one string + conversion on every cast. + +2005-03-04 Federico Di Gregorio <fog@initd.org> + + * Release 1.99.12.1. + + * psycopg/adapter_asis.c (asis_str): changed call to PyObject_Repr + to PyObject_Str to avoid problems with long integers. + +2005-03-03 Federico Di Gregorio <fog@debian.org> + + * psycopg/typecast.h: added array casting functions. + + * scripts/maketypes.sh: does not generate pgversion.h anymore. + + * Updated all examples for the release. + +2005-03-02 Federico Di Gregorio <fog@debian.org> + + * Release 1.99.12. + + * psycopg/adapter_*.c: added __conform__ to all adapters. + + * psycopg/adapter_qstring.c (qstring_quote): we now use + PyString_AsStringAndSize() instead of strlen() that would stop at + the first embedded \0 (but note that libpq quoting function will + truncate the string anyway!) + + * COPY TO implemented using both old and new (v3) protocol. + + * psycopg/pqpath.c (_pq_copy_out_v3): implemented and working. + + * psycopg/cursor_type.c (psyco_curs_copy_to): added cursor object + interface for copy_to. + + * COPY FROM implemented using both old and new (v3) protocol. + + * psycopg/config.h (Dprintf): declaration for asprintf is gone. + + * psycopg/pqpath.c (_pq_copy_in_v3): implemented. + +2005-03-01 Federico Di Gregorio <fog@debian.org> + + * setup.py: now we generate a slighly more verbose version string + that embeds some of the compile options, to facilitate users' bug + reports. + + * psycopg/cursor_type.c (psyco_curs_copy_from): we now use + PyOS_snprintf instead of asprintf. On some platforms this can be + bad (win32).. if that's your case, get a better platform. :/ + + * psycopg/microprotocols.c (microprotocols_adapt): fixed small + typo that made adaptation using __conform__ impossible. + +2005-02-28 Federico Di Gregorio <fog@debian.org> + + * lib/extras.py: removed AsIs adapter (now a built-in); also + removed prepare() method from the adapters that don't use it to + avoid an extra method call at mogrification time. + + * psycopg/psycopgmodule.c (psyco_adapters_init): added + initialization of the AsIs adapter (adapts int, long, float and + *wonder* None!) + + * psycopg/cursor_type.c (_mogrify_getquoted): reorganized the code + to adapt and then call .getquoted() to obtain the quoted data into + this new function. + +2005-2-27 Federico Di Gregorio <fog@initd.org> + + * examples/myfirstrecipe.py: fixed adapter registration. + +2005-2-7 Federico Di Gregorio <fog@initd.org> + + * setup.py: added patch by Valentino Volonghi to build on MacOS X. + +2005-01-29 Federico Di Gregorio <fog@debian.org> + + * psycopg/pqpath.c (_pq_fetch_tuples): fixed scale-related + segfault (*fourth* mail from Andrea. Another couple like this and + psycopg 2 will exit alpha at warp speed.) + + * psycopg/pqpath.c (pq_fetch): _pq_copy_out_3 -> _pq_copy_out_v3 + (second and third mail from Andrea. :/) + + * psycopg/cursor_type.c (_psyco_curs_has_write_check): added check + on .write() attribute, fixed compilation problems (first mail from + Andrea Arcangeli.) + +2005-01-20 Federico Di Gregorio <fog@debian.org> + + * lib/extensions.py (register_adapter): added register_adapter + function, exported ISQLQuote in psycopg.extensions. + +2005-01-18 Federico Di Gregorio <fog@debian.org> + + * psycopg/pqpath.c (_pq_fetch_tuples): ported scale/precision fix + from psycopg 1.1. + + * LICENSE: detailed licensing information. Re-licensed some parts + under BSD-like to allow integration is pysqlite. + +2005-01-13 Federico Di Gregorio <fog@debian.org> + + * ZPsycopgDA/db.py (DB.query + ): ported ZPsycopgDA connection fix + from psycopg 1.1. + + * lib/*.py: added pydoc-friendly messages. + +2005-01-12 Federico Di Gregorio <fog@debian.org> + + * Added debian directory (thanks to W. Borgert who sent initial + patch based on cdbs.) + +2004-12-20 Federico Di Gregorio <fog@debian.org> + + * psycopg/pqpath.c (pq_execute): removed multiple calls to + pq_fetch in syncronous DBAPI compatibility mode to solve rowcount + problem. + +2004-12-14 Federico Di Gregorio <fog@debian.org> + + * Mm.. release 1.99.11. + + * psycopg/cursor_type.c (_psyco_curs_prefetch): fixed bug in + interaction between the .isready() method and + _psyco_curs_prefetch: isready now store away the pgres but leave + prefetch do its work. + + * psycopg/*.c: changed the names of most of the psycopg's built-in + types to replect their position in the psycopg._psycopg module. + +2004-12-10 Federico Di Gregorio <fog@debian.org> + + * psycopg/cursor_type.c: now *all* write or async accesses to the + connection object are arbitrated using the connection lock. + + * psycopg/cursor_type.c (psyco_curs_isready): now we reset the + current async cursor if it is ready, to allow other cursors to + .execute() without raising the "transaction in progress" error. + + * psycopg/pqpath.c (pq_is_busy): gained status of high-level + function with its own blocking and locking. + + * psycopg/cursor.h (EXC_IF_CURS_CLOSED): also checks the + connection (a closed connection implies a closed cursor.) + + * psycopg/cursor_type.c: cursor's connection is correctly + INCREFfed and DECREFfed. + + * psycopg/connection_type.c: removed the cursors list from the + connection object. It is not necessary anymore for the connection + to know about the cursors and the reference counting will keep the + connection alive (but possibly closed) until all cursors are + garbage collected. + +2004-11-20 Federico Di Gregorio <fog@initd.org> + + * psycopg/cursor_type.c (_mogrify): ported %% fix from 1.1.15. + +2004-11-20 Federico Di Gregorio <fog@initd.org> + + * psycopg/cursor_type.c (psyco_curs_execute): added check to raise an + exception if a cursor tries to .execute() while an async query is + already in execution froma different cursor. + +2004-11-20 Federico Di Gregorio <fog@debian.org> + + * psycopg/connection_type.c (psyco_conn_cursor): renamed 'cursor' + argument to 'cursor_factory'. + +2004-11-19 Federico Di Gregorio <fog@debian.org> + + * psycopg/cursor_type.c (_psyco_curs_buildrow_fill): now standard + tuples are filled using PyTuple_SET_ITEM while extended types + (created via row_factory) are filled using PySequence_SetItem. + + * psycopg/cursor_type.c: changed cursor attribute name from + tuple_factory to row_factory. + +2004-10-14 Federico Di Gregorio <fog@debian.org> + + * psycopg/cursor_type.c (_psyco_curs_buildrow_fill): now we use + PySequence_SetItem to avoid problems with containers created from + cursor's .tuple_factory attribute. + + * lib/extras.py (DictCursor.execute): fixed stupid bug with cursor + setting self.tuplefactory instead of self.tuple_factory. + +2004-10-02 Federico Di Gregorio <fog@debian.org> + + * Release 1.99.10. + + * psycopg/cursor_type.c (_psyco_curs_buildrow_*): unified normal + and factory code into the _psyco_curs_buildrow_fill function; no + more memory leaks here. + + * psycopg/config.h (round): added check for __FreeBSD__ (that + should be defined when compiling with gcc, I hope.) + + * setup.py: removed a lot of code now in setup.cfg. + +2004-09-24 Federico Di Gregorio <fog@debian.org> + + * psycopg/cursor_type.c (cursor_dealloc): fixed small memory leak + due to missing disposal of self->pgres. + +2004-9-14 Federico Di Gregorio <fog@initd.org> + + * examples/dialtone.py: Added adapt() example by Valentino + Volonghi. + +2004-09-14 Federico Di Gregorio <fog@debian.org> + + * psycopg/microprotocols.c (microprotocols_adapt): lots of changes + to the microprotocols layer (it is not micro anymore); + implementing almost all the PEP 246. The adapter registry is now + indexed by (type, protocol) and not by type alone. + +2004-09-13 Federico Di Gregorio <fog@debian.org> + + * psycopg/cursor_type.c (_mogrify): and qattr is gone. + +2004-09-05 Federico Di Gregorio <fog@debian.org> + + * Release 1.99.9 (or, the "twisting by the pool" release). + + * psycopg/pqpath.c (_pq_fetch_tuples): changed to "static void" + instead of "static int", no ways for this function to fail. + +2004-09-04 Federico Di Gregorio <fog@debian.org> + + * psycopg/pqpath.c (_pq_fetch_tuples): ported rowcount fix from + 1.1.15. + + * ZPsycopgDA/*: ZPsycopgDA back in action, using the new pooling + code. + +2004-08-29 Federico Di Gregorio <fog@debian.org> + + * psycopg/typecast_basic.c (typecast_DECIMAL_cast): added DECIMAL + typecaster; it even works :). + + * scripts/buildtypes.py (basic_types): added DECIMAL typecaster + for the NUMERIC oid. + + * examples/threads.py: updated threads example to use pooling code. + + * lib/pool.py: added very simple and thread-safe connection + pooling class. + + * psycopg/cursor_type.c (psyco_curs_fetchmany): fixed problem with + .fetchall() and .fetchmany() returning None instead of [] on empty + result sets. + + * Release 1.99.8. + +2004-08-28 Federico Di Gregorio <fog@debian.org> + + * psycopg/cursor_type.c (psyco_curs_execute): added processing of + unicode queries. + + * examples/encoding.py: much better encoding example, also using + the new UNICODE typecaster. + + * psycopg/typecast_basic.c (typecast_UNICODE_cast): added UNICODE + typecaster. + + * lib/extensions.py: the encodings dictionary is not available by + default but can be accessed from the psycopg.extensions module. + + * psycopg/adapter_qstring.h: remove encoding information from + qstring adapter and moved it into psycopg module. + +2004-08-26 Federico Di Gregorio <fog@debian.org> + + * psycopg/cursor_type.c (_psyco_curs_prefetch): added check for + asynchronous fetch by wrong cursor. + + * psycopg/pqpath.c (pq_fetch): fixed backend status message (bug + reported by Daniele Varrazzo.) + +2004-07-29 Federico Di Gregorio <fog@debian.org> + + * psycopg/typecast_basic.c (typecast_BINARY_cast): reverted to + using strings instead of buffers when converting postgresql binary + objects (should *temporarily* fix corruption bug reported on + win32.) + +2004-07-21 Federico Di Gregorio <fog@debian.org> + + * psycopg/cursor_type.c: removed __iter__ and next methods from + object methods and moved them where they do belong (tp_iter and + tp_iternext.) Bug reported by Daniele Varrazzo (again!) + +2004-07-19 Federico Di Gregorio <fog@debian.org> + + * psycopg/typecast_datetime.c (typecast_PYINTERVAL_cast): replaced + round() with micro() when rounding seconds (fixes bugs reported by + Daniele Varrazzo.) + +2004-07-16 Federico Di Gregorio <fog@debian.org> + + * psycopg/pqpath.c (pq_set_critical): allow for a custom message + insted of the one from PQerrorMessage. + (pq_resolve_critical): added argument to specify if connection is + to be closed (used to not close it during COPY FROM/TO criticals.) + + * psycopg/cursor_type.c (psyco_curs_fileno, psyco_curs_isready): + added extension methods related to async queries. + +2004-07-15 Federico Di Gregorio <fog@debian.org> + + * Release 1.99.7. + + * examples/tz.py: added example about time zones. + + * psycopg/typecast_datetime.c (typecast_PYDATETIME_cast): create + FixedOffsetTimezone for postgresql "timestamp with time zone" + types. + + * lib/tz.py: added (even more than) needed tzinfo classes. + + * psycopg/typecast.c (typecast_call): changed typecast call code + to take the additional cursor parameter, needed for + cursor-dependent type casting (tzinfo & friends.) + + * psycopg/cursor_type.c (_psyco_curs_buildrow_with_factory): added + use of tuple factories to fetcXXX methods. + + * lib/extras.py: little extra goodies for psycopg. + +2004-07-14 Federico Di Gregorio <fog@debian.org> + + * Release 1.99.6. + + * psycopg/connection_type.c: added .dsn attribute to connection + objects. + + * psycopg/cursor_type.c (psyco_curs_mogrify): added .mogrify() + method. + + * psycopg/adapter_qstring.c: copy the connection encoding only if + wrapped object is unicode and added table of encodings. + +2004-07-13 Federico Di Gregorio <fog@debian.org> + + * psycopg/cursor_type.c (_mogrify): moved Dprintf statement to + avoid dereferencing empty pointer (from 1.1.x) + (psyco_curs_execute): now we save the query in self->query instead + of freeing the memory ASAP. + (cursorObject_members): and we finally export the saved query + through the cursor members interface. that's all folks. + + * lib/extensions.py: added extensions module to clearly separate + psycopg own extensions from DBAPI-2.0 + +2004-07-10 Federico Di Gregorio <fog@debian.org> + + * psycopg/typecast_datetime.c: ported interval fix from 1.1.x. + +2004-05-16 Federico Di Gregorio <fog@debian.org> + + * psycopg/typecast_datetime.c (typecast_*_cast): fixed Value error + when seconds > 59 by setting minutes += 1 and seconds -= 60 + (reported by Marcel Gsteiger.) + +2004-04-24 Federico Di Gregorio <fog@debian.org> + + * ported time interval patch by Ross Cohen from 1.1.12. + +2004-04-19 Federico Di Gregorio <fog@debian.org> + + * psycopg/typecast_datetime.c (typecast_PYDATE_cast): applied + patch from Jason Erickson: min and max taken from datetime.Date + type. + +2004-04-18 Federico Di Gregorio <fog@debian.org> + + * Applied changes from Jason Erickson to build on win32; see his + (slightly edited) entry below. (Still builds on Linux :) + + * psycopg/*.c: removed inclusion of pthread.h from all files + except psycopg/config.h to build on win32 without faking the file. + +2004-04-15 Jason Erickson <jerickso@stickpeople.com> + + * setup.py: Various changes. The critical ones: + - Make an empty pthread.h file so all the code doing an + #include <pthread.h> will find something. + - Appended the winsock2 library and the PostgreSQL library to + the library path. + - Setup the include path. + - Have the PSYCOPG_VERSION macro be included with quotes. + + * config.h: Added/Cleaned up Win32 includes, defines, stub functions. + + * typecast.h: Removed ';' after PyObject_HEAD in the + typecastObject structure since Microsoft Visual Studio does not + like it. + +2004-04-15 Federico Di Gregorio <fog@debian.org> + + * Release 1.99.5 (bug-fixing and reorganization) + + * setup.py et al.: moved psycopg to psycopg._psycopg to make + easier to provide high level python-only utilities (like the + promised pooling code). psycopg/__init__.py imports _psycopg and + make all the default DBAPI-2.0 stuff available. + +2004-04-14 Federico Di Gregorio <fog@debian.org> + + * psycopg/psycopgmodule.c (initpsycopg): wrapped initialization of + date/time adapters in #ifdefs to have psycopg compile without mx + or builtin datetime. + +2004-04-10 Federico Di Gregorio <fog@debian.org> + + * Release 1.99.4. + +2004-04-09 Federico Di Gregorio <fog@debian.org> + + * psycopg/typecast_builtins.c: changed DATE to not include + DATETIME types anymore. + + * psycopg/adapter_datetime.c (pydatetime_str): switched from + strftime to isoformat to preserve fractional seconds. + +2004-04-08 Federico Di Gregorio <fog@debian.org> + + * psycopg/psycopgmodule.c (psyco_connect): ported sslmode + parameter from 1.1 branch. + + * psycopg/adapter_datetime.*: added python built-in datetime + adapters. also added the datetime typecasters (still using mx as + default). + + * psycopg/typecast.h: removed aliases, they now live in the right + typecast_xxx.c file. + +2004-03-08 Federico Di Gregorio <fog@debian.org> + + * Release 1.99.3 (alpha 4). + + * examples/lastrowid.py: and the .lastrowid example is in. + + * psycopg/cursor_type.c (_mogrify): added call to .prepare() + method in both dict and sequence path. + + * psycopg/connection_int.c (conn_set_client_encoding): added + encoding-change code. + + * psycopg/adapter_qstring.c (qstring_quote): added hard-coded + support for utf8 and latin1 encodings. + +2004-03-01 Federico Di Gregorio <fog@debian.org> + + * psycopg/connection_int.c (conn_close): does not use libpq + functions on NULL pgconn (this can happen when conn_close is + called after a failed PQconnect.) + +2004-02-29 Federico Di Gregorio <fog@debian.org> + + * Release 1.99.2 (alpha 3). + + * psycopg/cursor_type.c: added .rownumber and .connection + attributes. Also added .scroll(), .next() and .__iter__() methods + (see DBAPI2-.0 extensions on PEP.) + + * psycopg/connection_type.c (psyco_conn_set_isolation_level): + added connection method .set_isolation_level(). Also added all + error objects to the connection (see DBAPI2-.0 extensions on PEP.) + + * psycopg/connection_int.c (conn_switch_isolation_level): added + isolation level switching code. + + * setup.py: removed all references to PSYCOPG_NEWSTYLE: support + for python < 2.2 has been dropped. + + * typecast_basic.c (typecast_BINARY_cast): now binary objects are + returned as true buffers. + + * adapter_binary.*: added adapter for buffers and binary (bytea) + objects. + + * Release 1.99.1 (alpha 2). + + * adapter_mxdatetime.*: added adapters for all mx.DateTime types. + +2004-02-28 Federico Di Gregorio <fog@debian.org> + + * cursor_type.c (_mogrify): complete rework of the mogrification + code to use the microprotocols_adapt function. + + * typecast_basic.c (typecast_BOOLEAN_cast): we now return real + Py_True and Py_False values. + + * microprotocols.h: added very simple microprotocols + implementation to allow for python->postgresql types registry. + +2004-01-05 Federico Di Gregorio <fog@debian.org> + + * connection_int.c (conn_commit/conn_rollback): added code to + commit/rollback and connection methods. + +2004-01-04 Federico Di Gregorio <fog@debian.org> + + * cursor_type.c (psyco_curs_fetchone): added fetchone method. + +2004-01-03 Federico Di Gregorio <fog@debian.org> + + * added (empty) INSTALL file. + + * cursor_type.c (cursor_dealloc): added qattr for custom object + quoting using a callable attribute. + (_mogrify): ported new, fixed mogrification code from 1.1.12. + +2003-08-01 Federico Di Gregorio <fog@debian.org> + + * cursor_type.c (_mogrify_sequence): added sequence mogrification, + can be done better, on the dict model. + +2003-07-28 Federico Di Gregorio <fog@debian.org> + + * typeobj_qstring.c: added quoted strings (can use both own code, + like psycopg 1.x or PQescapeString from lipq.) + +2003-07-21 Federico Di Gregorio <fog@debian.org> + + * connection_type.c (psyco_conn_close): added .close() + method. wow. + + * cursor_*.c: added basic cursor interface (new-style.) + +2003-07-20 Federico Di Gregorio <fog@debian.org> + + * psycopg/*: beginning of new source layout. if you think this + changelog is somewhat empty, you're right. look at + doc/ChangeLog-1.x for psycopg 1.x changelog just before the + branch. + + diff --git a/psycopg2/INSTALL b/psycopg2/INSTALL new file mode 100644 index 00000000..873dbfa9 --- /dev/null +++ b/psycopg2/INSTALL @@ -0,0 +1,48 @@ +Compiling and installing psycopg +******************************** + +** Important note: if you plan to use psyopg2 in a multithreaed application + make sure that your libpq has been compiled with the --with-thread-safety + option. psycopg2 will work correctly even with a non-thread-safe libpq but + libpq will leak memory. + +While psycopg 1.x used autoconf for its build process psycopg 2 switched to +the more pythoning setup.py. Currently both psycopg's author and distutils +have some limitations so the file setup.cfg is almost unused and most build +options are hidden in setup.py. Before building psycopg look at setup.cfg file +and change any settings to follow your system (or taste); then: + + python setup.py build + +to build in the local directory; and: + + python setup.py install + +to install system-wide. + + +Using setuptools and EasyInstall +================================ + +If setuptools are installed on your system you can easily create an egg for +psycopg and install it. Download the source distribution (if you're reading +this file you probably already have) and then edit setup.cfg to your taste +and build from the source distribution top-level directory using: + + easy_install . + + +Compiling under Windows with mingw32 +==================================== + +You can compile psycopg under Windows platform with mingw32 +(http://www.mingw.org/) compiler. MinGW is also shipped with IDEs such as +Dev-C++ (http://www.bloodshed.net/devcpp.html) and Code::Blocks +(http://www.codeblocks.org). gcc binaries should be in your PATH. + +You need a PostgreSQL with include and libary files installed. At least v8.0 is required. + +First you need to create a libpython2X.a as described in +http://starship.python.net/crew/kernr/mingw32/Notes.html. Then run: + + python setup.py build_ext --compiler=mingw32 install diff --git a/psycopg2/LICENSE b/psycopg2/LICENSE new file mode 100644 index 00000000..b20b2825 --- /dev/null +++ b/psycopg2/LICENSE @@ -0,0 +1,60 @@ +psycopg and the GPL +=================== + +psycopg is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. See file COPYING for details. + +As a special exception, specific permission is granted for the GPLed +code in this distribition to be linked to OpenSSL and PostgreSQL libpq +without invoking GPL clause 2(b). + +Note that the GPL was chosen to avoid proprietary adapters based on +psycopg code. Using psycopg in a proprietary product (even bundling +psycopg with the proprietary product) is fine as long as: + + 1. psycopg is called from Python only using only the provided API + (i.e., no linking with C code and no C modules based on it); and + + 2. all the other points of the GPL are respected (you offer a copy + of psycopg's source code, and so on.) + +Alternative licenses +==================== + +If you prefer you can use the Zope Database Adapter ZPsycopgDA (i.e., +every file inside the ZPsycopgDA directory) user the ZPL license as +published on the Zope web site, http://www.zope.org/Resources/ZPL. + +Also, the following BSD-like license applies (at your option) to the +files following the pattern psycopg/adapter*.{h,c} and +psycopg/microprotocol*.{h,c}: + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this + software in a product, an acknowledgment in the product documentation + would be appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not + be misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source distribution. + +psycopg is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +Proprietary licenses +==================== + +A non-exclusive license is available for companies that want to include +psycopg in their proprietary products without respecting the spirit of the +GPL. The price of the license is one day of development done by the author, +at the consulting fee he applies to his usual customers at the day of the +request. diff --git a/psycopg2/MANIFEST b/psycopg2/MANIFEST new file mode 100644 index 00000000..c8538ea0 --- /dev/null +++ b/psycopg2/MANIFEST @@ -0,0 +1,222 @@ +AUTHORS +ChangeLog +INSTALL +LICENSE +MANIFEST +MANIFEST.in +README +setup.cfg +setup.py +ZPsycopgDA/DA.py +ZPsycopgDA/__init__.py +ZPsycopgDA/db.py +ZPsycopgDA/pool.py +ZPsycopgDA/dtml/add.dtml +ZPsycopgDA/dtml/browse.dtml +ZPsycopgDA/dtml/edit.dtml +ZPsycopgDA/dtml/table_info.dtml +ZPsycopgDA/icons/bin.gif +ZPsycopgDA/icons/date.gif +ZPsycopgDA/icons/datetime.gif +ZPsycopgDA/icons/field.gif +ZPsycopgDA/icons/float.gif +ZPsycopgDA/icons/int.gif +ZPsycopgDA/icons/stable.gif +ZPsycopgDA/icons/table.gif +ZPsycopgDA/icons/text.gif +ZPsycopgDA/icons/time.gif +ZPsycopgDA/icons/view.gif +ZPsycopgDA/icons/what.gif +debian/changelog +debian/control +debian/copyright +debian/rules +doc/ChangeLog-1.x +doc/HACKING +doc/SUCCESS +doc/TODO +doc/api-screen.css +doc/async.txt +doc/extensions.html +doc/extensions.rst +doc/api/epydoc.css +doc/api/index.html +doc/api/private/__builtin__.list-class.html +doc/api/private/__builtin__.object-class.html +doc/api/private/__builtin__.type-class.html +doc/api/private/datetime.tzinfo-class.html +doc/api/private/epydoc.css +doc/api/private/exceptions.Exception-class.html +doc/api/private/exceptions.StandardError-class.html +doc/api/private/frames.html +doc/api/private/help.html +doc/api/private/index.html +doc/api/private/indices.html +doc/api/private/psycopg2-module.html +doc/api/private/psycopg2.DataError-class.html +doc/api/private/psycopg2.DatabaseError-class.html +doc/api/private/psycopg2.Error-class.html +doc/api/private/psycopg2.IntegrityError-class.html +doc/api/private/psycopg2.InterfaceError-class.html +doc/api/private/psycopg2.InternalError-class.html +doc/api/private/psycopg2.NotSupportedError-class.html +doc/api/private/psycopg2.OperationalError-class.html +doc/api/private/psycopg2.ProgrammingError-class.html +doc/api/private/psycopg2.Warning-class.html +doc/api/private/psycopg2._psycopg-module.html +doc/api/private/psycopg2._psycopg.ISQLQuote-class.html +doc/api/private/psycopg2._psycopg.connection-class.html +doc/api/private/psycopg2._psycopg.cursor-class.html +doc/api/private/psycopg2.extensions-module.html +doc/api/private/psycopg2.extras-module.html +doc/api/private/psycopg2.extras.DictConnection-class.html +doc/api/private/psycopg2.extras.DictCursor-class.html +doc/api/private/psycopg2.extras.DictRow-class.html +doc/api/private/psycopg2.extras.SQL_IN-class.html +doc/api/private/psycopg2.pool-module.html +doc/api/private/psycopg2.pool.AbstractConnectionPool-class.html +doc/api/private/psycopg2.pool.PersistentConnectionPool-class.html +doc/api/private/psycopg2.pool.PoolError-class.html +doc/api/private/psycopg2.pool.SimpleConnectionPool-class.html +doc/api/private/psycopg2.pool.ThreadedConnectionPool-class.html +doc/api/private/psycopg2.psycopg1-module.html +doc/api/private/psycopg2.psycopg1.connection-class.html +doc/api/private/psycopg2.psycopg1.cursor-class.html +doc/api/private/psycopg2.tz-module.html +doc/api/private/psycopg2.tz.FixedOffsetTimezone-class.html +doc/api/private/psycopg2.tz.LocalTimezone-class.html +doc/api/private/toc-everything.html +doc/api/private/toc-psycopg2-module.html +doc/api/private/toc-psycopg2._psycopg-module.html +doc/api/private/toc-psycopg2.extensions-module.html +doc/api/private/toc-psycopg2.extras-module.html +doc/api/private/toc-psycopg2.pool-module.html +doc/api/private/toc-psycopg2.psycopg1-module.html +doc/api/private/toc-psycopg2.tz-module.html +doc/api/private/toc.html +doc/api/private/trees.html +doc/api/public/__builtin__.list-class.html +doc/api/public/__builtin__.object-class.html +doc/api/public/__builtin__.type-class.html +doc/api/public/datetime.tzinfo-class.html +doc/api/public/epydoc.css +doc/api/public/exceptions.Exception-class.html +doc/api/public/exceptions.StandardError-class.html +doc/api/public/frames.html +doc/api/public/help.html +doc/api/public/index.html +doc/api/public/indices.html +doc/api/public/psycopg2-module.html +doc/api/public/psycopg2.DataError-class.html +doc/api/public/psycopg2.DatabaseError-class.html +doc/api/public/psycopg2.Error-class.html +doc/api/public/psycopg2.IntegrityError-class.html +doc/api/public/psycopg2.InterfaceError-class.html +doc/api/public/psycopg2.InternalError-class.html +doc/api/public/psycopg2.NotSupportedError-class.html +doc/api/public/psycopg2.OperationalError-class.html +doc/api/public/psycopg2.ProgrammingError-class.html +doc/api/public/psycopg2.Warning-class.html +doc/api/public/psycopg2._psycopg-module.html +doc/api/public/psycopg2.extensions-module.html +doc/api/public/psycopg2.extras-module.html +doc/api/public/psycopg2.extras.DictConnection-class.html +doc/api/public/psycopg2.extras.DictCursor-class.html +doc/api/public/psycopg2.extras.DictRow-class.html +doc/api/public/psycopg2.extras.SQL_IN-class.html +doc/api/public/psycopg2.pool-module.html +doc/api/public/psycopg2.pool.AbstractConnectionPool-class.html +doc/api/public/psycopg2.pool.PersistentConnectionPool-class.html +doc/api/public/psycopg2.pool.PoolError-class.html +doc/api/public/psycopg2.pool.SimpleConnectionPool-class.html +doc/api/public/psycopg2.pool.ThreadedConnectionPool-class.html +doc/api/public/psycopg2.psycopg1-module.html +doc/api/public/psycopg2.psycopg1.connection-class.html +doc/api/public/psycopg2.psycopg1.cursor-class.html +doc/api/public/psycopg2.tz-module.html +doc/api/public/psycopg2.tz.FixedOffsetTimezone-class.html +doc/api/public/psycopg2.tz.LocalTimezone-class.html +doc/api/public/toc-everything.html +doc/api/public/toc-psycopg2-module.html +doc/api/public/toc-psycopg2._psycopg-module.html +doc/api/public/toc-psycopg2.extensions-module.html +doc/api/public/toc-psycopg2.extras-module.html +doc/api/public/toc-psycopg2.pool-module.html +doc/api/public/toc-psycopg2.psycopg1-module.html +doc/api/public/toc-psycopg2.tz-module.html +doc/api/public/toc.html +doc/api/public/trees.html +examples/binary.py +examples/copy_from.py +examples/copy_to.py +examples/cursor.py +examples/dialtone.py +examples/dict.py +examples/dt.py +examples/encoding.py +examples/fetch.py +examples/lastrowid.py +examples/mogrify.py +examples/myfirstrecipe.py +examples/notify.py +examples/simple.py +examples/somehackers.jpg +examples/threads.py +examples/tz.py +examples/usercast.py +examples/whereareyou.jpg +lib/__init__.py +lib/extensions.py +lib/extras.py +lib/pool.py +lib/psycopg1.py +lib/tz.py +psycopg/adapter_asis.c +psycopg/adapter_asis.h +psycopg/adapter_binary.c +psycopg/adapter_binary.h +psycopg/adapter_datetime.c +psycopg/adapter_datetime.h +psycopg/adapter_list.c +psycopg/adapter_list.h +psycopg/adapter_mxdatetime.c +psycopg/adapter_mxdatetime.h +psycopg/adapter_pboolean.c +psycopg/adapter_pboolean.h +psycopg/adapter_qstring.c +psycopg/adapter_qstring.h +psycopg/config.h +psycopg/connection.h +psycopg/connection_int.c +psycopg/connection_type.c +psycopg/cursor.h +psycopg/cursor_int.c +psycopg/cursor_type.c +psycopg/microprotocols.c +psycopg/microprotocols.h +psycopg/microprotocols_proto.c +psycopg/microprotocols_proto.h +psycopg/pgtypes.h +psycopg/pgversion.h +psycopg/pqpath.c +psycopg/pqpath.h +psycopg/psycopg.h +psycopg/psycopgmodule.c +psycopg/python.h +psycopg/typecast.c +psycopg/typecast.h +psycopg/typecast_array.c +psycopg/typecast_basic.c +psycopg/typecast_binary.c +psycopg/typecast_binary.h +psycopg/typecast_builtins.c +psycopg/typecast_datetime.c +psycopg/typecast_mxdatetime.c +scripts/buildtypes.py +scripts/ext2html.py +scripts/makedocs.py +scripts/maketypes.sh +tests/dbapi20.py +tests/extras_dictcursor.py +tests/test_psycopg2_dbapi20.py +tests/types_basic.py diff --git a/psycopg2/MANIFEST.in b/psycopg2/MANIFEST.in new file mode 100644 index 00000000..457004c5 --- /dev/null +++ b/psycopg2/MANIFEST.in @@ -0,0 +1,12 @@ +recursive-include psycopg *.c *.h +recursive-include lib *.py +recursive-include tests *.py +recursive-include ZPsycopgDA *.py *.gif *.dtml +recursive-include examples *.py somehackers.jpg whereareyou.jpg +recursive-include debian * +recursive-include doc TODO HACKING SUCCESS ChangeLog-1.x async.txt +recursive-include scripts *.py *.sh +include scripts/maketypes.sh scripts/buildtypes.py +include AUTHORS README INSTALL LICENSE ChangeLog +include PKG-INFO MANIFEST.in MANIFEST setup.py setup.cfg +recursive-include doc *.rst *.css *.html diff --git a/psycopg2/PKG-INFO b/psycopg2/PKG-INFO new file mode 100644 index 00000000..2fab953b --- /dev/null +++ b/psycopg2/PKG-INFO @@ -0,0 +1,35 @@ +Metadata-Version: 1.0 +Name: psycopg2 +Version: 2.0.5.1 +Summary: Python-PostgreSQL Database Adapter +Home-page: http://initd.org/tracker/psycopg +Author: Federico Di Gregorio +Author-email: fog@initd.org +License: GPL with exceptions or ZPL +Download-URL: http://initd.org/pub/software/psycopg2 +Description: psycopg is a PostgreSQL database adapter for the Python programming + language. This is version 2, a complete rewrite of the original code to + provide new-style classes for connection and cursor objects and other sweet + candies. Like the original, psycopg 2 was written with the aim of being + very small and fast, and stable as a rock. + + psycopg is different from the other database adapter because it was + designed for heavily multi-threaded applications that create and destroy + lots of cursors and make a conspicuous number of concurrent INSERTs or + UPDATEs. psycopg 2 also provide full asycronous operations for the really + brave programmer. + +Platform: any +Classifier: Development Status :: 4 - Beta +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: GNU General Public License (GPL) +Classifier: License :: OSI Approved :: Zope Public License +Classifier: Programming Language :: Python +Classifier: Programming Language :: C +Classifier: Programming Language :: SQL +Classifier: Topic :: Database +Classifier: Topic :: Database :: Front-Ends +Classifier: Topic :: Software Development +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Classifier: Operating System :: Microsoft :: Windows +Classifier: Operating System :: Unix diff --git a/psycopg2/README b/psycopg2/README new file mode 100644 index 00000000..4e4a0e96 --- /dev/null +++ b/psycopg2/README @@ -0,0 +1,39 @@ +psycopg - Python-PostgreSQL Database Adapter +******************************************** + +psycopg is a PostgreSQL database adapter for the Python programming +language. This is version 2, a complete rewrite of the original code to +provide new-style classes for connection and cursor objects and other +sweet candies. Like the original, psycopg 2 was written with the aim of +being very small and fast, and stable as a rock. + +psycopg is different from the other database adapter because it was +designed for heavily multi-threaded applications that create and destroy +lots of cursors and make a conspicuous number of concurrent INSERTs or +UPDATEs. psycopg 2 also provide full asycronous operations for the really +brave programmer. + +There are confirmed reports of psycopg 1.x compiling and running on Linux +and FreeBSD on i386, Solaris, MacOS X and win32 architectures. psycopg 2 +does not introduce build-wise incompatible changes so it should be able to +compile on all architectures just as its predecessor did. + +Now go read the INSTALL file. More information about psycopg extensions to +the DBAPI-2.0 is available in the files located in the doc/ direcory. + +psycopg is free software ("free as in freedom" but I like beer too.) +Licensing information is available in the LICENSE file. + + +Contributors +------------ + +A short list of contributors to psycopg2 follows (if you feel you belong +to this list and you can't find yourself here just drop me a mail): + + * Kudos to piro for all the documentation work. + + * Peter Fein contributed a logging connection/cursor class that even if it + was not used directly heavily influenced the implementation currently in + psycopg2.extras. + diff --git a/psycopg2/ZPsycopgDA/DA.py b/psycopg2/ZPsycopgDA/DA.py new file mode 100644 index 00000000..2a0f4dd1 --- /dev/null +++ b/psycopg2/ZPsycopgDA/DA.py @@ -0,0 +1,375 @@ +# ZPsycopgDA/DA.py - ZPsycopgDA Zope product: Database Connection +# +# Copyright (C) 2004 Federico Di Gregorio <fog@initd.org> +# +# 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 the +# Free Software Foundation; either version 2, or (at your option) any later +# version. +# +# Or, at your option this program (ZPsycopgDA) can be distributed under the +# Zope Public License (ZPL) Version 1.0, as published on the Zope web site, +# http://www.zope.org/Resources/ZPL. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY +# or FITNESS FOR A PARTICULAR PURPOSE. +# +# See the LICENSE file for details. + + +ALLOWED_PSYCOPG_VERSIONS = ('2.0.1', '2.0.2', '2.0.3', '2.0.4', '2.0.5') + +import sys +import time +import db +import re + +import Acquisition +import Shared.DC.ZRDB.Connection + +from db import DB +from Globals import HTMLFile +from ExtensionClass import Base +from App.Dialogs import MessageDialog +from DateTime import DateTime + +# Build Zope version in a float for later cheks +import App +zope_version = App.version_txt.getZopeVersion() +zope_version = float("%s.%s" %(zope_version[:2])) + +# ImageFile is deprecated in Zope >= 2.9 +if zope_version < 2.9: + from ImageFile import ImageFile +else: + from App.ImageFile import ImageFile + +# import psycopg and functions/singletons needed for date/time conversions + +import psycopg2 +from psycopg2 import NUMBER, STRING, ROWID, DATETIME +from psycopg2.extensions import INTEGER, LONGINTEGER, FLOAT, BOOLEAN, DATE +from psycopg2.extensions import TIME, INTERVAL +from psycopg2.extensions import new_type, register_type + + +# add a new connection to a folder + +manage_addZPsycopgConnectionForm = HTMLFile('dtml/add',globals()) + +def manage_addZPsycopgConnection(self, id, title, connection_string, + zdatetime=None, tilevel=2, + check=None, REQUEST=None): + """Add a DB connection to a folder.""" + self._setObject(id, Connection(id, title, connection_string, + zdatetime, check, tilevel)) + if REQUEST is not None: return self.manage_main(self, REQUEST) + + +# the connection object + +class Connection(Shared.DC.ZRDB.Connection.Connection): + """ZPsycopg Connection.""" + _isAnSQLConnection = 1 + + id = 'Psycopg2_database_connection' + database_type = 'Psycopg2' + meta_type = title = 'Z Psycopg 2 Database Connection' + icon = 'misc_/conn' + + def __init__(self, id, title, connection_string, + zdatetime, check=None, tilevel=2, encoding=''): + self.zdatetime = zdatetime + self.id = str(id) + self.edit(title, connection_string, zdatetime, + check=check, tilevel=tilevel, encoding=encoding) + + def factory(self): + return DB + + ## connection parameters editing ## + + def edit(self, title, connection_string, + zdatetime, check=None, tilevel=2, encoding=''): + self.title = title + self.connection_string = connection_string + self.zdatetime = zdatetime + self.tilevel = tilevel + self.encoding = encoding + + self.set_type_casts() + + if check: self.connect(self.connection_string) + + manage_properties = HTMLFile('dtml/edit', globals()) + + def manage_edit(self, title, connection_string, + zdatetime=None, check=None, tilevel=2, encoding='UTF-8', + REQUEST=None): + """Edit the DB connection.""" + self.edit(title, connection_string, zdatetime, + check=check, tilevel=tilevel, encoding=encoding) + if REQUEST is not None: + msg = "Connection edited." + return self.manage_main(self,REQUEST,manage_tabs_message=msg) + + def connect(self, s): + try: + self._v_database_connection.close() + except: + pass + + # check psycopg version and raise exception if does not match + if psycopg2.__version__[:5] not in ALLOWED_PSYCOPG_VERSIONS: + raise ImportError("psycopg version mismatch (imported %s)" % + psycopg2.__version__) + + self.set_type_casts() + self._v_connected = '' + dbf = self.factory() + + # TODO: let the psycopg exception propagate, or not? + self._v_database_connection = dbf( + self.connection_string, self.tilevel, self.encoding) + self._v_database_connection.open() + self._v_connected = DateTime() + + return self + + def set_type_casts(self): + # note that in both cases order *is* important + if self.zdatetime: + # use zope internal datetime routines + register_type(ZDATETIME) + register_type(ZDATE) + register_type(ZTIME) + else: + # use the standard + register_type(DATETIME) + register_type(DATE) + register_type(TIME) + + ## browsing and table/column management ## + + manage_options = Shared.DC.ZRDB.Connection.Connection.manage_options + # + ( + # {'label': 'Browse', 'action':'manage_browse'},) + + #manage_tables = HTMLFile('dtml/tables', globals()) + #manage_browse = HTMLFile('dtml/browse', globals()) + + info = None + + def table_info(self): + return self._v_database_connection.table_info() + + + def __getitem__(self, name): + if name == 'tableNamed': + if not hasattr(self, '_v_tables'): self.tpValues() + return self._v_tables.__of__(self) + raise KeyError, name + + def tpValues(self): + res = [] + conn = self._v_database_connection + for d in conn.tables(rdb=0): + try: + name = d['TABLE_NAME'] + b = TableBrowser() + b.__name__ = name + b._d = d + b._c = c + try: + b.icon = table_icons[d['TABLE_TYPE']] + except: + pass + r.append(b) + except: + pass + return res + + +## database connection registration data ## + +classes = (Connection,) + +meta_types = ({'name':'Z Psycopg 2 Database Connection', + 'action':'manage_addZPsycopgConnectionForm'},) + +folder_methods = { + 'manage_addZPsycopgConnection': manage_addZPsycopgConnection, + 'manage_addZPsycopgConnectionForm': manage_addZPsycopgConnectionForm} + +__ac_permissions__ = ( + ('Add Z Psycopg Database Connections', + ('manage_addZPsycopgConnectionForm', 'manage_addZPsycopgConnection')),) + +# add icons + +misc_={'conn': ImageFile('Shared/DC/ZRDB/www/DBAdapterFolder_icon.gif')} + +for icon in ('table', 'view', 'stable', 'what', 'field', 'text', 'bin', + 'int', 'float', 'date', 'time', 'datetime'): + misc_[icon] = ImageFile('icons/%s.gif' % icon, globals()) + + +## zope-specific psycopg typecasters ## + +# convert an ISO timestamp string from postgres to a Zope DateTime object +def _cast_DateTime(iso, curs): + if iso: + return DateTime(re.split("GMT\+?|GMT-?", iso)[0]) + + # this will split us into [date, time, GMT/AM/PM(if there)] + # dt = str.split(' ') + # if len(dt) > 1: + # # we now should split out any timezone info + # dt[1] = dt[1].split('-')[0] + # dt[1] = dt[1].split('+')[0] + # return DateTime(' '.join(dt[:2])) + # else: + # return DateTime(dt[0]) + +# convert an ISO date string from postgres to a Zope DateTime object +def _cast_Date(iso, curs): + if iso: + return DateTime(iso) + +# Convert a time string from postgres to a Zope DateTime object. +# NOTE: we set the day as today before feeding to DateTime so +# that it has the same DST settings. +def _cast_Time(iso, curs): + if iso: + return DateTime(time.strftime('%Y-%m-%d %H:%M:%S', + time.localtime(time.time())[:3]+ + time.strptime(iso[:8], "%H:%M:%S")[3:])) + +# NOTE: we don't cast intervals anymore because they are passed +# untouched to Zope. +def _cast_Interval(iso, curs): + return iso + +ZDATETIME = new_type((1184, 1114), "ZDATETIME", _cast_DateTime) +ZINTERVAL = new_type((1186,), "ZINTERVAL", _cast_Interval) +ZDATE = new_type((1082,), "ZDATE", _cast_Date) +ZTIME = new_type((1083,), "ZTIME", _cast_Time) + + +## table browsing helpers ## + +class TableBrowserCollection(Acquisition.Implicit): + pass + +class Browser(Base): + def __getattr__(self, name): + try: + return self._d[name] + except KeyError: + raise AttributeError, name + +class values: + def len(self): + return 1 + + def __getitem__(self, i): + try: + return self._d[i] + except AttributeError: + pass + self._d = self._f() + return self._d[i] + +class TableBrowser(Browser, Acquisition.Implicit): + icon = 'what' + Description = check = '' + info = HTMLFile('table_info', globals()) + menu = HTMLFile('table_menu', globals()) + + def tpValues(self): + v = values() + v._f = self.tpValues_ + return v + + def tpValues_(self): + r=[] + tname=self.__name__ + for d in self._c.columns(tname): + b=ColumnBrowser() + b._d=d + try: b.icon=field_icons[d['Type']] + except: pass + b.TABLE_NAME=tname + r.append(b) + return r + + def tpId(self): return self._d['TABLE_NAME'] + def tpURL(self): return "Table/%s" % self._d['TABLE_NAME'] + def Name(self): return self._d['TABLE_NAME'] + def Type(self): return self._d['TABLE_TYPE'] + + manage_designInput=HTMLFile('designInput',globals()) + def manage_buildInput(self, id, source, default, REQUEST=None): + "Create a database method for an input form" + args=[] + values=[] + names=[] + columns=self._columns + for i in range(len(source)): + s=source[i] + if s=='Null': continue + c=columns[i] + d=default[i] + t=c['Type'] + n=c['Name'] + names.append(n) + if s=='Argument': + values.append("<dtml-sqlvar %s type=%s>'" % + (n, vartype(t))) + a='%s%s' % (n, boboType(t)) + if d: a="%s=%s" % (a,d) + args.append(a) + elif s=='Property': + values.append("<dtml-sqlvar %s type=%s>'" % + (n, vartype(t))) + else: + if isStringType(t): + if find(d,"\'") >= 0: d=join(split(d,"\'"),"''") + values.append("'%s'" % d) + elif d: + values.append(str(d)) + else: + raise ValueError, ( + 'no default was given for <em>%s</em>' % n) + +class ColumnBrowser(Browser): + icon='field' + + def check(self): + return ('\t<input type=checkbox name="%s.%s">' % + (self.TABLE_NAME, self._d['Name'])) + def tpId(self): return self._d['Name'] + def tpURL(self): return "Column/%s" % self._d['Name'] + def Description(self): + d=self._d + if d['Scale']: + return " %(Type)s(%(Precision)s,%(Scale)s) %(Nullable)s" % d + else: + return " %(Type)s(%(Precision)s) %(Nullable)s" % d + +table_icons={ + 'TABLE': 'table', + 'VIEW':'view', + 'SYSTEM_TABLE': 'stable', + } + +field_icons={ + NUMBER.name: 'i', + STRING.name: 'text', + DATETIME.name: 'date', + INTEGER.name: 'int', + FLOAT.name: 'float', + BOOLEAN.name: 'bin', + ROWID.name: 'int' + } diff --git a/psycopg2/ZPsycopgDA/__init__.py b/psycopg2/ZPsycopgDA/__init__.py new file mode 100644 index 00000000..0af0ceb8 --- /dev/null +++ b/psycopg2/ZPsycopgDA/__init__.py @@ -0,0 +1,31 @@ +# ZPsycopgDA/__init__.py - ZPsycopgDA Zope product +# +# Copyright (C) 2004 Federico Di Gregorio <fog@initd.org> +# +# 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 the +# Free Software Foundation; either version 2, or (at your option) any later +# version. +# +# Or, at your option this program (ZPsycopgDA) can be distributed under the +# Zope Public License (ZPL) Version 1.0, as published on the Zope web site, +# http://www.zope.org/Resources/ZPL. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY +# or FITNESS FOR A PARTICULAR PURPOSE. +# +# See the LICENSE file for details. + +__doc__ = "ZPsycopg Database Adapter Registration." +__version__ = '2.0' + +import DA + +def initialize(context): + context.registerClass( + DA.Connection, + permission = 'Add Z Psycopg 2 Database Connections', + constructors = (DA.manage_addZPsycopgConnectionForm, + DA.manage_addZPsycopgConnection), + icon = SOFTWARE_HOME + '/Shared/DC/ZRDB/www/DBAdapterFolder_icon.gif') diff --git a/psycopg2/ZPsycopgDA/db.py b/psycopg2/ZPsycopgDA/db.py new file mode 100644 index 00000000..9a0b4b02 --- /dev/null +++ b/psycopg2/ZPsycopgDA/db.py @@ -0,0 +1,206 @@ +# ZPsycopgDA/db.py - query execution +# +# Copyright (C) 2004 Federico Di Gregorio <fog@initd.org> +# +# 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 the +# Free Software Foundation; either version 2, or (at your option) any later +# version. +# +# Or, at your option this program (ZPsycopgDA) can be distributed under the +# Zope Public License (ZPL) Version 1.0, as published on the Zope web site, +# http://www.zope.org/Resources/ZPL. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY +# or FITNESS FOR A PARTICULAR PURPOSE. +# +# See the LICENSE file for details. + +from Shared.DC.ZRDB.TM import TM +from Shared.DC.ZRDB import dbi_db + +from ZODB.POSException import ConflictError + +import site +import pool + +import psycopg2 +from psycopg2.extensions import INTEGER, LONGINTEGER, FLOAT, BOOLEAN, DATE, TIME +from psycopg2 import NUMBER, STRING, ROWID, DATETIME + + +# the DB object, managing all the real query work + +class DB(TM, dbi_db.DB): + + _p_oid = _p_changed = _registered = None + + def __init__(self, dsn, tilevel, enc='utf-8'): + self.dsn = dsn + self.tilevel = tilevel + self.encoding = enc + self.failures = 0 + self.calls = 0 + self.make_mappings() + + def getconn(self, create=True): + conn = pool.getconn(self.dsn) + conn.set_isolation_level(int(self.tilevel)) + return conn + + def putconn(self, close=False): + try: + conn = pool.getconn(self.dsn, False) + except AttributeError: + pass + pool.putconn(self.dsn, conn, close) + + def getcursor(self): + conn = self.getconn() + return conn.cursor() + + def _finish(self, *ignored): + try: + conn = self.getconn(False) + conn.commit() + self.putconn() + except AttributeError: + pass + + def _abort(self, *ignored): + try: + conn = self.getconn(False) + conn.rollback() + self.putconn() + except AttributeError: + pass + + def open(self): + # this will create a new pool for our DSN if not already existing, + # then get and immediately release a connection + self.getconn() + self.putconn() + + def close(self): + # FIXME: if this connection is closed we flush all the pool associated + # with the current DSN; does this makes sense? + pool.flushpool(self.dsn) + + def sortKey(self): + return 1 + + def make_mappings(self): + """Generate the mappings used later by self.convert_description().""" + self.type_mappings = {} + for t, s in [(INTEGER,'i'), (LONGINTEGER, 'i'), (NUMBER, 'n'), + (BOOLEAN,'n'), (ROWID, 'i'), + (DATETIME, 'd'), (DATE, 'd'), (TIME, 'd')]: + for v in t.values: + self.type_mappings[v] = (t, s) + + def convert_description(self, desc, use_psycopg_types=False): + """Convert DBAPI-2.0 description field to Zope format.""" + items = [] + for name, typ, width, ds, p, scale, null_ok in desc: + m = self.type_mappings.get(typ, (STRING, 's')) + items.append({ + 'name': name, + 'type': use_psycopg_types and m[0] or m[1], + 'width': width, + 'precision': p, + 'scale': scale, + 'null': null_ok, + }) + return items + + ## tables and rows ## + + def tables(self, rdb=0, _care=('TABLE', 'VIEW')): + self._register() + c = self.getcursor() + c.execute( + "SELECT t.tablename AS NAME, 'TABLE' AS TYPE " + " FROM pg_tables t WHERE tableowner <> 'postgres' " + "UNION SELECT v.viewname AS NAME, 'VIEW' AS TYPE " + " FROM pg_views v WHERE viewowner <> 'postgres' " + "UNION SELECT t.tablename AS NAME, 'SYSTEM_TABLE\' AS TYPE " + " FROM pg_tables t WHERE tableowner = 'postgres' " + "UNION SELECT v.viewname AS NAME, 'SYSTEM_TABLE' AS TYPE " + "FROM pg_views v WHERE viewowner = 'postgres'") + res = [] + for name, typ in c.fetchall(): + if typ in _care: + res.append({'TABLE_NAME': name, 'TABLE_TYPE': typ}) + self.putconn() + return res + + def columns(self, table_name): + self._register() + c = self.getcursor() + try: + r = c.execute('SELECT * FROM "%s" WHERE 1=0' % table_name) + except: + return () + self.putconn() + return self.convert_description(c.description, True) + + ## query execution ## + + def query(self, query_string, max_rows=None, query_data=None): + self._register() + self.calls = self.calls+1 + + desc = () + res = [] + nselects = 0 + + c = self.getcursor() + + try: + for qs in [x for x in query_string.split('\0') if x]: + if type(qs) == unicode: + if self.encoding: + qs = qs.encode(self.encoding) + try: + if query_data: + c.execute(qs, query_data) + else: + c.execute(qs) + except psycopg2.OperationalError, e: + try: + self.close() + except: + pass + self.open() + try: + if query_data: + c.execute(qs, query_data) + else: + c.execute(qs) + except (psycopg2.ProgrammingError, + psycopg2.IntegrityError), e: + if e.args[0].find("concurrent update") > -1: + raise ConflictError + raise e + except (psycopg2.ProgrammingError, psycopg2.IntegrityError), e: + if e.args[0].find("concurrent update") > -1: + raise ConflictError + raise e + if c.description is not None: + nselects += 1 + if c.description != desc and nselects > 1: + raise psycopg2.ProgrammingError( + 'multiple selects in single query not allowed') + if max_rows: + res = c.fetchmany(max_rows) + else: + res = c.fetchall() + desc = c.description + self.failures = 0 + + except StandardError, err: + self._abort() + raise err + + return self.convert_description(desc), res diff --git a/psycopg2/ZPsycopgDA/dtml/add.dtml b/psycopg2/ZPsycopgDA/dtml/add.dtml new file mode 100644 index 00000000..c718ded6 --- /dev/null +++ b/psycopg2/ZPsycopgDA/dtml/add.dtml @@ -0,0 +1,96 @@ +<dtml-var manage_page_header> + +<dtml-var "manage_form_title(this(), _, + form_title='Add Z Psycopg 2 Database Connection', + help_product='ZPsycopgDA', + help_topic='ZPsycopgDA-Method-Add.stx' + )"> + +<p class="form-help"> +A Zope Psycopg 2 Database Connection is used to connect and execute +queries on a PostgreSQL database. +</p> + +<p class="form-help"> +In the form below <em>Connection String</em> (also called the Data Source Name +or DSN for short) is a string... (TODO: finish docs) +</p> + +<form action="manage_addZPsycopgConnection" method="POST"> +<table cellspacing="0" cellpadding="2" border="0"> + <tr> + <td align="left" valign="top"> + <div class="form-label"> + Id + </div> + </td> + <td align="left" valign="top"> + <input type="text" name="id" size="40" + value="Psycopg2_database_connection" /> + </td> + </tr> + <tr> + <td align="left" valign="top"> + <div class="form-optional"> + Title + </div> + </td> + <td align="left" valign="top"> + <input type="text" name="title" size="40" + value="Z Psycopg 2 Database Connection"/> + </td> + </tr> + <tr> + <td align="left" valign="top"> + <div class="form-label"> + Connection string + </div> + </td> + <td align="left" valign="top"> + <input type="text" name="connection_string" size="40" value="" /> + </td> + </tr> + <tr> + <td align="left" valign="top"> + <div class="form-label"> + Connect immediately + </div> + </td> + <td align="left" valign="top"> + <input type="checkbox" name="check" value="YES" checked="YES" /> + </td> + </tr> + <tr> + <td align="left" valign="top"> + <div class="form-label"> + Use Zope's internal DateTime + </div> + </td> + <td align="left" valign="top"> + <input type="checkbox" name="zdatetime" value="YES" checked="YES" /> + </td> + </tr> + <tr> + <td align="left" valign="top"> + <div class="form-label"> + Transaction isolation level + </div> + </td> + <td align="left" valign="top"> + <select name="tilevel:int"> + <option value="1">Read committed</option> + <option value="2" selected="YES">Serializable</option> + </select> + </td> + </tr> + <tr> + <td align="left" valign="top" colspan="2"> + <div class="form-element"> + <input class="form-element" type="submit" name="submit" value=" Add " /> + </div> + </td> + </tr> +</table> +</form> + +<dtml-var manage_page_footer> diff --git a/psycopg2/ZPsycopgDA/dtml/browse.dtml b/psycopg2/ZPsycopgDA/dtml/browse.dtml new file mode 100644 index 00000000..deffd0ab --- /dev/null +++ b/psycopg2/ZPsycopgDA/dtml/browse.dtml @@ -0,0 +1,11 @@ +<html> + <head><title><dtml-var title_or_id >tables</title></head> + <body bgcolor="#FFFFFF" link="#000099" vlink="#555555" alink="#77003B"> + <dtml-var manage_tabs> + <dtml-tree header="info"> + <IMG SRC="<dtml-var SCRIPT_NAME >/misc_/ZPsycopgDA/<dtml-var icon>" + ALT="<dtml-var Type>" BORDER="0"> + <dtml-var Name><dtml-var Description> + </dtml-tree> + </body> +</html> diff --git a/psycopg2/ZPsycopgDA/dtml/edit.dtml b/psycopg2/ZPsycopgDA/dtml/edit.dtml new file mode 100644 index 00000000..7cb371fe --- /dev/null +++ b/psycopg2/ZPsycopgDA/dtml/edit.dtml @@ -0,0 +1,67 @@ +<dtml-var manage_page_header> +<dtml-var manage_tabs> + +<form action="manage_edit" method="POST"> +<table cellspacing="0" cellpadding="2" border="0"> + <tr> + <td align="left" valign="top"> + <div class="form-optional"> + Title + </div> + </td> + <td align="left" valign="top"> + <input type="text" name="title" size="40" + value="&dtml-title;"/> + </td> + </tr> + <tr> + <td align="left" valign="top"> + <div class="form-label"> + Connection string + </div> + </td> + <td align="left" valign="top"> + <input type="text" name="connection_string" size="40" + value="&dtml-connection_string;" /> + </td> + </tr> + <tr> + <td align="left" valign="top"> + <div class="form-label"> + Use Zope's internal DateTime + </div> + </td> + <td align="left" valign="top"> + <input type="checkbox" name="zdatetime" value="YES" + <dtml-if expr="zdatetime">checked="YES"</dtml-if> /> + </td> + </tr> + <tr> + <td align="left" valign="top"> + <div class="form-label"> + Transaction isolation level + </div> + </td> + <td align="left" valign="top"> + <select name="tilevel:int"> + <option value="1" + <dtml-if expr="tilevel==1">selected="YES"</dtml-if>> + Read committed</option> + <option value="2" + <dtml-if expr="tilevel==2">selected="YES"</dtml-if>> + Serializable</option> + </select> + </td> + </tr> + <tr> + <td align="left" valign="top" colspan="2"> + <div class="form-element"> + <input class="form-element" type="submit" name="submit" + value=" Save Changes " /> + </div> + </td> + </tr> +</table> +</form> + +<dtml-var manage_page_footer> diff --git a/psycopg2/ZPsycopgDA/dtml/table_info.dtml b/psycopg2/ZPsycopgDA/dtml/table_info.dtml new file mode 100644 index 00000000..639c23fd --- /dev/null +++ b/psycopg2/ZPsycopgDA/dtml/table_info.dtml @@ -0,0 +1,7 @@ +<dtml-var standard_html_header> + +<dtml-var TABLE_TYPE><dtml-if TABLE_OWNER> + owned by <dtml-var TABLE_OWNER></dtml-if> +<dtml-if REMARKS><br><dtml-var REMARKS></dtml-if> + +<dtml-var standard_html_footer> diff --git a/psycopg2/ZPsycopgDA/icons/bin.gif b/psycopg2/ZPsycopgDA/icons/bin.gif new file mode 100644 index 0000000000000000000000000000000000000000..e4691265687b23c83b3032da963526c0b3a8e526 GIT binary patch literal 924 zcmZ?wbhEHbRA3Nb_|CxapW#0P14BSSKtn^rfddErGcYtTI503QU~p(?U}$h)aQOe9 z;s5^zhK2@*hKB$DL5fGgC>S<C@h1x-$TK=10+c5lI4T(!Ib=LGEI8QADku=KV!}fw zCN4$09tpuk2fFx;v+nE=Jb1KILAGm(#U-UflQp=4SUMM^dUWb)SFvm;O7Wd!;hXg2 z#N_8^ra1T?lkwWJB5;ws`mP$z!pxI1%@^;RGE-!E$ZW}les{Y{lddi^+H7@}^XrP6 Ln{^pkSQxAUv5`$p literal 0 HcmV?d00001 diff --git a/psycopg2/ZPsycopgDA/icons/date.gif b/psycopg2/ZPsycopgDA/icons/date.gif new file mode 100644 index 0000000000000000000000000000000000000000..0d88a57343f8a727924fd2fc1bad32c4ecb5b24d GIT binary patch literal 930 zcmZ?wbhEHbRA3Nb_|CxapW#0P14BSSKtn^rfddErGcYtTI503QU~p(?U}$h)aQOe9 z;s5^zhK2@*hKB$DL5fGgC>S<C@h1x-$TK=10+c5lIO-V~Ib=LGEI8QADk$KvV8Vez zZT!+kB_0zOIk7M)hTS=_aq-a}ZdospOv4n{4spR%F_j-4x%J9<PCCMIV5x66Pi&P> zr17%zGfX16LT7GXadELnZ&M5B<#fM^-hpO+B_}=eovZG<Z_194XD4Plh?kw!`jmNj Rc~Z7o?CEKW4Gjzo)&Q{ZP|E-S literal 0 HcmV?d00001 diff --git a/psycopg2/ZPsycopgDA/icons/datetime.gif b/psycopg2/ZPsycopgDA/icons/datetime.gif new file mode 100644 index 0000000000000000000000000000000000000000..faa540b11f97cfba8c689dcbf1162de4c51c4a63 GIT binary patch literal 925 zcmZ?wbhEHbRA3Nb_|CxapW#0P14BSSKtn^rfddErGcYtTI503QU~p(?U}$h)aQOe9 z;s5^zhK2@*hKB$DL5fGgC>S<C@h1x-$TK=10+c5lII0*JIb=LGEI8QADkz}P;PB9? zjZfUHha+&26AP23-JKH~lihn5WXztdC|u$>QCx6UOl830<J0vW7pZtodUT@8DDhPb z=cJ|nQ-zzkWW7Q%j?MM(l$+{N{P=9UU~t=(7gwI0?6R0XZ%@Q#t*dh)7MAUuWtwtv MbA~h%2M2>S0J-c<e*gdg literal 0 HcmV?d00001 diff --git a/psycopg2/ZPsycopgDA/icons/field.gif b/psycopg2/ZPsycopgDA/icons/field.gif new file mode 100644 index 0000000000000000000000000000000000000000..9bf8692be6c734783164f7c8df4a99c7696c6635 GIT binary patch literal 915 zcmZ?wbhEHbRA3Nb_|CxapW#0P14BSSKtn^rfddErGcYtTI503QU~p(?U}$h)aQOe9 z;s5^zhK2@*hKB$DL5fGgC>S<C@h1x-$TK=10+c5lI0_gTIb=LGEI8QADku<fV#2~h zZTzxkF&z#GM>-{p)7Ef2SahskTChu|@<Ospt2*bBIVUbEyG}E3E@SZwRy#RcN$|y; zlbe^HpKqm`bmwJ2df;@e)+`fA;YF7g`o{Csav82VwKPOE?5@>T<qPW*n%P(wtN~Ci BNX!5L literal 0 HcmV?d00001 diff --git a/psycopg2/ZPsycopgDA/icons/float.gif b/psycopg2/ZPsycopgDA/icons/float.gif new file mode 100644 index 0000000000000000000000000000000000000000..dd427299369f706417724103e20b3b5c89480ffd GIT binary patch literal 929 zcmZ?wbhEHbRA3Nb_|CxapW#0P14BSSKtn^rfddErGcYtTI503QU~p(?U}$h)aQOe9 z;s5^zhK2@*hKB$DL5fGgC>S<C@h1x-$TK=10+c5lIO-S}Ib=LGEI8QADku=KqF|vj z6PK)8i-zE$1D*WFS$9r+NOEnHRQ40e6kK?6GMlJU#LtOJC#PxIHq~?#E;~DeA*<+) zq|j3TDca3kvR+#<0%nS+Zc5oP<yjDmM`@Bwq+r&$X%VyU>HNHu<}oXDu@={<EelU9 Q7w=sayIaV?fq}sq0IeEL3IG5A literal 0 HcmV?d00001 diff --git a/psycopg2/ZPsycopgDA/icons/int.gif b/psycopg2/ZPsycopgDA/icons/int.gif new file mode 100644 index 0000000000000000000000000000000000000000..ef2c5e3690d5b55e816b388c1112b58c9f55aee2 GIT binary patch literal 918 zcmZ?wbhEHbRA3Nb_|CxapW#0P14BSSKtn^rfddErGcYtTI503QU~p(?U}$h)aQOe9 z;s5^zhK2@*hKB$DL5fGgC>S<C@h1x-$TK=10+c5lIEon<Ib=LGEI8QADku<fVnV~A zHg0*NDHeeWt{oD_NiGS7i;r~6n=8q9ep2vYQB<~?qak#_bt+f<x|S0cmmZsKAv^6( zq|nmy^BtPGzTPZM_L(9)aod!WQ=SF&yG^drc{N2fWL8MB+E>Xy&9Ldthr3)k6%-h( E0eYrLNdN!< literal 0 HcmV?d00001 diff --git a/psycopg2/ZPsycopgDA/icons/stable.gif b/psycopg2/ZPsycopgDA/icons/stable.gif new file mode 100644 index 0000000000000000000000000000000000000000..acdd37df61c44de3b08fa95c8302e6702a423da5 GIT binary patch literal 884 zcmZ?wbhEHb6krfw_|CxapW#0P14BSSKtn^rfddErGcYtTI503QU~p(?U}$h)aQOe9 z;s5^zhK2@*hKB$DL5fGgC>S<C@h1x-$TK=10+c5lI06|MIb=LGC@?T{2x-OaxWM4l zCLnCpBT=a2+9sy2b!LSiqkAu(bC-;!5F;a#THrjN&Z0-BrfY@o>X|udse6k-_Pm_V U$!b3HtZGlGc$%a*FfdpH0C8Y6D*ylh literal 0 HcmV?d00001 diff --git a/psycopg2/ZPsycopgDA/icons/table.gif b/psycopg2/ZPsycopgDA/icons/table.gif new file mode 100644 index 0000000000000000000000000000000000000000..cce83beaf96b7d4e6147e7c6a18c975c541df349 GIT binary patch literal 878 zcmZ?wbhEHb6krfw_|CxapW#0P14BSSKtn^rfddErGcYtTI503QU~p(?U}$h)aQOe9 z;s5^zhK2@*hKB$DL5fGgC>S<C@h1x-$TK=10+c5lIJ_AcIb=LGEO209;ZO*fQLyk( zGncYa4oBf5r*;mWES-u#rDI*P>UJywMo&)kN(-)tIXUU+!D$Ae`+9B`shyo_mY=4w OQds@`JV|CI25SK0DK$v| literal 0 HcmV?d00001 diff --git a/psycopg2/ZPsycopgDA/icons/text.gif b/psycopg2/ZPsycopgDA/icons/text.gif new file mode 100644 index 0000000000000000000000000000000000000000..a2e5aab6f29769c52dff27f822fc9da76f0be924 GIT binary patch literal 918 zcmZ?wbhEHbRA3Nb_|CxapW#0P14BSSKtn^rfddErGcYtTI503QU~p(?U}$h)aQOe9 z;s5^zhK2@*hKB$DL5fGgC>S<C@h1x-$TK=10+c5lIEon<Ib=LGEI8QADku<fLZI<* zE1$g6loJAr99l(<v+m3gJb1K^i!(vQQ)rP}KS%H?6N^d7-hHBh`$Qx+s+^o@Xn*L= z%c7;{rwTT6$$EvX@S9;VQLgml=Ep%3lttZaf0nGeI@iem8qci>Nq!8jhr4<?6ciY& E0gy{bG5`Po literal 0 HcmV?d00001 diff --git a/psycopg2/ZPsycopgDA/icons/time.gif b/psycopg2/ZPsycopgDA/icons/time.gif new file mode 100644 index 0000000000000000000000000000000000000000..6d089150008c5f5e5d35771e238266d2e0f37cc5 GIT binary patch literal 926 zcmZ?wbhEHbRA3Nb_|CxapW#0P14BSSKtn^rfddErGcYtTI503QU~p(?U}$h)aQOe9 z;s5^zhK2@*hKB$DL5fGgC>S<C@h1x-$TK=10+c5lII0;KIb=LGEI8QADku<fBH*D@ zI}fKu3rFCh16_i~S$BSXSmf3tB;8gcA;@@WvIc*c%YjdeJ-SqF(^w*lmiTrvWE9<z zG+ydIMW>ld)@w^fz)Vy7Z8bZ#C<aZmR(E<k<MPvEOAY3R%{>{c<+)a2vsaE($url* N8J9P)2naA(0{{i7OgI1l literal 0 HcmV?d00001 diff --git a/psycopg2/ZPsycopgDA/icons/view.gif b/psycopg2/ZPsycopgDA/icons/view.gif new file mode 100644 index 0000000000000000000000000000000000000000..71b30de161aa4c99d3f09e19aa7fcf9a7d1e1757 GIT binary patch literal 893 zcmZ?wbhEHb6krfw_|CxapW#0P14BSSKtn^rfddErGcYtTI503QU~p(?U}$h)aQOe9 z;s5^zhK2@*hKB$DL5fGgC>S<C@h1x-$TK=10+c5lIHDLBIb=LGC@`?I2q~#-n2_ki z!YXJp=f{Txr*;WRDG`l{4#)fCbhTtWg^~`ps%tMh^CCf+fyE&CREtN!va`*6MX&C> dR8aGqXH(0>s#Wsh+#<JPA)i%~6C4;AtO2*@Iivsp literal 0 HcmV?d00001 diff --git a/psycopg2/ZPsycopgDA/icons/what.gif b/psycopg2/ZPsycopgDA/icons/what.gif new file mode 100644 index 0000000000000000000000000000000000000000..8b5516e397d2684c0ee4628ddd2730964e07bee0 GIT binary patch literal 894 zcmZ?wbhEHb6krfw_|CxapW#0P14BSSKtn^rfddErGcYtTI503QU~p(?U}$h)aQOe9 z;s5^zhK2@*hKB$DL5fGgC>S<C@h1x-0|P6A4#-EKJmJ6*&A`YZBe7t?!A2HYjgX83 z2b@|NS=b_OY)ClVD#++lb3$;@k#;Wqq(3JDm$>)JTBlu!2uO8oVT)a7BH@s7v{}P? h)|nj>7aeZ5@%|?>^RoK!1)7aYQ#^`Q8yXlGtN|%JKL7v# literal 0 HcmV?d00001 diff --git a/psycopg2/ZPsycopgDA/pool.py b/psycopg2/ZPsycopgDA/pool.py new file mode 100644 index 00000000..05af0a52 --- /dev/null +++ b/psycopg2/ZPsycopgDA/pool.py @@ -0,0 +1,51 @@ +# ZPsycopgDA/pool.py - ZPsycopgDA Zope product: connection pooling +# +# Copyright (C) 2004 Federico Di Gregorio <fog@initd.org> +# +# 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 the +# Free Software Foundation; either version 2, or (at your option) any later +# version. +# +# Or, at your option this program (ZPsycopgDA) can be distributed under the +# Zope Public License (ZPL) Version 1.0, as published on the Zope web site, +# http://www.zope.org/Resources/ZPL. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY +# or FITNESS FOR A PARTICULAR PURPOSE. +# +# See the LICENSE file for details. + +# all the connections are held in a pool of pools, directly accessible by the +# ZPsycopgDA code in db.py + +import threading +import psycopg2.pool + +_connections_pool = {} +_connections_lock = threading.Lock() + +def getpool(dsn, create=True): + _connections_lock.acquire() + try: + if not _connections_pool.has_key(dsn) and create: + _connections_pool[dsn] = \ + psycopg2.pool.PersistentConnectionPool(4, 200, dsn) + finally: + _connections_lock.release() + return _connections_pool[dsn] + +def flushpool(dsn): + _connections_lock.acquire() + try: + _connections_pool[dsn].closeall() + del _connections_pool[dsn] + finally: + _connections_lock.release() + +def getconn(dsn, create=True): + return getpool(dsn, create=create).getconn() + +def putconn(dsn, conn, close=False): + getpool(dsn).putconn(conn, close=close) diff --git a/psycopg2/debian/changelog b/psycopg2/debian/changelog new file mode 100644 index 00000000..44d83dc6 --- /dev/null +++ b/psycopg2/debian/changelog @@ -0,0 +1,12 @@ +psycopg2 (1.99.12.1-1) experimental; urgency=low + + * Adapted from patches sent by W. Borgert. + * Renamed source package to psycopg2. + + -- Federico Di Gregorio <fog@debian.org> Fri, 4 Mar 2005 13:11:43 +0100 + +psycopg2 (1.99.11-0.1) unstable; urgency=low + + * Experimental package. + + -- W. Borgert <debacle@debian.org> Sun, 09 Jan 2005 10:14:09 +0000 diff --git a/psycopg2/debian/control b/psycopg2/debian/control new file mode 100644 index 00000000..9c636767 --- /dev/null +++ b/psycopg2/debian/control @@ -0,0 +1,51 @@ +Source: psycopg2 +Section: python +Priority: optional +Build-depends: postgresql-dev, debhelper (>> 3), python2.3-dev, cdbs +Maintainer: Federico Di Gregorio <fog@debian.org> +Standards-Version: 3.6.1.1 + +Package: python-psycopg2 +Architecture: any +Section: python +Depends: python (>= 2.3), python (<< 2.4), python2.3-psycopg2 +Description: Python module for PostgreSQL [dummy package] + psycopg is a PostgreSQL database adapter for the Python programming + language. It was written from scratch with the aim of being very small + and fast, and stable as a rock. The main advantages of psycopg are that + it supports the full Python DBAPI-2.0 and being thread safe at level 2. + . + psycopg 2 is the next generation psycopg, implementing a much better + type system and even more DBAPI extensions: + . + * support for Python datetime and Decimal types; + * complete implementation of adapt() from PEP 246 to convert Python + types to PostgreSQL ones; + * COPY FROM/COPY TO support; + * inehritable connection and cursor objects and support for connection + and cursor factories; + * automatic encoding conversion and support for unicode queries. + . + This dummy package just depends on the right, default version of Python + and psycopg 2. + +Package: python2.3-psycopg2 +Architecture: any +Section: python +Depends: ${shlibs:Depends}, python2.3 +Description: Python 2.3 module for PostgreSQL + psycopg is a PostgreSQL database adapter for the Python programming + language. It was written from scratch with the aim of being very small + and fast, and stable as a rock. The main advantages of psycopg are that + it supports the full Python DBAPI-2.0 and being thread safe at level 2. + . + psycopg 2 is the next generation psycopg, implementing a much better + type system and even more DBAPI extensions: + . + * support for Python datetime and Decimal types; + * complete implementation of adapt() from PEP 246 to convert Python + types to PostgreSQL ones; + * COPY FROM/COPY TO support; + * inehritable connection and cursor objects and support for connection + and cursor factories; + * automatic encoding conversion and support for unicode queries. diff --git a/psycopg2/debian/copyright b/psycopg2/debian/copyright new file mode 100644 index 00000000..c6319158 --- /dev/null +++ b/psycopg2/debian/copyright @@ -0,0 +1,10 @@ +psycopg 2 can be downloaded from: + + http://initd.org/pub/software/psycopg/ALPHA/ + +Copyright (c) 2001-2005 Federico Di Gregorio <fog@debian.org> + +This program is distributed under the GNU GPL. + +On Debian GNU/Linux systems, the complete text of the GNU General +Public License can be found in '/usr/share/common-licenses/GPL'. diff --git a/psycopg2/debian/rules b/psycopg2/debian/rules new file mode 100755 index 00000000..98ad46ff --- /dev/null +++ b/psycopg2/debian/rules @@ -0,0 +1,4 @@ +#!/usr/bin/make -f + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/class/python-distutils.mk diff --git a/psycopg2/doc/ChangeLog-1.x b/psycopg2/doc/ChangeLog-1.x new file mode 100644 index 00000000..dadfc1b4 --- /dev/null +++ b/psycopg2/doc/ChangeLog-1.x @@ -0,0 +1,1744 @@ +2003-07-26 Federico Di Gregorio <fog@debian.org> + + * Release 1.1.7. + + * ZPsycopgDA/db.py: added _cursor method that checks for self.db + before returning a new cursor. Should fix problem reported with + Zope 2.7. + +2003-07-23 Federico Di Gregorio <fog@debian.org> + + * cursor.c: applied notify and fileno patch from Vsevolod Lobko. + +2003-07-20 Federico Di Gregorio <fog@debian.org> + + * cursor.c (_mogrify_dict): applied (slightly modofied) patch from + Tobias Sargeant: now .execute() accept not only dictionaries but + every type that has a __getitem__ method. + +2003-07-13 Federico Di Gregorio <fog@debian.org> + + * Release 1.1.6. + + * cursor.c (psyco_curs_scroll): added scroll method, patch from + Jason D.Hildebrand. + + * typemod.c (new_psyco_quotedstringobject): discard NUL characters + (\0) in quoted strings (fix problem reported by Richard Taylor.) + +2003-07-10 Federico Di Gregorio <fog@debian.org> + + * Added python-taylor.txt in doc directory: very nice introduction + to DBAPI programming by Richard Taylor. + +2003-07-09 Federico Di Gregorio <fog@debian.org> + + * cursor.c (_psyco_curs_execute): another MT problem exposed and + fixed by Sebastien Bigaret (self->keeper->status still LOCKED + after a fatal error during PQexec call.) + +2003-06-23 Federico Di Gregorio <fog@debian.org> + + * Release 1.1.5.1. + + * ZPsycopgDA/db.py (DB.query): stupid error making ZPsycopgDA + unusable fixed (else->except). + +2003-06-22 Federico Di Gregorio <fog@debian.org> + + * Release 1.1.5 candidate. + + * cursor.c (psyco_curs_copy_to): now any object with the write + method can be used as a copy_to target. + +2003-06-20 Federico Di Gregorio <fog@debian.org> + + * cursor.c (psyco_curs_copy_from): applied patch to allow copy_to + from any object having a "readline" attribute (patch from Lex + Berezhny.) (psyco_curs_copy_from): another patch from Lex to make + psycopg raise an error on COPY FROM errors. + + * ZPsycopgDA/db.py (DB.query): if a query raise an exception, + first self._abort() is called to rollback current + "sub-transaction". this is a backward-compatible change for + people that think continuing to work in the same zope transaction + after an exception is a Good Thing (TM). + + * finally updated check_types.expected. checked by hand the + conversions work the right way. + + * doc/examples/work.py: fixed example. note that it is a long time + (at least two releases) that psycopg does not END a transaction + initiated explicitly by the user while in autocommit mode. + +2003-06-19 Federico Di Gregorio <fog@debian.org> + + * cursor.c (_mogrify_dict): fixed dictionary mogrification (patch + by Vsevolod Lobko.) (_psyco_curs_execute): fixed keeper status + trashing problem by letting only one thread at time play with + keeper->status (as suggested by Sebastien Bigaret.) + +2003-05-07 Federico Di Gregorio <fog@debian.org> + + * Release 1.1.4. + + * cursor.c: Added "statusmessage" attribute that holds the backend + message (modified lots of functions, look for self->status). + +2003-05-06 Federico Di Gregorio <fog@debian.org> + + * typemod.c (new_psyco_datetimeobject): moved Py_INCREF into + XXX_FromMx functions, to fix memory leak reported by Jim Crumpler. + +2003-04-11 Federico Di Gregorio <fog@debian.org> + + * module.h (PyObject_TypeCheck): fixed leak in python 2.1 + (Guido van Rossum). + +2003-04-08 Federico Di Gregorio <fog@debian.org> + + * buildtypes.py (basic_types): removed LXTEXT (never user, does + not exists anymore.) + +2003-04-07 Federico Di Gregorio <fog@debian.org> + + * setup.py: added very lame setup.py script. + +2003-04-02 Federico Di Gregorio <fog@debian.org> + + * Release 1.3. + + * psycopg.spec: Added (but modified) spec file by William + K. Volkman (again, this change was lost somewhere in time...) + +2003-04-01 Federico Di Gregorio <fog@debian.org> + + * cursor.c (_psyco_curs_execute): psycopg was reporting everything + as IntegrityError; reported and fix suggested by Amin Abdulghani. + +2003-03-21 Federico Di Gregorio <fog@debian.org> + + * cursor.c (psyco_curs_fetchone): debug statements sometimes made + psycopg segfault: fixed by a patch by Ken Simpson. + +2003-03-18 Federico Di Gregorio <fog@debian.org> + + * cursor.c (alloc_keeper): patch from Dieter Maurer to unlock GIL + whaile calling PQconnectdb(). + +2003-03-05 Federico Di Gregorio <fog@debian.org> + + * Release 1.1.2. + + * Applied cygwin patch from Hajime Nakagami. + +2003-02-25 Federico Di Gregorio <fog@debian.org> + + * Release 1.1.2pre1. + + * cursor.c: added .lastrowid attribute to cursors (lastoid is + deprecated and will be removed sometime in the future.) + + * cursor.c (begin_pgconn): implemented various isolation levels + (also, in abort_pgconn, commit_pgconn.) + + * Added keyword parameters to psycopg.connect(): all take strings + (even port): database, host, port, user, password. + + * configure.in: fixed test for postgres version > 7.2. + + * cursor.c (_psyco_curs_execute): removed if on pgerr in default + case (if we enter default pgerr can't be one of the cased ones.) + Also applied slightly modified patch from William K. Volkman. + +2003-02-24 Federico Di Gregorio <fog@debian.org> + + * Merged in changes from 1.0.15.1 (see below for merged + ChangeLog.) + +2003-02-14 Federico Di Gregorio <fog@debian.org> + + * Release 1.0.15.1. + + * cursor.c (_mogrify_fmt): in some cases we where removing one + character too much from the format string, resulting in BIG BAD + BUG. <g> Fixed. + +2003-02-13 Federico Di Gregorio <fog@debian.org> + + * Release 1.0.15. <g> + + * connection.c (_psyco_conn_close): now call dispose_pgconn on all + cursors, to make sure all phisical connections to the db are + closed (problem first reported by Amin Abdulghani.) + + * DBAPI-2.0 fixed mainly due to Stuart Bishop: + - cursor.c (psyco_curs_setinputsizes): removed PARSEARGS, as + this method does nothing. + - cursor.c (psyco_curs_setoutputsize): .setoutputsize was + spelled .setoutputsizes! fixed. Also removed PARSEARGS, as this + method does nothing. + +2003-02-12 Federico Di Gregorio <fog@debian.org> + + * module.h (Dprintf): check on __APPLE__ to avoid variadic macros + on macos x (as reported by Stuart Bishop, btw, why gcc seems to + not support them on macos?) + + * cursor.c (_mogrify_fmt): non-alphabetic characters are dropped + after the closing ")" until a real alphabetic, formatting one is + found. (Fix bug reported by Randall Randall.) + +2003-02-05 Federico Di Gregorio <fog@debian.org> + + * typeobj.c (psyco_INTERVAL_cast): patched again to take into + account leading zeroes. + +2003-02-02 Federico Di Gregorio <fog@debian.org> + + * Makefile.pre.in: applied patch from Albert Chin-A-Young to + define BLDSHARED. + + * README: added explicit permission to link with OpenSSL. + +2003-01-30 Federico Di Gregorio <fog@debian.org> + + * config.h.in: applied patch from Albert Chin-A-Young to fix + asprintf prototype. + +2003-01-29 Federico Di Gregorio <fog@debian.org> + + * cursor.c (_mogrify_seq): fixed little refcount leak, as + suggested by Yves Bastide. + +2003-01-24 Federico Di Gregorio <fog@debian.org> + + * Merged-in changes from 1.0.14.2 (emacs diff mode is great..) + + * Release 1.0.14.2. + + * ZPsycopgDA/db.py (DB.query): back to allowing up to 1000 db + errors before trying to reopen the connection by ourselves. + + * ZPsycopgDA/db.py: a false (None preferred, 0 allowed) max_rows + value now means "fetch all results". + +2003-01-22 Federico Di Gregorio <fog@debian.org> + + * cursor.c (psyco_curs_fetchone): fixed little memory leak + reported by Dieter Maurer. + +2003-01-20 Federico Di Gregorio <fog@debian.org> + + * ZPsycopgDA/db.py (DB.tables/columns): added registration with + Zope's transaction machinery. + + * Release 1.0.14.1. + + * ZPsycopgDA/db.py: applied some fixes and cleanups by Dieter + Maurer (serialization problem were no more correctly detected!) + + * Release 1.0.14. + + * Merged in 1.0.14. + + * Import of 1.1.1 done. + + * Moved everything to cvs HEAD. + +2003-01-20 Federico Di Gregorio <fog@debian.org> + + * ZPsycopgDA/connectionAdd.dtml: fixed typo (thanks to Andrew + Veitch.) + + * typeobj.c (psyco_INTERVAL_cast): applied patch from Karl Putland + to fix problems with fractional seconds. + +2002-12-03 Federico Di Gregorio <fog@debian.org> + + * Release 1.0.14-pre2. + + * module.h: added macro for PyObject_TypeCheck if python version <2.2. + + * typeobj.c (psyco_DBAPITypeObject_coerce): added error message to + coercion errors. + +2002-12-02 Federico Di Gregorio <fog@debian.org> + + * Release 1.0.14-pre1. + + * ZPsycopgDA/db.py (DB.sortKey): added sortKey(). + + * ZPsycopgDA/DA.py: applied a patch that was lost on hard disk + (sic), if you sent me a patch names psycopg-1.0.13.diff modifying + DA.py imports and want your name here, send me an email. :) + [btw, the patch fix the ImageFile import, getting it from Globals + as it is right.] + + * typeobj.c (psyco_DBAPITypeObject_coerce): Fixed coerce segfault + by checking explicitly for all the allowed types. + +2002-11-25 Federico Di Gregorio <fog@debian.org> + + * doc/examples/*.py: added .rollback() to all exceptions before + deleteing the old table. + + * cursor.c: Apllied patch from John Goerzen (fix memory leak in + executemany). + +2002-10-25 Federico Di Gregorio <fog@debian.org> + + * Release 1.0.13. + + * connection.c (_psyco_conn_close): remove cursors from the list + starting from last and moving backward (as suggested by Jeremy + Hylton; this is not such a big gain because python lists are + *linked* lists, but not removing the element 0 makes the code a + little bit clear.) + + * cursor.c (_psyco_curs_execute): now IntegrityError is raised + instead of ProgrammingError when adding NULL values to a non-NULL + column (suggested by Edmund Lian) and on referential integrity + violation (as per debian bug #165791.) + + * typeobj.c (psyco_DATE_cast): now we use 999999 instead of + 5867440 for very large (both signs) dates. This allow to re-insert + the DateTime object into postgresql (suggested by Zahid Malik.) + +2002-09-13 Federico Di Gregorio <fog@debian.org> + + * Release 1.0.12. + + * Removed code to support COPY FROM/TO, will be added to new 1.1 + branch to be released next week. + + * cursor.c (_mogrify_seq): Fixed memory leak reported by Menno + Smits (values obtained by calling PySequence_GetItem are *new* + references!) + +2002-09-07 Federico Di Gregorio <fog@debian.org> + + * cursor.c (_psyco_curs_execute): Added skeleton to support COPY + FROM/TO. + +2002-09-06 Federico Di Gregorio <fog@debian.org> + + * configure.in: if libcrypt can't be found we probably are on + MacOS X: check for libcrypto, as suggested by Aparajita Fishman. + +2002-09-03 Federico Di Gregorio <fog@debian.org> + + * ZPsycopgDA/db.py (DB.columns): Applied patch from Dieter Maurer + to allow the DA-browser to work with mixed case table names. + +2002-08-30 Federico Di Gregorio <fog@debian.org> + + * ZPsycopgDA/DA.py (cast_DateTime): Applied patch from Yury to fix + timestamps (before they were returned with time always set to 0.) + +2002-08-26 Federico Di Gregorio <fog@debian.org> + + * Release 1.0.11.1 (to fix a %&£$"! bug in ZPsycopgDA not + accepting psycopg 1.0.11 as a valid version. + + * Release 1.0.11. + +2002-08-22 Federico Di Gregorio <fog@debian.org> + + * Release 1.0.11pre2. + + * cursor.c (_psyco_curs_execute): fixed IntegrityError as reported + by Andy Dustman. (psyco_curs_execute): converting TypeError to + ProgrammingError on wrong number of % and/or aeguments. + + * doc/examples/integrity.py: added example and check for + IntegrityError. + +2002-08-08 Federico Di Gregorio <fog@debian.org> + + * Release 1.0.11pre1. + +2002-08-06 Federico Di Gregorio <fog@debian.org> + + * ZPsycopgDA/DA.py (cast_DateTime): patched as suggested by Tom + Jenkins; now it shouldwork with time zones too. + +2002-08-01 Federico Di Gregorio <fog@debian.org> + + * ZPsycopgDA/DA.py (cast_DateTime): fixed problem with missing + AM/PM, as reported by Tom Jenkins. + +2002-07-23 Federico Di Gregorio <fog@debian.org> + + * Fixed buglets reported by Mike Coleman. + +2002-07-22 Federico Di Gregorio <fog@debian.org> + + * Release 1.0.10. + +2002-07-14 Federico Di Gregorio <fog@debian.org> + + * Release 1.0.10pre2. + + * typeobj.c (psyco_LONGINTEGER_cast): fixed bad segfault by + INCREFfing Py_None when it is the result of a NULL conversion. + +2002-07-04 Federico Di Gregorio <fog@debian.org> + + * Release 1.0.10pre1. + + * buildtypes.py (basic_types): added TIMESTAMPTZ to the types + converted by the DATE builtin. + + * ZPsycopgDA/DA.py (Connection.connect): Added version check. + +2002-07-03 Federico Di Gregorio <fog@debian.org> + + * typeobj.c (psyco_XXX_cast): fixed bug reported by multiple users + by appliying Matt patch. + +2002-06-30 Federico Di Gregorio <fog@debian.org> + + * ZPsycopgDA/DA.py (Connection.set_type_casts): applied patch from + Tom Jenkins to parse dates with TZ. + +2002-06-20 Federico Di Gregorio <fog@debian.org> + + * Preparing for release 1.0.9. + + * Makefile.pre.in (dist): now we really include psycopg.spec. + +2002-06-17 Federico Di Gregorio <fog@debian.org> + + * ZPsycopgDA/db.py (_finish, _abort): fixed problem with + connection left in invalid state by applying Tom Jenkins patch. + +2002-06-06 Federico Di Gregorio <fog@debian.org> + + * ZPsycopgDA/db.py (DB._abort): fixed exception raising after an + error in execute triggerer deletion of self.db. + +2002-05-16 Federico Di Gregorio <fog@debian.org> + + * cursor.c (psyco_curs_fetchone): None values passed to the + internal typecasters. + + * typeobj.c: added management of None to all the builtin + typecasters. + +2002-04-29 Federico Di Gregorio <fog@debian.org> + + * ZPsycopgDA/DA.py (cast_Time): applied 'seconds as a float' patch + from Jelle. + +2002-04-23 Federico Di Gregorio <fog@debian.org> + + * Release 1.0.8. + + * Makefile.pre.in: we now include win32 related files in the + distribution. + + * connection.c (psyco_conn_destroy): fixed segfault reported by + Scott Leerssen (we were double calling _psyco_conn_close().) + + * typemod.c (new_psyco_quotedstringobject): fixed memory stomping + catched by assert(); thanks to Matt Hoskins for reporting this + one. + +2002-04-22 Federico Di Gregorio <fog@debian.org> + + * configure.in: grmpf. we need a VERSION file for windows, we'll + use it for configue and debian/rules too. + + * Integrated win32 changes from Jason Erickson. Moved his + Readme.txt to README.win32, removed VERSION and DATE, patched + source where required. Renamed HISTORY to ChangeLog.win32, hoping + Jason will start adding changes to the real ChangeLog file. + +2002-04-07 Federico Di Gregorio <fog@debian.org> + + * Release 1.0.7.1. + + * configure.in: fixed little bug as reported by ron. + +2002-04-05 Federico Di Gregorio <fog@debian.org> + + * Release 1.0.7? + + * typemod.c (new_psyco_bufferobject): fixed encoding problem (0xff + now encoded as \377 and not \777.) Also encoding *all* chars as + quoted octal values to prevent "Invalid UNICODE character sequence + found" errors. + + * Release 1.0.7. (Real this time.) (Ok, it was a joke....) + +2002-04-03 Federico Di Gregorio <fog@debian.org> + + * configure.in: fixed problem with postgres versions in the format + 7.2.x (sic.) + + * connection.c (psyco_conn_destroy): moved most of the destroy + stuff into its own function (_psyco_conn_close) and added a call + to it from psyco_conn_close. This should fix the "psycopg does not + release postgres connections on .close()" problem. + +2002-03-29 Federico Di Gregorio <fog@debian.org> + + * Release 1.0.7. Delayed. + + * buildtypes.py (basic_types): added TIMESTAMPTZ postgres type to + the list of valid DATETIME types (incredible luck, no changes to + the parse are needed!) + + * typeobj.c (psyco_DATE_cast): fixed wrong managment of sign in + infinity. + +2002-03-27 Federico Di Gregorio <fog@debian.org> + + * configure.in (INSTALLOPTS): added AC_PROG_CPP test, now uses + AC_TRY_CPP to test for _all_ required mx includes. + +2002-03-19 Federico Di Gregorio <fog@debian.org> + + * configure.in: added check for both pg_config.h and config.h to + detect postgres version. + + * cursor.c: now None values are correctly handled when the format + string is not %s but %d, etc. + +2002-03-08 Federico Di Gregorio <fog@debian.org> + + * ZPsycopgDA/DA.py: added MessageDialog import suggested by + Guido. + +2002-03-07 Federico Di Gregorio <fog@debian.org> + + * psycopg.spec: added RPM specs by William K. Volkman. + + * Release 1.0.6. + + * configure.in: imported changes to allow postgres 7.2 builds from + unstable branch. + +2002-03-04 Federico Di Gregorio <fog@debian.org> + + * Release 1.0.5. + + * applied table browser patch from Andy Dustman. + +2002-02-26 Federico Di Gregorio <fog@debian.org> + + * typeobj.c (psyco_DATE_cast): added management of infinity + values, this can be done in a better way, by accessing the + MaxDateTime and MinDateTime constants of the mx.DateTime module. + +2002-02-20 Federico Di Gregorio <fog@debian.org> + + * configure.in: Release 1.0.4. + +2002-02-12 Federico Di Gregorio <fog@debian.org> + + * ZPsycopgDA/db.py (DB.columns): fixed select to reenable column + expansion in table browsing. + + * ZPsycopgDA/__init__.py: removed code that made psycopg think + double. + +2002-02-11 Federico Di Gregorio <fog@debian.org> + + * cursor.c (_mogrify_dict): removed Py_DECREF of Py_None, + references returned by PyDict_Next() are borrowed (thanks to + Michael Lausch for this one.) + +2002-02-08 Federico Di Gregorio <fog@debian.org> + + * A little bug slipped in ZPsycopgDA, releasing 1.0.3 immediately. + + * Release 1.0.2. + + * tests/check_types.py (TYPES): added check for hundredths of a + second. + +2002-02-07 Federico Di Gregorio <fog@debian.org> + + * typeobj.c (psyco_INTERVAL_cast): patched to correct wrong + interpretation of hundredths of a second (patch from + A. R. Beresford, kudos!) + +2002-01-31 Federico Di Gregorio <fog@debian.org> + + * FAQ: added. + +2002-01-16 Federico Di Gregorio <fog@debian.org> + + * Preparing for release 1.0.1. + + * cursor.c (alloc_keeper): removed ALLOW_THREADS wrapper around + PQconnectdb: libpq calls crypt() that is *not* reentrant. + +2001-12-19 Federico Di Gregorio <fog@debian.org> + + * typeobj.c (psyco_DBAPITypeObject_cmp): added check to simply + return false when two type objects are compared (type objects are + meaned to be compared to integers!) + + * typeobj.c: fixed the memory leak reported by the guys at + racemi, for real this time. (added about 5 DECREFS and 2 INCREFS, + ouch!) + +2001-12-17 Federico Di Gregorio <fog@debian.org> + + * typeobj.c (psyco_DBAPITypeObject_cmp): fixed memory leak by + using PyTuple_GET_ITEM (we are sure the tuple has at least one + element, we built it, after all...) (many thanks to Scott Leerssen + for reporting the *exact line* for this one.) + +2001-12-13 Federico Di Gregorio <fog@debian.org> + + * cursor.c: fixed memory leak due to extra strdup (thanks + to Leonardo Rochael Almeida.) + +2001-11-14 Federico Di Gregorio <fog@debian.org> + + * Release 1.0. + + * doc/README: added explanation about guide work in progess but + examples working. + + * debian/*: lots of changes to release 1.0 in debian too. + +2001-11-12 Federico Di Gregorio <fog@debian.org> + + * RELEASE-1.0: added release file, to celebrate 1.0. + + * tests/zope/typecheck.zexp: regression test on types for zope. + +2001-11-11 Federico Di Gregorio <fog@debian.org> + + * ZPsycopgDA/DA.py (cast_Interval): removed typecast of interval + into zope DateTime. intervals are reported as strings when using + zope DateTime and as DateTimeDeltas when using mx. + +2001-11-09 Federico Di Gregorio <fog@debian.org> + + * typeobj.c (psyco_INTERVAL_cast): complete rewrite of the + interval parsing code. now we don't use sscanf anymore and all is + done with custom code in a very tight and fast loop. + +2001-11-08 Federico Di Gregorio <fog@debian.org> + + * ZPsycopgDA/DA.py (Connection.set_type_casts): added mx INTERVAL + type restore. + + * ZPsycopgDA/db.py (DB.query): now we return column names even if + there are no rows in the result set. also, cleaned up a little bit + the code. + +2001-11-7 Federico Di Gregorio, <fog@debian.org> + + * Makefile.pre.in: fixed small problem with zcat on True64 + (thank you stefan.) + +2001-11-06 Federico Di Gregorio <fog@debian.org> + + * ZPsycopgDA/db.py (DB.query): added fix for concurrent update + from Chris Kratz. + +2001-11-05 Federico Di Gregorio <fog@debian.org> + + * cursor.c: now we include postgres.h if InvalidOid is still + undefined after all other #includes. + + * README: clarified use of configure args related to python + versions. + + * aclocal.m4: patched to work with symlinks installations (thanks + to Stuart Bishop.) + + * cursor.c (_psyco_curs_execute): now reset the keeper's status to + the old value and not to BEGIN (solve problem with autocommit not + switching back.) + +2001-11-01 Federico Di Gregorio <fog@debian.org> + + * doc/examples/dt.py: added example on how to use the date and + time constructors. + + * Makefile.pre.in (dist-zope): removed dependencies on GNU install + and tar commands. Also a little general cleanup on various targets. + + * ZPsycopgDA/DA.py: fixed mx.DateTime importing. + +2001-10-31 Federico Di Gregorio <fog@debian.org> + + * typemod.c (psyco_xxxFromMx): fixed bug in argument parsing (we + weren't usigng the right type object.) + + * aclocal.m4: now builds OPT and LDFLAGS on the values of the env + variables instead of overwriting them. + + * Makefile.pre.in (CFLAGS): removed -Wall, you can add it back at + compile time with OPT="-Wall" ./configure ... + + * Setup.in (OPT): removed -Wall. + +2001-10-30 Michele Comitini <mcm@initd.net> + + * module.h: ANSI C compatibility patch from Daniel Plagge. + +2001-10-30 Federico Di Gregorio <fog@debian.org> + + * README: added common building problems and solutions. + + * configure.in: removed check for install command, already done by + james's aclocal.m4 for python. removed install-sh. removed -s from + INSTALLOPTS. + +2001-10-29 Federico Di Gregorio <fog@debian.org> + + * Makefile.pre.in (dist): removed examples/ directory from + distribution. + + * merge with cvs head. preparing to fork again on PSYCOPG-1-0 (i + admit BRANCH_1_0 was quite a silly name.) + + * doc/examples/usercast.py: now works. + + * connection.c (curs_rollbackall): fixed little bug (exposed by + the deadlock below) by changing KEEPER_READY to KEEPER_READY. + + * doc/examples/commit.py: deadlock problem solved, was the + example script, _not_ psycopg. pew... :) + + * examples/*: removed the examples moved to doc/examples/. + + * doc/examples/commit.py,dictfetch.py: moved from examples/ and + changed to work for 1.0. unfortunately commit.py locks psycopg!!! + +2001-10-24 Federico Di Gregorio <fog@debian.org> + + * modified all files neede for the 1.0 release. + + * configure.in (MXFLAGS): removed electric fence support. + + * Makefile.pre.in (dist): now we remove CVS working files before + packing the tarball. + + * tests: files in this directory are not coding examples, but + regression tests. we need a sufficient number of tests to follow + every single code path in psycopg at least once. first test is + about datatypes. + + * doc/examples: moved new example code to examples directory, old + tests and code samples will stay in examples/ until the manual will + be finished. + +2001-10-16 Federico Di Gregorio <fog@debian.org> + + * typeobj.c (psyco_INTERVAL_cast): completely revised interval + casting code. (psyco_TIME_cast): we use the unix epoch when the + date is undefined. + + * cursor.c (psyco_curs_executemany): modified sanity check to + accept sequences of tuples too and not just dictionaries. + +2001-10-15 Federico Di Gregorio <fog@debian.org> + + * typeobj.c (psyco_INTERVAL_cast): fixed bug caused by wrong + parsing on '1 day' (no hours, minutes and seconds.) + +2001-10-15 Michele Comitini <mcm@initd.net> + + * cursor.c (_execute): use the correct cast functions even on + retrival of binary cursors. + +2001-10-12 Federico Di Gregorio <fog@debian.org> + + * typemod.c (new_psyco_bufferobject): space not quoted anymore, + smarter formula to calculate realloc size. + + * cursor.c (psyco_curs_fetchone): removed static tuple (using + static variable in multithreaded code is *crazy*, why did i do it? + who knows...) + + * typeobj.c (psyco_init_types): exports the binary converter (will + be used in cursor.c:_execute.) + + * typeobj.h: added export of psyco_binary_cast object. + +2001-10-05 Federico Di Gregorio <fog@debian.org> + + * cursor.c (_psyco_curs_execute): added missing Py_XDECREF on + casts list. + + * Makefile.pre.in (dist): added install-sh file to the + distribution. + + * replaced PyMem_DEL with PyObject_Del where necessary. + + * connection.c (psyco_conn_destroy): added missing + pthread_mutex_destroy on keeper lock. + +2001-10-01 Michele Comitini <mcm@initd.net> + + * typemod.c(new_psyco_bufferobject()): using unsigned char for + binary objects to avoid too many chars escaped. A quick and + simple formula to avoid memory wasting and too much reallocating + for the converted object. Needs _testing_, but it is faster. + + * cursor.c: #include <postgres.h> + + * module.h: now debugging should be active only when asked by + ./configure --enable-devel + +2001-09-29 Federico Di Gregorio <fog@debian.org> + + * cursor.c (new_psyco_cursobject): added locking of connection, + still unsure if necessary. + +2001-09-26 Federico Di Gregorio <fog@debian.org> + + * configure.in: changed DEBUG into PSYCOTIC_DEBUG, to allow other + includes (postgres.h) to use the former. better compiler checks: + inline, ansi, gcc specific extensions. removed MXMODULE: we don't + need it anymore. + + * general #include cleanup, should compile on MacOS X too. + + * typeobj.c (psyco_DATE_cast): uses sscanf. should be faster too. + (psyco_TIME_cast): dixit. + + * applied patch from Daniel Plagge (SUN cc changes.) + +2001-09-22 Federico Di Gregorio <fog@debian.org> + + * ZPsycopgDA/db.py (DB._finish, DB._begin): fix for the + self.db == None problem. + +2001-09-19 Michele Comitini <mcm@initd.net> + + * typemod.c (new_psyco_bufferobject): better memory managment + (now it allocates only needed space dinamically). + + * typeobj.c (psyco_BINARY_cast): ripped a useless check, now + it assumes that binary streams come out from the db correctly + escaped. Should be a lot faster. + +2001-09-18 Federico Di Gregorio <fog@debian.org> + + * typeobj.c (psyco_INTERVAL_cast): fixed interval conversion + (hours were incorrectly converted into seconds.) + +2001-09-17 Federico Di Gregorio <fog@debian.org> + + * cursor.c (_mogrify_seq, _mogrify_dict): added check for None + value and conversion of None -> NULL (fixes bug reported by Hamish + Lawson.) + +2001-09-12 Federico Di Gregorio <fog@debian.org> + + * module.c: added handles to new date and time conversion + functions (see below.) + + * typemod.c (psyco_XXXFromMx): added conversion functions that + simply wrap the mxDateTime objects instead of creating + them. DBAPI-2.0 extension, off-curse. + +2001-09-10 Federico Di Gregorio <fog@debian.org> + + * buildtypes.py: solved hidden bug by changing from dictionary to + list, to maintain ordering of types. sometimes (and just + sometimes) the type definitions were printed unsorted, resulting + is psycopg initializing the type system using the type objects in + the wrong order. you were getting float values from an int4 + column? be happy, this is now fixed... + + * cursor.c (psyco_curs_lastoid): added method to get oid of the + last inserted row (it was sooo easy, it even works...) + +2001-09-08 Federico Di Gregorio <fog@debian.org> + + * typeobj.c (psyco_INTERVAL_cast): added casting function for the + postgres INTERVAL and TINTERVAL types (create a DateTimeDelta + object.) + +2001-09-05 Federico Di Gregorio <fog@debian.org> + + * cursor.c: moved all calls to begin_pgconn to a single call in + _psyco_curs_execute, to leave the connection in a not-idle status + after a commit or a rollback. this should free a lot of resources + on the backend side. kudos to the webware-discuss mailing list + members and to Clark C. Evans who suggested a nice solution. + + * connection.c (curs_rollbackall, curs_commitall): removed calls + to begin_pgconn, see above. + + * module.c (initpsycopg): cleaned up mxDateTime importing; we now + use the right function from mxDateTime.h. Is not necessary anymore + to include our own mx headers. This makes psycopg to depend on + mxDateTime >= 2.0.0. + +2001-09-04 Federico Di Gregorio <fog@debian.org> + + * doc/*.tex: added documentation directory and skeleton of the + psycopg guide. + +2001-09-03 Federico Di Gregorio <fog@debian.org> + + * merged in changes from HEAD (mostly mcm fixes to binary + objects.) + + * preparing for release 0.99.6. + +2001-09-03 Michele Comitini <mcm@initd.net> + + * typemod.c: much faster Binary encoding routine. + + * typeobj.c: much faster Binary decoding routine. + +2001-08-28 Michele Comitini <mcm@initd.net> + + * typemod.c: Working binary object to feed data to bytea type + fields. + + * typeobj.c: Added BINARY typecast to extract data from + bytea type fields. + + * cursor.c: Added handling for SQL binary cursors. + +2001-08-3 Michele Comitini <mcm@initd.net> + + * cursor.c: fixed DATESTYLE problem thanx to Steve Drees. + +2001-07-26 Federico Di Gregorio <fog@debian.org> + + * Makefile.pre.in: applied change suggested by Stefan H. Holek to + clobber and distclean targets. + +2001-07-23 Federico Di Gregorio <fog@debian.org> + + * ZPsycopgDA/db.py: fixed little bugs exposed by multiple select + changes, not we correctly import ListType and we don't override + the type() function with a variable. + +2001-07-17 Federico Di Gregorio <fog@debian.org> + + * configure.in: Release 0.99.5. + +2001-07-12 Federico Di Gregorio <fog@debian.org> + + * debian/* fixed some little packaging problems. + +2001-07-11 Federico Di Gregorio <fog@debian.org> + + * cursor.c, typeobj.c: removed some Py_INCREF on PyDict_SetItem + keys and values to avoid memory leaks. + +2001-07-03 Federico Di Gregorio <fog@debian.org> + + * cursor.c (_mogrify_dict): added dictionary mogrification: all + Strings in the dictionary are translated into QuotedStrings. it + even works... (_mogrify_seq): added sequence mogrification and + code to automagically mogrify all strings passed to .execute(). + +2001-07-02 Federico Di Gregorio <fog@debian.org> + + * Release 0.99.4. + + * typemod.c: added QuotedString class and methods. + + * module.c: added QuotedString method to module psycopg. + + * typemod.c: changed Binary objects into something usefull. now + the buffer object quotes the input by translatin every char into + its octal representation. this consumes 4x memory but guarantees + that even binary data containing '\0' can go into the Binary + object. + + * typemod.h: added definition of QuotedString object. + +2001-06-28 Federico Di Gregorio <fog@debian.org> + + * ZPsycopgDA/db.py, ZPsycopgDA/DABase.py: applied patch sent by + yury to fix little buglet. + +2001-06-22 Federico Di Gregorio <fog@debian.org> + + * Release 0.99.3. + + * connection.c (new_psyco_connobject): now we strdup dsn, as a fix + for the problem reported by Jack Moffitt. + + * Ok, this will be the stable branch from now on... + + * Merged in stuff from 0.99.3. About to re-branch with a better + name (BRANCH_1_0) + +2001-06-20 Federico Di Gregorio <fog@debian.org> + + * Release 0.99.3. Showstoppers for 1.0 are: + - documentation + - mxDateTime module loading + - bug reported by Yury. + + * Integrated patches from Michele: + - searching for libcrypt in configure now works + - removed memory leak in asprintf.c + +2001-06-15 Federico Di Gregorio <fog@debian.org> + + * ZPsycopgDA/__init__.py (initialize): applied patch from Jelle to + resolve problem with Zope 2.4.0a1. + +2001-06-14 Federico Di Gregorio <fog@debian.org> + + * configure.in: added code to check for missing functions (only + asprintf at now.) + + * asprintf.c: added compatibility code for oses that does not have + the asprintf() function. + +2001-06-10 Federico Di Gregorio <fog@debian.org> + + * Branched PSYCOPG_0_99_3. Development will continue on the cvs + HEAD, final adjustements and bugfixing should go to this newly + created branch. + +2001-06-08 Michele Comitini <mcm@initd.net> + + * ZPsycopgDA/DA.py: DateTime casts simplified and corrected + as suggested by Yury. + +2001-06-05 Federico Di Gregorio <fog@debian.org> + + * Release 0.99.2. + + * Makefile.pre.in (dist): added typemod.h and typemod.c to + distribution. + + * cursor.c (commit_pgconn, abort_pgconn, begin_pgconn): resolved + segfault reported by Andre by changing PyErr_SetString invokations + into pgconn_set_critical. the problem was that the python + interpreter simply segfaults when we touch its internal data (like + exception message) inside an ALLOW_THREADS wrapper. + + * now that we are 100% DBAPI-2.0 compliant is time for the + one-dot-o release (at last!) Para-pa-pa! This one is tagged + PSYCOPG_0_99_1 but you can call it 1.0pre1, if you better like. + (A very long text just to say 'Release 0.99.1') + + * typemod.[ch]: to reach complete DBAPI-2.0 compliance we + introduce some new objects returned by the constructors Date(), + Time(), Binary(), etc. Those objects are module-to-database only, + the type system still takes care of the database-to-python + conversion. + +2001-06-01 Federico Di Gregorio <fog@debian.org> + + * Release 0.5.5. + + * module.h: better error message when trying to commit on a + cursor derived from serialized connection. + + * ZPsycopgDA/db.py (DB.close): now self.cursor is set to None when + the connection is closed. + + * module.c (initpsycopg): added missing (sic) DBAPI module + parameters (paramstyle, apilevel, threadsafety, etc...) + +2001-05-24 Michele Comitini <mcm@initd.net> + + * ZPsycopgDA: Support for Zope's internal DateTime, option + to leave mxDateTime is available on the management interface so + to switch with little effort :). + + * cursor.c: more aggressive cleanup of postgres results + to avoid the risk of memory leaking. + + * typeobj.c, connection.c: deleted some Py_INCREF which + wasted memory. + +2001-05-18 Federico Di Gregorio <fog@debian.org> + + * Release 0.5.4. + +2001-05-17 Michele Comitini <mcm@initd.net> + + * ZPsycopgDA/db.py: The connection closed by the management + interface of zope now raises error instead of reopening itself. + + * cursor.c (psyco_curs_close): does not try to free the cursor + list, as it caused a segfault on subsequent operations on the same + cursor. + +2001-05-07 Federico Di Gregorio <fog@debian.org> + + * Release 0.5.3. + + * Merged in changes from me and mcm. + +2001-05-06 Michele Comitini <mcm@initd.net> + + * ZPsycopgDA/db.py (DB.close): Fixes a bug report by Andre + Shubert, which was still open since there was a tiny typo in + method definition. + + * ZPsycopgDA/DA.py (Connection.sql_quote__): overriding standard + sql_quote__ method to provide correct quoting (thank to Philip + Mayers and Casey Duncan for this bug report). + +2001-05-04 Federico Di Gregorio <fog@debian.org> + + * ZPsycopgDA/db.py: added .close() method (as suffested by Andre + Schubert.) + +2001-05-04 Michele Comitini <mcm@initd.net> + + * module.h: working on a closed object now raises an + InterfaceError. + + * ZPsycopgDA/db.py: fixed problems with dead connections detection. + + * ZPsycopgDA/__init__.py: corrected SOFTWARE_HOME bug for zope + icon. + +2001-05-04 Federico Di Gregorio <fog@debian.org> + + * examples/thread_test.py: now that the serialization bug is + fixed, it is clear that thread_test.py is bugged! added a commit() + after the creation of the first table to avoid loosing it on the + exception raised by the CREATE of an existing table_b. + +2001-05-03 Federico Di Gregorio <fog@debian.org> + + * connection.c (psyco_conn_cursor): reverted to old locking + policy, the new caused a nasty deadlock. apparently the multiple + connection problem has been solved as a side-effect of the other + fixes... (?!) + + * module.h: removes stdkeeper field from connobject, we don't need + it anymore. + + * cursor.c (dispose_pgconn): now sets self->keeper to NULL to + avoid decrementing the keeper refcnt two times when the cursor is + first closed and then destroyed. + + * connection.c (psyco_conn_cursor): fixed little bug in cursor + creation: now the connection is locked for the entire duration of + the cursor creation, to avoid a new cursor to be created with a + new keeper due to a delay in assigning the stdmanager cursor. + + * cursor.c: added calls to pgconn_set_critical() and to + EXC_IFCRITICAL() where we expect problems. Still segfaults but at + least raise an exception... + + * cursor.c (psyco_curs_autocommit): added exception if the + cursor's keeper is shared between more than 1 cursor. + + * module.h (EXC_IFCRITICAL): added this macro that call + pgconn_resolve_critical) on critical errors. + + * cursor.c (alloc_keeper): added check for pgres == NULL. + + * cursor.c (psyco_curs_destroy): merged psyco_curs_destroy() and + psyco_curs_close(): now both call _psyco_curs_close() and destroy + does only some extra cleanup. + +2001-05-03 Michele Comitini <mcm@initd.net> + + * ZPsycopgDA/db.py: Some cleanup to bring the zope product up to + date with the python module. Some bugs found thanks to Andre + Schubert. Now the ZDA should rely on the new serialized version + of psycopg. + + * cursor.c: while looking for problems in the ZDA some come out + here, with the inability to handle dropping connection correctly. + This leads to segfaults and is not fixed yet for lack of time. + Some problems found in cursors not willing to share the same + connection even if they should. Hopefully it should be fixed + soon. + +2001-04-26 Federico Di Gregorio <fog@debian.org> + + * fixed bug reported by Andre Schubert by adding a new cast + function for long integers (int8 postgresql type.) at now they are + converted to python LongIntegers: not sure f simply convert to + floats. + + * michele applied patch from Ivo van der Wijk to make zpsycopgda + behave better when INSTANCE_HOME != SOFTWARE_HOME. + + * cursor.c (_psyco_curs_execute): also fill the 'columns' field. + + * module.h: added a 'columns' field to cursobject, to better + support the new dictionary fetch functions (dictfetchone(), + dictfetchmany(), dictfetchall().) + + * cursor.c: added the afore-mentioned functions (function names + are not definitive, they will follow decisions on the DBAPI SIG.) + +2001-04-03 Federico Di Gregorio <fog@debian.org> + + * Release 0.5.1. + + * mcm fixed a nasty bug by correcting a typo in module.h. + +2001-03-30 Federico Di Gregorio <fog@debian.org> + + * module.c (psyco_connect): added `serialized' named argument to + the .connect() method (takes 1 or 0 and initialize the connection + to the right serialization state.) + + * Makefile.pre.in (dist): fixed little bug, a missing -f argument + to rm. + + * examples/thread_test.py: removed all extension cruft. + + * examples/thread_test_x.py: this one uses extensions like the + per-cursor commit, autocommit, etc. + + * README (psycopg): added explanation on how .serialize() works. + + * connection.c (psyco_conn_serialize): added cursor serialization + and .serialize() method on the connection object. now we are + definitely DBAPI-2.0 compliant. + +2001-03-20 Federico Di Gregorio <fog@debian.org> + + * cursor.c (_psyco_curs_execute): replaced some fields in + description with None, as suggested on the DB-SIG ML. + + * something like one hundred of little changes to allow cursors + share the same postgres connection. added connkeeper object and + pthread mutexes (both in connobject and connkeeper.) apparently it + works. this one will be 0.5.0, i think. + +2001-03-19 Michele Comitini <mcm@initd.net> + + * cursor.c: added mutexes, they do not interact well with python + threads :(. + +2001-03-16 Michele Comitini <mcm@initd.net> + + * ZPsycopgDA/db.py (ZDA): some fixes in table browsing. + +2001-03-16 Federico Di Gregorio <fog@debian.org> + + * suite/tables.postgresql (TABLE_DESCRIPTIONS): fixed some typos + introduced by copying by hand the type values from pg_type.h. + + * suite/*: added some (badly) structured code to test for + DBAPI-2.0 compliance. + + * cursor.c (pgconn_notice_callback): now the NOTICE processor only + prints NOTICEs when psycopg has been compiled with the + --enable-devel switch. + + * connection.c: removed 'autocommit' attribute, now is a method as + specified in the DBAPI-2.0 document. + +2001-03-15 Federico Di Gregorio <fog@debian.org> + + * connection.c (curs_commitall): splitted for cycle in two to + avoid the "bad snapshot" problem. + +2001-03-14 Federico Di Gregorio <fog@debian.org> + + * Release 0.4.6. + + * cursor.c (_psyco_curs_execute): fixed nasty bug, there was an + free(query) left from before the execute/callproc split. + + * Preparing for 0.4.6. + +2001-03-13 Federico Di Gregorio <fog@debian.org> + + * cursor.c (psyco_curs_execute): fixed some memory leaks in + argument parsing (the query string was not free()ed.) + (psyco_curs_callproc): implemented callproc() method on cursors. + (_psyco_curs_execute): this is the function that does the real + stuff for callproc() and execute(). + (pgconn_notice_*): added translation of notices into python + exceptions (do we really want that?) + + * configure.in: removed some cruft (old comments and strncasecmp() + check) + +2001-03-12 Federico Di Gregorio <fog@debian.org> + + * examples/thread_test.py: added moronic argument parsing: now you + can give the dsn string on the command line... :( + + * Release 0.4.5. + +2001-03-10 Federico Di Gregorio <fog@debian.org> + + * cursor.c (request_pgconn): added code to set datestyle to ISO on + new connections (many thanks to Yury <yura@vpcit.ru> for the code, + i changed it just a little bit to raise an exception on error.) + +2001-03-09 Federico Di Gregorio <fog@debian.org> + + * Release 0.4.4. + + * ZPsycopgDA/db.py: michele fixed a nasty bug here. + +2001-03-08 Federico Di Gregorio <fog@debian.org> + + * Release 0.4.3. + +2001-03-07 Federico Di Gregorio <fog@debian.org> + + * Makefile.pre.in (dist): typeobj_builtins.c included for people + without pg_type.h. if you encounter type-casting problems like + results cast to the wrong type, simply "rm typeobj_builtins.c" and + rebuild. + + * typeobj.c (psyco_*_cast): removed RETURNIFNULL() macro from all + the builtin casting functions. (psyco_STRING_cast) does not create + a new string anymore, simply Py_INCREF its argument and return it. + + * cursor.c (psyco_curs_fetchone): removed strdup() call. added + PQgetisnull() test to differentiate between real NULLs and empty + strings. + + * Removed cursor.py (mcm, put tests in examples) and fixed some + typos in the dtml code. + +2001-03-04 Michele Comitini <mcm@initd.net> + + * examples/commit_test.py: Modifications to test argument passing + and string substitution to cursor functions, nothing more. + + * ZPsycopgDA/db.py: now it exploits some of the good features of + the psycopg driver, such as connection reusage and type + comparison. Code is smaller although it handles (and + reports) errors much better. + + * cursor.c: corrected a bug that left a closed cursor in the + cursor list of the connection. Now cursors are removed from the + lists either when they are close or when they are destroyed. + Better connection (TCP) error reporting and handling. + + +2001-03-02 Federico Di Gregorio <fog@debian.org> + + * examples commit_test.py: added code to test autocommit. + + * examples/thread_test.py (ab_select): modified select thread to + test autocommit mode. + + * Release 0.4.1. + + * module.h, connection.c, cursor.c: added autocommit support. + +2001-02-28 Federico Di Gregorio <fog@debian.org> + + * Release 0.4. + +2001-02-27 Michele Comitini <mcm@initd.net> + + * cursor.py: cut some unuseful code in psyco_curs_fetchmany() and + psyco_curs_fetchall() inserted an assert in case someting goes + wrong. + +2001-02-27 Federico Di Gregorio <fog@debian.org> + + * debian/*: various changes to build both the python module and + the zope db adapter in different packages (respectively + python-psycopg and zope-psycopgda.) + + * examples/type_test.py: better and more modular tests. + + * typeobj.c: added DATE, TIME, DATETIME, BOOLEAN, BINARY and ROWID + types. (RETURNIFNULL) added NULL-test to builtin conversion + functions (using the RETURNIFNULL macro.) + +2001-02-26 Federico Di Gregorio <fog@debian.org> + + * releasing 0.3 (added NEWS file.) + +2001-02-26 Michele Comitini <mcm@initd.net> + + * cursor.c: fetchmany() some cleanup done. + + * ZPsycopgDA/db.py, ZPsycopgDA/__init__.py, : fixes to make the + ZDA work some way. WARNING WARNING WARNING the zda is still + alpha code, but we need some feed back on it so please give it + a try. + +2001-02-26 Federico Di Gregorio <fog@debian.org> + + * typeobj.c (psyco_STRING_cast): fixed bad bad bad bug. we + returned the string without coping it and the type-system was more + than happy to Py_DECREF() it and trash the whole system. fixed at + last! + + * module.h (Dprintf): added pid to every Dprintf() call, to + facilitate multi-threaded debug. + +2001-02-26 Michele Comitini <mcm@initd.net> + + * module.c: added code so that DateTime package need not to be + loaded to have mxDateTime. This should avoid clashing with + DateTime from the zope distribution. + + * cursor.c: setting error message in fetchmany when no more tuples + are left. This has to be fixed in fetch and fetchall to. + +2001-02-26 Federico Di Gregorio <fog@debian.org> + + * configure.in: stepped up version to 0.3, ready to release + tomorrow morning. added check for path to DateTime module. + + * examples/usercast_test.py: generate some random boxes and + points, select the boxes with at least one point inside and print + them converting the PostgeSQL output using a user-specified cast + object. nice. + +2001-02-24 Federico Di Gregorio <fog@debian.org> + + * cursor.c (psyco_curs_fetchone): now an error in the python + callback when typecasting results raise the correct exception. + + * typeobj.c (psyco_DBAPITypeObject_call): removed extra Py_INCREF(). + +2001-02-23 Federico Di Gregorio <fog@debian.org> + + * replaced every single instance of the string 'pgpy' with 'psyco' + (this was part of the general cleanup.) + + * type_test.py: added this little test program to the distribution + (use the new_type() method to create new instances of the type + objects.) + + * typeobj.c: general cleanup. fixed some bugs related to + refcounting (again!) + + * cursor.c: general cleanup. (request_pgconn) simplified by adding + a support function (_extract_pgconn.) + + * connection.c: general cleanup. replaced some ifs with asserts() + in utility functions when errors depend on programming errors and + not on runtime exceptions. (pgpy_conn_destroy) fixed little bug + when deleting available connections from the list. + + * module.h: general cleanup. + + * typeobj.h: general cleanup, better comments, made some function + declarations extern. + + * module.c: general cleanup, double-checked every function for + memory leaks. (pgpy_connect) removed unused variable 'connection'. + +2001-02-22 Federico Di Gregorio <fog@debian.org> + + * typeobj.c: fixed lots of bugs, added NUMBER type object. now the + basic tests in type_test.py work pretty well. + + * cursor.c (pgpy_curs_fetchmany): fixed little bug, fetchmany() + reported one less row than available. + + * fixed lots of bugs in typeobj.c, typeobj.h, cursor.c. apparently + now the type system works. it is time to clean up things a little + bit. + +2001-02-21 Federico Di Gregorio <fog@debian.org> + + * typeobj.c: separated type objects stuff from module.c + + * typeobj.h: separated type objects stuff from module.h + +2001-02-19 Federico Di Gregorio <fog@debian.org> + + * cursor.c (pgpy_curs_fetchmany): now check size and adjust it to + be lesser or equal than the nuber of available rows. + +2001-02-18 Michele Comitini <mcm@initd.net> + + * module.c, module.h: added optional args maxconn and minconn to + connection functions + + * cursor.c: better error checking in request_pgconn. + + * connection.c: changed new_connect_obj to take as optional args + maxconn and minconn. Added the corresponding ro attributes to + connection objects. + + * cursor.py: added some code to stress test cursor reusage. + + * cursor.c: some fixes on closed cursors. + + * connection.c: corrections on some assert calls. + +2001-02-16 Federico Di Gregorio <fog@debian.org> + + * configure.in: added --enable-priofile sqitch. changed VERSION to + 0.2: preparing for a new release. + + * cursor.c: added a couple of asserts. + +2001-02-16 Michele Comitini <mcm@initd.net> + + * cursor.c, connection.c: fixed the assert problem: assert must + take just the value to be tested! no assignemente must be done in + the argument of assert() otherwise is wiped when NDEBUG is set. + + * module.h: some syntax error fixed. Error in allocating a tuple + corrected in macro DBAPITypeObject_NEW(). + + * module.c: pgpy_DBAPITypeObject_init() is not declared static anymore. + + * cursor.c: executemany() now does not create and destroy tuples + for each list item, so it is much faster. + +2001-02-14 Michele Comitini <mcm@initd.net> + + * cursor.c: added again Py_DECREF on the cpcon after disposing + it. assert() with -DNDEBUG makes the driver segfault while it + should not. + + +2001-02-13 Federico Di Gregorio <fog@debian.org> + + * some of the memory leak were memprof errors, bleah. resumed some + old code, fixed segfault, fixed other bugs, improved speed. almost + ready for a new release. + + * connection.c (pgpy_conn_destroy): replaced some impossible ifs + with aseert()s. + + * cursor.c (pgpy_curs_close): added Py_DECREF() to + self->descritpion to prevent a memory leak after an execute(). + + * connection.c (pgpy_conn_destroy): always access first element of + lists inside for cycles because removing items from the list makes + higher indices invalid. + + * cursor.c (dispose_pgconn): fixed memory leak, there was a + missing Py_DECREF() after the addition of the C object wrapping + the postgresql connection to the list of available connections. + + * cursor.c (dispose_pgconn): fixed another memory leak: an + orphaned cursor should call PQfinish() on its postgresql + connection because it has no python connection to give the + postgresql ine back. + + * cursor.c (pgpy_curs_execute): added Py_DECREF() of description + tuple after adding it to self->description. this one fixes the + execute() memory leak. + + * cursor.c (pgpy_curs_fetchall): added missing Py_DECREF() on row + data (obtained from fetchone().) this fixes the last memory leak. + (thread_test.py now runs without leaking memory!) + +2001-02-12 Federico Di Gregorio <fog@debian.org> + + * INSTALL: removed wok cruft from head of this file. + + * debian/rules: debianized the sources. python-psycopg is about to + enter debian. mxDateTime header locally included until the + maintainer of python-mxdatetime includes them in his package + (where they do belong.) + + * autogen.sh: added option --dont-run-configure. + +2001-02-09 Federico Di Gregorio <fog@debian.org> + + * module.c (initpsycopg): changed name of init function to match + new module name (also changed all the exception definitions.) + + * README: updated psycopg description (we have a new name!) + + * Ready for 0.1 release. + +2001-02-07 Michele Comitini <mcm@initd.net> + + * cursor.c: now executemany takes sequences and not just + tuples + +2001-02-07 Federico Di Gregorio <fog@debian.org> + + * Makefile.pre.in: now dist target includes test programs + (thread_test.py) and README and INSTALL files. + + * configure.in: changed --with-devel to --enable-devel. little + cosmetical fixes to the option management. + + * connection.c, module.c, cursor.c, module.h: removed 'postgres/' + from #include directive. it is ./configure task to find the right + directory. + + * thread_test.py: added thread testing program. + +2001-02-07 Michele Comitini <mcm@initd.net> + + * cursor.c: added code to allow threads during PQexec() calls. + + * cursor.c: added begin_pgconn to rollback() and commit() + so that the cursror is not in autocommit mode. + + * cursor.c: added rollback() and commit() methods to cursor + objects. + + +2001-02-07 Federico Di Gregorio <fog@debian.org> + + * connection.c (pgpy_conn_destroy): always delete item at index + 0 and not i (because items shift in the list while deleting and + accessing items at len(list)/2 segfaults.) + +2001-02-07 Michele Comitini <mcm@initd.net> + + * connection.c: added some more checking to avoid + clearing of already cleared pgresults. Calling curs_closall() + in conn_destroy() since cursors have to live even without + their parent connection, otherwise explicit deletion of + object referencing to those cursors can cause arbitrary code + to be executed. + + * cursor.c: some more checking to avoid trying to close + already close pgconnections. + +2001-02-06 Federico Di Gregorio <fog@debian.org> + + * Makefile.pre.in (CFLAGS): added -Wall to catch bad programming + habits. + + * cursor.c, connection.c: lots of fixes to the destroy stuff. now + all the cursor are destroyed *before* the connection goes away. + + * cursor.c (request_pgconn): another idiot error done by not + replacing dsn with owner_conn->dsn. fixed. + (dispose_pgconn): commented if to guarantee that the connection is + returned to the pool of available connections. + + * merged changes done by mcm. + + * cursor.c: general cleanup and better debugging/error + messages. changed xxx_conn into xxx_pgconn where still + missing. some pretty big changes to the way pgconn_request() + allocates new connections. + + * connection.c: removed all 'register' integers. obsolete, gcc + does a much better job optimizing cycles than a programmer + specifying how to use registers. + + * module.h: some general cleanup and better definition of DPrintf + macro. now the DEBUG variable can be specified at configure time by + the --with-devel switch to ./configure. + +2001-02-02 Michele Comitini <mcm@initd.net> + + * cursor.c (Repository): Added functions for managing a connection + pool. Segfaults. + + * configure.in (Repository): removed check for mxdatetime headers. + +2001-01-24 Federico Di Gregorio <fog@debian.org> + + * first checkout from shinning new init.d cvs. + + * autotoolized build system. note that the mx headers are missing + from the cvs, you should get them someplace else (this is the + right way to do it, just require the headers in the configure + script.) + +2001-01-21 Michele Comitini <mcm@initd.net> + + * cursor.c (Repository): commit, abort, begin functions now check + the right exit status of the command. + + * connection.c (Repository): working commit() and rollback() + methods. + +2001-01-20 Michele Comitini <mcm@initd.net> + + * module.h (Repository): added member to cursor struct to handle + queries without output tuples. + + * cursor.c (Repository): new working methods: executemany, + fetchone, fetchmany, fetchall. + +2001-01-18 Michele Comitini <mcm@initd.net> + + * cursor.c (Repository): close working. destroy calling close. + close frees pg structures correctly. + + * connection.c (Repository): close method working. destroy seems + working. + +2001-01-17 Michele Comitini <mcm@initd.net> + + * cursor.c (Repository): now each python cursor has its own + connection. Each cursor works in a transaction block. + + * connection.c (Repository): added cursor list to connection + object + +2001-01-14 Michele Comitini <mcm@initd.net> + + * cursor.c (Repository): Beginning of code to implement cursor + functionalities as specified in DBA API 2.0, through the use of + transactions not cursors. + + * connection.c (Repository): Added some error checking code for pg + connection (will be moved to cursor?). + +2001-01-13 Michele Comitini <mcm@initd.net> + + * connection.c (Repository): Added error checking in connection + code to fail if connection to the db could not be opened. + + * module.h (Repository): New macro to help creating + DBAPITypeObjects. + + * module.c (Repository): DBAPITypeObject __cmp__ function is now + very simplified using recursion. + + * module.h (Repository): "DBAPIObject" changed to + "DBAPITypeObject". + + * module.c (Repository): Fixes for coerce function of DBAPIObjects + by Federico Di Gregorio <fog@initd.net>. + (Repository): Clean up and better naming for DBAPITypeObjects. + +2001-01-08 Michele Comitini <mcm@initd.net> + + * module.c (Repository): Corrected the exception hierarcy + + * connection.c (Repository): Begun to use the connection objects + of libpq + +2001-01-07 Michele Comitini <mcm@initd.net> + + * module.c (Repository): Added the Date/Time functions. + +2001-01-06 Michele Comitini <mcm@initd.net> + + * cursor.c (Repository): Skeleton of cursor interface. All + methods and attributes of cursor objects are now available + in python. They do nothing now. + +2001-01-05 Michele Comitini <mcm@initd.net> + + * module.c (Repository): Test version; module loaded with + exception defined. + +2001-01-05 Michele Comitini <mcm@initd.net> + + * Setup.in (Repository): Setup file. + + * Makefile.pre.in (Repository): from the python source. + +2001-01-05 Michele Comitini <mcm@initd.net> + + * module.c: Written some code for defining exceptions. + + * module.h: Static variable for exceptions. + +2001-01-04 Michele Comitini <mcm@initd.net> + + * Changelog: pre-release just a few prototypes to get started. + + diff --git a/psycopg2/doc/HACKING b/psycopg2/doc/HACKING new file mode 100644 index 00000000..f60474ce --- /dev/null +++ b/psycopg2/doc/HACKING @@ -0,0 +1,43 @@ +General information +******************* + +Some help to people wanting to hack on psycopg. First of all, note that +*every* function in the psycopg module source code is prefixed by one of the +following words: + + psyco is used for function directly callable from python (i.e., functions + in the psycopg module itself.) the only notable exception is the + source code for the module itself, that uses "psyco" even for C-only + functions. + + conn is used for functions related to connection objects. + + curs is used for functions related to cursor objects. + + typecast is used for typecasters and utility function related to + typecaster creation and registration. + +Pythonic definition of types and functions available from python are defined +in *_type.c files. Internal functions, callable only from C are located in +*_int.c files and extensions to the DBAPI can be found in the *_ext.c files. + + +Patches +******* + +If you submit a patch, please send a diff generated with the "-u" switch. +Also note that I don't like that much cosmetic changes (like renaming +already existing variables) and I will rewrap the patch to 78 columns +anyway, so it is much better if you do that beforehand. + + +The type system +*************** + +Simple types, like integers and strings, are converted to python base types +(the conversion functions are in typecast_base.c). Complex types are +converted to ad-hoc types, defined in the typeobj_*.{c,h} files. The +conversion function are in the other typecast_*.c files. typecast.c defines +the basic utility functions (available through the psycopg module) used when +defining new typecasters from C and python. + diff --git a/psycopg2/doc/SUCCESS b/psycopg2/doc/SUCCESS new file mode 100644 index 00000000..9ae91f58 --- /dev/null +++ b/psycopg2/doc/SUCCESS @@ -0,0 +1,114 @@ +From: Jack Moffitt <jack@xiph.org> +To: Psycopg Mailing List <psycopg@lists.initd.org> +Subject: Re: [Psycopg] preparing for 1.0 +Date: 22 Oct 2001 11:16:21 -0600 + +www.vorbis.com is serving from 5-10k pages per day with psycopg serving +data for most of that. + +I plan to use it for several of our other sites, so that number will +increase. + +I've never had a single problem (that wasn't my fault) besides those +segfaults, and those are now gone as well, and I've been using psycopg +since June (around 0.99.2?). + +jack. + + +From: Yury Don <gercon@vpcit.ru> +To: Psycopg Mailing List <psycopg@lists.initd.org> +Subject: Re: [Psycopg] preparing for 1.0 +Date: 23 Oct 2001 09:53:11 +0600 + +We use psycopg and psycopg zope adapter since fisrt public +release (it seems version 0.4). Now it works on 3 our sites and in intranet +applications. We had few problems, but all problems were quckly +solved. The strong side of psycopg is that it's code is well organized +and easy to understand. When I found a problem with non-ISO datestyle in first +version of psycopg, it took for me 15 or 20 minutes to learn code and +to solve the problem, even thouth my knowledge of c were poor. + +BTW, segfault with dictfetchall on particular data set (see [Psycopg] +dictfetchXXX() problems) disappeared in 0.99.8pre2. + +-- +Best regards, +Yury Don + + +From: Tom Jenkins <tjenkins@devis.com> +To: Federico Di Gregorio <fog@debian.org> +Cc: Psycopg Mailing List <psycopg@lists.initd.org> +Subject: Re: [Psycopg] preparing for 1.0 +Date: 23 Oct 2001 08:25:52 -0400 + +The US Govt Department of Labor's Office of Disability Employment +Policy's DisabilityDirect website is run on zope and zpsycopg. + + +From: Scott Leerssen <sleerssen@racemi.com> +To: Federico Di Gregorio <fog@debian.org> +Subject: Re: [Psycopg] preparing for 1.0 +Date: 23 Oct 2001 09:56:10 -0400 + +Racemi's load management software infrastructure uses psycopg to handle +complex server allocation decisions, plus storage and access of +environmental conditions and accounting records for potentially +thousands of servers. Psycopg has, to this point, been the only +Python/PostGreSQL interface that could handle the scaling required for +our multithreaded applications. + +Scott + + +From: Andre Schubert <andre.schubert@geyer.kabeljournal.de> +To: Federico Di Gregorio <fog@debian.org> +Cc: Psycopg Mailing List <psycopg@lists.initd.org> +Subject: Re: [Psycopg] preparing for 1.0 +Date: 23 Oct 2001 11:46:07 +0200 + +i have changed the psycopg version to 0.99.8pre2 on all devel-machines +and all segfaults are gone. after my holiday i wil change to 0.99.8pre2 +or 1.0 on our production-server. +this server contains several web-sites which are all connected to +postgres over ZPsycopgDA. + +thanks as + + +From: Fred Wilson Horch <fhorch@ecoaccess.org> +To: <psycopg@lists.initd.org> +Subject: [Psycopg] Success story for psycopg +Date: 23 Oct 2001 10:59:17 -0400 + +Due to various quirks of PyGreSQL and PoPy, EcoAccess has been looking for +a reliable, fast and relatively bug-free Python-PostgreSQL interface for +our project. + +Binary support in psycopg, along with the umlimited tuple size in +PostgreSQL 7.1, allowed us to quickly prototype a database-backed file +storage web application, which we're using for file sharing among our +staff and volunteers. Using a database backend instead of a file system +allows us to easily enrich the meta-information associated with each file +and simplifies our data handling routines. + +We've been impressed by the responsiveness of the psycopg team to bug +reports and feature requests, and we're looking forward to using psycopg +as the Python interface for additional database-backed web applications. + +Keep up the good work! +-- +Fred Wilson Horch mailto:fhorch@ecoaccess.org +Executive Director, EcoAccess http://ecoaccess.org/ + + +From: Damon Fasching <fasching@design.lbl.gov> +To: Michele Comitini <mcm@glisco.it> +Cc: fog@debian.org +Subject: Re: How does one create a database within Python using psycopg? +Date: 25 Feb 2002 17:39:41 -0800 + +[snip] +btw I checked out 4 different Python-PostgreSQL packages. psycopg is the +only one which built and imported w/o any trouble! (At least for me.) diff --git a/psycopg2/doc/TODO b/psycopg2/doc/TODO new file mode 100644 index 00000000..b20b2769 --- /dev/null +++ b/psycopg2/doc/TODO @@ -0,0 +1,33 @@ +TODO list for psycopg 2 or later +******************************** + +Move items to the DONE section only after writing a test for the +implementation. Also add a note on how the item was resolved. +(Obviously I was joking about the test..) + +* Find a better way to compile the type-casting code instead of including it + in typecast.c directy. (Including is not that bad, but the need to touch + psycopg/typecast.c every time is bad bad bad.) + +* executemany() should _not_ take the async flag, remove it and force multiple + queries to be synchronous. + +* Fix all the docstrings. + +* Support the protocols API fully. + +* Unify the common code in typecast_datetime.c and typecast_mxdatetime.c. + +* Port typecasters to new-style classes. + +* Write a complete postgresql<->python encodings table. + +* Implement binary typecasters (should be easy, but it will take time.) + +DONE +==== + +* Convert type-casters to new-style types in Python 2.2+. + +* callproc() never worked, fix it or remove it and raise right exception. + [Removed callproc code, now an exception is raised.] diff --git a/psycopg2/doc/api-screen.css b/psycopg2/doc/api-screen.css new file mode 100644 index 00000000..22e8f7ed --- /dev/null +++ b/psycopg2/doc/api-screen.css @@ -0,0 +1,138 @@ +/* Based on the Epydoc "default.css" +** with some missing reST-related classes +** and Python syntax support (from SilverCity) +*/ + +/* Body color */ +body { background: #ffffff; color: #000000; } + +/* Tables */ +table.summary, table.details, table.index + { background: #e8f0f8; color: #000000; } +tr.summary, tr.details, tr.index + { background: #70b0f0; color: #000000; + text-align: left; font-size: 120%; } +tr.group { background: #c0e0f8; color: #000000; + text-align: left; font-size: 120%; + font-style: italic; } + +/* Documentation page titles */ +h2.module { margin-top: 0.2em; } +h2.class { margin-top: 0.2em; } + +/* Headings */ +h1.heading { font-size: +140%; font-style: italic; + font-weight: bold; } +h2.heading { font-size: +125%; font-style: italic; + font-weight: bold; } +h3.heading { font-size: +110%; font-style: italic; + font-weight: normal; } + +/* Base tree */ +pre.base-tree { font-size: 80%; margin: 0; } + +/* TOC */ +p.toc { margin: 0; } + +/* Details Sections */ +table.func-details { background: #e8f0f8; color: #000000; + border: 2px groove #c0d0d0; + padding: 0 1em 0 1em; margin: 0.4em 0 0 0; } +h3.func-detail { background: transparent; color: #000000; + margin: 0 0 1em 0; } + +table.var-details { background: #e8f0f8; color: #000000; + border: 2px groove #c0d0d0; + padding: 0 1em 0 1em; margin: 0.4em 0 0 0; } +h3.var-details { background: transparent; color: #000000; + margin: 0 0 1em 0; } + +/* Function signatures */ +.sig { background: transparent; color: #000000; + font-weight: bold; } +.sig-name { background: transparent; color: #006080; } +.sig-arg, .sig-kwarg, .sig-vararg + { background: transparent; color: #008060; } +.sig-default { background: transparent; color: #602000; } +.summary-sig { background: transparent; color: #000000; } +.summary-sig-name { background: transparent; color: #204080; } +.summary-sig-arg, .summary-sig-kwarg, .summary-sig-vararg + { background: transparent; color: #008060; } + +/* Doctest blocks */ +.py-src { background: transparent; color: #000000; } +.py-prompt { background: transparent; color: #005050; + font-weight: bold;} +.py-string { background: transparent; color: #006030; } +.py-comment { background: transparent; color: #003060; } +.py-keyword { background: transparent; color: #600000; } +.py-output { background: transparent; color: #404040; } +div.code-block, +pre.literal-block, +pre.doctestblock { background: #f4faff; color: #000000; + padding: .5em; margin: 1em; + border: 1px solid #708890; } +table pre.doctestblock + { background: #dce4ec; color: #000000; + padding: .5em; margin: 1em; + border: 1px solid #708890; } +div.code-block { font-family: monospace; } + +/* Variable values */ +pre.variable { background: #dce4ec; color: #000000; + padding: .5em; margin: 0; + border: 1px solid #708890; } +.variable-linewrap { background: transparent; color: #604000; } +.variable-ellipsis { background: transparent; color: #604000; } +.variable-quote { background: transparent; color: #604000; } +.re { background: transparent; color: #000000; } +.re-char { background: transparent; color: #006030; } +.re-op { background: transparent; color: #600000; } +.re-group { background: transparent; color: #003060; } +.re-ref { background: transparent; color: #404040; } + +/* Navigation bar */ +table.navbar { background: #a0c0ff; color: #0000ff; + border: 2px groove #c0d0d0; } +th.navbar { background: #a0c0ff; color: #0000ff; } +th.navselect { background: #70b0ff; color: #000000; } +.nomargin { margin: 0; } + +/* Links */ +a:link { background: transparent; color: #0000ff; } +a:visited { background: transparent; color: #204080; } +a.navbar:link { background: transparent; color: #0000ff; + text-decoration: none; } +a.navbar:visited { background: transparent; color: #204080; + text-decoration: none; } + +/* Admonitions */ +div.warning, +div.note { background-color: #c0e0f8; + border: thin solid black; + padding: 1em; + margin-left: 1em; + margin-right: 1em; } +div.warning .first, +div.note .first { font-family: sans-serif; + font-size: 110%; + margin-right: 0.5em; } + +/* Lists */ +ul { margin-top: 0; } + +/* Python syntax */ +.p_character { color: olive; } +.p_classname { color: blue; font-weight: bold; } +.p_commentblock {color: gray; font-style: italic; } +.p_commentline { color: green; font-style: italic; } +.p_default {} +.p_defname { color: #009999; font-weight: bold; } +.p_identifier { color: black; } +.p_number { color: #009999; } +.p_operator { color: black; } +.p_string { color: #7F007F; } +.p_stringeol { color: #7F007F; } +.p_triple { color: #7F0000; } +.p_tripledouble { color: #7F0000; } +.p_word { color: navy; font-weight: bold; } diff --git a/psycopg2/doc/api/epydoc.css b/psycopg2/doc/api/epydoc.css new file mode 100644 index 00000000..22e8f7ed --- /dev/null +++ b/psycopg2/doc/api/epydoc.css @@ -0,0 +1,138 @@ +/* Based on the Epydoc "default.css" +** with some missing reST-related classes +** and Python syntax support (from SilverCity) +*/ + +/* Body color */ +body { background: #ffffff; color: #000000; } + +/* Tables */ +table.summary, table.details, table.index + { background: #e8f0f8; color: #000000; } +tr.summary, tr.details, tr.index + { background: #70b0f0; color: #000000; + text-align: left; font-size: 120%; } +tr.group { background: #c0e0f8; color: #000000; + text-align: left; font-size: 120%; + font-style: italic; } + +/* Documentation page titles */ +h2.module { margin-top: 0.2em; } +h2.class { margin-top: 0.2em; } + +/* Headings */ +h1.heading { font-size: +140%; font-style: italic; + font-weight: bold; } +h2.heading { font-size: +125%; font-style: italic; + font-weight: bold; } +h3.heading { font-size: +110%; font-style: italic; + font-weight: normal; } + +/* Base tree */ +pre.base-tree { font-size: 80%; margin: 0; } + +/* TOC */ +p.toc { margin: 0; } + +/* Details Sections */ +table.func-details { background: #e8f0f8; color: #000000; + border: 2px groove #c0d0d0; + padding: 0 1em 0 1em; margin: 0.4em 0 0 0; } +h3.func-detail { background: transparent; color: #000000; + margin: 0 0 1em 0; } + +table.var-details { background: #e8f0f8; color: #000000; + border: 2px groove #c0d0d0; + padding: 0 1em 0 1em; margin: 0.4em 0 0 0; } +h3.var-details { background: transparent; color: #000000; + margin: 0 0 1em 0; } + +/* Function signatures */ +.sig { background: transparent; color: #000000; + font-weight: bold; } +.sig-name { background: transparent; color: #006080; } +.sig-arg, .sig-kwarg, .sig-vararg + { background: transparent; color: #008060; } +.sig-default { background: transparent; color: #602000; } +.summary-sig { background: transparent; color: #000000; } +.summary-sig-name { background: transparent; color: #204080; } +.summary-sig-arg, .summary-sig-kwarg, .summary-sig-vararg + { background: transparent; color: #008060; } + +/* Doctest blocks */ +.py-src { background: transparent; color: #000000; } +.py-prompt { background: transparent; color: #005050; + font-weight: bold;} +.py-string { background: transparent; color: #006030; } +.py-comment { background: transparent; color: #003060; } +.py-keyword { background: transparent; color: #600000; } +.py-output { background: transparent; color: #404040; } +div.code-block, +pre.literal-block, +pre.doctestblock { background: #f4faff; color: #000000; + padding: .5em; margin: 1em; + border: 1px solid #708890; } +table pre.doctestblock + { background: #dce4ec; color: #000000; + padding: .5em; margin: 1em; + border: 1px solid #708890; } +div.code-block { font-family: monospace; } + +/* Variable values */ +pre.variable { background: #dce4ec; color: #000000; + padding: .5em; margin: 0; + border: 1px solid #708890; } +.variable-linewrap { background: transparent; color: #604000; } +.variable-ellipsis { background: transparent; color: #604000; } +.variable-quote { background: transparent; color: #604000; } +.re { background: transparent; color: #000000; } +.re-char { background: transparent; color: #006030; } +.re-op { background: transparent; color: #600000; } +.re-group { background: transparent; color: #003060; } +.re-ref { background: transparent; color: #404040; } + +/* Navigation bar */ +table.navbar { background: #a0c0ff; color: #0000ff; + border: 2px groove #c0d0d0; } +th.navbar { background: #a0c0ff; color: #0000ff; } +th.navselect { background: #70b0ff; color: #000000; } +.nomargin { margin: 0; } + +/* Links */ +a:link { background: transparent; color: #0000ff; } +a:visited { background: transparent; color: #204080; } +a.navbar:link { background: transparent; color: #0000ff; + text-decoration: none; } +a.navbar:visited { background: transparent; color: #204080; + text-decoration: none; } + +/* Admonitions */ +div.warning, +div.note { background-color: #c0e0f8; + border: thin solid black; + padding: 1em; + margin-left: 1em; + margin-right: 1em; } +div.warning .first, +div.note .first { font-family: sans-serif; + font-size: 110%; + margin-right: 0.5em; } + +/* Lists */ +ul { margin-top: 0; } + +/* Python syntax */ +.p_character { color: olive; } +.p_classname { color: blue; font-weight: bold; } +.p_commentblock {color: gray; font-style: italic; } +.p_commentline { color: green; font-style: italic; } +.p_default {} +.p_defname { color: #009999; font-weight: bold; } +.p_identifier { color: black; } +.p_number { color: #009999; } +.p_operator { color: black; } +.p_string { color: #7F007F; } +.p_stringeol { color: #7F007F; } +.p_triple { color: #7F0000; } +.p_tripledouble { color: #7F0000; } +.p_word { color: navy; font-weight: bold; } diff --git a/psycopg2/doc/api/index.html b/psycopg2/doc/api/index.html new file mode 100644 index 00000000..419bbcf5 --- /dev/null +++ b/psycopg2/doc/api/index.html @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" + "DTD/xhtml1-frameset.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title> API Documentation </title> +</head> +<frameset cols="20%,80%"> + <frameset rows="30%,70%"> + <frame src="public/toc.html" name="moduleListFrame" id="moduleListFrame" /> + <frame src="public/toc-everything.html" name="moduleFrame" id="moduleFrame" /> + </frameset> + <frame src="public/psycopg2-module.html" name="mainFrame" id="mainFrame" /> +</frameset> +</html> diff --git a/psycopg2/doc/api/private/__builtin__.list-class.html b/psycopg2/doc/api/private/__builtin__.list-class.html new file mode 100644 index 00000000..c8217a7a --- /dev/null +++ b/psycopg2/doc/api/private/__builtin__.list-class.html @@ -0,0 +1,817 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>__builtin__.list</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + Module __builtin__ :: + Class list + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[show private | <a href="../public/__builtin__.list-class.html">hide private</a>]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="__builtin__.list-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Type list</h2> + +<pre class="base-tree"> +<a href="__builtin__.object-class.html"><code>object</code></a> --+ + | + <strong class="uidshort">list</strong> +</pre><br /> + +<dl><dt>Known Subclasses:</dt> +<dd> + <a href="psycopg2.extras.DictRow-class.html"><code>DictRow</code></a></dd></dl> + +<hr/> + +<p>list() -> new list +list(sequence) -> new list initialized from sequence's items</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__init__(...) initializes x; see x.__class__.__doc__ for signature</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__add__"></a><span class="summary-sig"><span class="summary-sig-name">__add__</span>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return x+y...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__contains__"></a><span class="summary-sig"><span class="summary-sig-name">__contains__</span>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return y in x...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__delitem__"></a><span class="summary-sig"><span class="summary-sig-name">__delitem__</span>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return del x[y]...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__delslice__" class="summary-sig-name"><code>__delslice__</code></a>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">i</span>, + <span class="summary-sig-arg">j</span>)</span></code> +<br /> +Use of negative indices is not supported.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__eq__"></a><span class="summary-sig"><span class="summary-sig-name">__eq__</span>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return x==y...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__ge__"></a><span class="summary-sig"><span class="summary-sig-name">__ge__</span>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return x>=y...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__getattribute__('name') <==> x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__getitem__"></a><span class="summary-sig"><span class="summary-sig-name">__getitem__</span>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return x[y]...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__getslice__" class="summary-sig-name"><code>__getslice__</code></a>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">i</span>, + <span class="summary-sig-arg">j</span>)</span></code> +<br /> +Use of negative indices is not supported.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__gt__"></a><span class="summary-sig"><span class="summary-sig-name">__gt__</span>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return x>y...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__hash__"></a><span class="summary-sig"><span class="summary-sig-name">__hash__</span>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return hash(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__iadd__"></a><span class="summary-sig"><span class="summary-sig-name">__iadd__</span>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return x+=y...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__imul__"></a><span class="summary-sig"><span class="summary-sig-name">__imul__</span>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return x*=y...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__iter__"></a><span class="summary-sig"><span class="summary-sig-name">__iter__</span>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return iter(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__le__"></a><span class="summary-sig"><span class="summary-sig-name">__le__</span>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return x<=y...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__len__"></a><span class="summary-sig"><span class="summary-sig-name">__len__</span>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return len(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__lt__"></a><span class="summary-sig"><span class="summary-sig-name">__lt__</span>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return x<y...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__mul__"></a><span class="summary-sig"><span class="summary-sig-name">__mul__</span>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">n</span>)</span></code> +<br /> +Return x*n...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__ne__"></a><span class="summary-sig"><span class="summary-sig-name">__ne__</span>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return x!=y...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__new__"></a><span class="summary-sig"><span class="summary-sig-name">__new__</span>(<span class="summary-sig-arg">T</span>, + <span class="summary-sig-arg">S</span>, + <span class="summary-sig-vararg">...</span>)</span></code> +<br /> +Return a new object with type S, a subtype of T...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__repr__"></a><span class="summary-sig"><span class="summary-sig-name">__repr__</span>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return repr(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__rmul__"></a><span class="summary-sig"><span class="summary-sig-name">__rmul__</span>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">n</span>)</span></code> +<br /> +Return n*x...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__setitem__"></a><span class="summary-sig"><span class="summary-sig-name">__setitem__</span>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">i</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return x[i]=y...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__setslice__" class="summary-sig-name"><code>__setslice__</code></a>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">i</span>, + <span class="summary-sig-arg">j</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Use of negative indices is not supported.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#append" class="summary-sig-name"><code>append</code></a>(<span class="summary-sig-arg">L</span>, + <span class="summary-sig-arg">object</span>)</span></code> +<br /> +append object to end</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#count" class="summary-sig-name"><code>count</code></a>(<span class="summary-sig-arg">L</span>, + <span class="summary-sig-arg">value</span>)</span></code> +<br /> +return number of occurrences of value</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#extend" class="summary-sig-name"><code>extend</code></a>(<span class="summary-sig-arg">L</span>, + <span class="summary-sig-arg">iterable</span>)</span></code> +<br /> +extend list by appending elements from the iterable</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#index" class="summary-sig-name"><code>index</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +L.index(value, [start, [stop]]) -> integer -- return first index of value</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#insert" class="summary-sig-name"><code>insert</code></a>(<span class="summary-sig-arg">L</span>, + <span class="summary-sig-arg">index</span>, + <span class="summary-sig-arg">object</span>)</span></code> +<br /> +insert object before index</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#pop" class="summary-sig-name"><code>pop</code></a>(<span class="summary-sig-arg">L</span>, + <span class="summary-sig-arg">index</span>)</span></code> +<br /> +remove and return item at index (default last)</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#remove" class="summary-sig-name"><code>remove</code></a>(<span class="summary-sig-arg">L</span>, + <span class="summary-sig-arg">value</span>)</span></code> +<br /> +remove first occurrence of value</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#reverse" class="summary-sig-name"><code>reverse</code></a>(<span class="summary-sig-arg">L</span>)</span></code> +<br /> +reverse <em>IN PLACE</em></td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#sort" class="summary-sig-name"><code>sort</code></a>(<span class="summary-sig-arg">L</span>, + <span class="summary-sig-arg">cmpfunc</span>)</span></code> +<br /> +stable sort <em>IN PLACE</em>; cmpfunc(x, y) -> -1, 0, 1</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from object</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__delattr__('name') <==> del x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__setattr__('name', value) <==> x.name = value</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return str(x)...</td></tr> +</table><br /> + + +<!-- =========== START OF METHOD DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Method Details</th></tr> +</table> + +<a name="__init__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-vararg">...</span>)</span> + <br /><em class="fname">(Constructor)</em> + </h3> +<p>x.__init__(...) initializes x; see x.__class__.__doc__ for signature</p> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__init__"><code>__builtin__.object.__init__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__add__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__add__</span>(<span class="sig-arg">x</span>, + <span class="sig-arg">y</span>)</span> + <br /><em class="fname">(Addition operator)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +x+y +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__contains__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__contains__</span>(<span class="sig-arg">x</span>, + <span class="sig-arg">y</span>)</span> + <br /><em class="fname">(In operator)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +y in x +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__delitem__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__delitem__</span>(<span class="sig-arg">x</span>, + <span class="sig-arg">y</span>)</span> + <br /><em class="fname">(Index deletion operator)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +del x[y] +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__delslice__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__delslice__</span>(<span class="sig-arg">x</span>, + <span class="sig-arg">i</span>, + <span class="sig-arg">j</span>)</span> + <br /><em class="fname">(Slice deletion operator)</em> + </h3> +<p>Use of negative indices is not supported.</p> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +del x[i:j] +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__eq__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__eq__</span>(<span class="sig-arg">x</span>, + <span class="sig-arg">y</span>)</span> + <br /><em class="fname">(Equality operator)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +x==y +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__ge__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__ge__</span>(<span class="sig-arg">x</span>, + <span class="sig-arg">y</span>)</span> + <br /><em class="fname">(Greater-than-or-equals operator)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +x>=y +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__getattribute__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__getattribute__</span>(<span class="sig-vararg">...</span>)</span> + </h3> +<p>x.__getattribute__('name') <==> x.name</p> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__getattribute__"><code>__builtin__.object.__getattribute__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__getitem__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__getitem__</span>(<span class="sig-arg">x</span>, + <span class="sig-arg">y</span>)</span> + <br /><em class="fname">(Indexing operator)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +x[y] +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__getslice__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__getslice__</span>(<span class="sig-arg">x</span>, + <span class="sig-arg">i</span>, + <span class="sig-arg">j</span>)</span> + <br /><em class="fname">(Slicling operator)</em> + </h3> +<p>Use of negative indices is not supported.</p> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +x[i:j] +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__gt__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__gt__</span>(<span class="sig-arg">x</span>, + <span class="sig-arg">y</span>)</span> + <br /><em class="fname">(Greater-than operator)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +x>y +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__hash__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__hash__</span>(<span class="sig-arg">x</span>)</span> + <br /><em class="fname">(Hashing function)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +hash(x) +</pre> + </dd> + </dl> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__hash__"><code>__builtin__.object.__hash__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__iadd__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__iadd__</span>(<span class="sig-arg">x</span>, + <span class="sig-arg">y</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +x+=y +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__imul__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__imul__</span>(<span class="sig-arg">x</span>, + <span class="sig-arg">y</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +x*=y +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__iter__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__iter__</span>(<span class="sig-arg">x</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +iter(x) +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__le__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__le__</span>(<span class="sig-arg">x</span>, + <span class="sig-arg">y</span>)</span> + <br /><em class="fname">(Less-than-or-equals operator)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +x<=y +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__len__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__len__</span>(<span class="sig-arg">x</span>)</span> + <br /><em class="fname">(Length operator)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +len(x) +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__lt__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__lt__</span>(<span class="sig-arg">x</span>, + <span class="sig-arg">y</span>)</span> + <br /><em class="fname">(Less-than operator)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +x<y +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__mul__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__mul__</span>(<span class="sig-arg">x</span>, + <span class="sig-arg">n</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +x*n +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__ne__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__ne__</span>(<span class="sig-arg">x</span>, + <span class="sig-arg">y</span>)</span> + <br /><em class="fname">(Inequality operator)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +x!=y +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__new__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__new__</span>(<span class="sig-arg">T</span>, + <span class="sig-arg">S</span>, + <span class="sig-vararg">...</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +a new object with type S, a subtype of T +</pre> + </dd> + </dl> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__new__"><code>__builtin__.object.__new__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__repr__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__repr__</span>(<span class="sig-arg">x</span>)</span> + <br /><em class="fname">(Representation operator)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +repr(x) +</pre> + </dd> + </dl> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__repr__"><code>__builtin__.object.__repr__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__rmul__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__rmul__</span>(<span class="sig-arg">x</span>, + <span class="sig-arg">n</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +n*x +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__setitem__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__setitem__</span>(<span class="sig-arg">x</span>, + <span class="sig-arg">i</span>, + <span class="sig-arg">y</span>)</span> + <br /><em class="fname">(Index assignment operator)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +x[i]=y +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__setslice__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__setslice__</span>(<span class="sig-arg">x</span>, + <span class="sig-arg">i</span>, + <span class="sig-arg">j</span>, + <span class="sig-arg">y</span>)</span> + <br /><em class="fname">(Slice assignment operator)</em> + </h3> +<p>Use of negative indices is not supported.</p> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +x[i:j]=y +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="append"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">append</span>(<span class="sig-arg">L</span>, + <span class="sig-arg">object</span>)</span> + </h3> +<p>append object to end</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="count"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">count</span>(<span class="sig-arg">L</span>, + <span class="sig-arg">value</span>)</span> + </h3> +<p>return number of occurrences of value</p> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +integer +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="extend"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">extend</span>(<span class="sig-arg">L</span>, + <span class="sig-arg">iterable</span>)</span> + </h3> +<p>extend list by appending elements from the iterable</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="index"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">index</span>(<span class="sig-vararg">...</span>)</span> + </h3> +<p>L.index(value, [start, [stop]]) -> integer -- return first index of value</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="insert"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">insert</span>(<span class="sig-arg">L</span>, + <span class="sig-arg">index</span>, + <span class="sig-arg">object</span>)</span> + </h3> +<p>insert object before index</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="pop"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">pop</span>(<span class="sig-arg">L</span>, + <span class="sig-arg">index</span>=<span class="sig-default">...</span>)</span> + </h3> +<p>remove and return item at index (default last)</p> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +item +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="remove"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">remove</span>(<span class="sig-arg">L</span>, + <span class="sig-arg">value</span>)</span> + </h3> +<p>remove first occurrence of value</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="reverse"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">reverse</span>(<span class="sig-arg">L</span>)</span> + </h3> +<p>reverse <em>IN PLACE</em></p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="sort"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">sort</span>(<span class="sig-arg">L</span>, + <span class="sig-arg">cmpfunc</span>=<span class="sig-default">None</span>)</span> + </h3> +<p>stable sort <em>IN PLACE</em>; cmpfunc(x, y) -> -1, 0, 1</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:32 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/private/__builtin__.object-class.html b/psycopg2/doc/api/private/__builtin__.object-class.html new file mode 100644 index 00000000..08d0af66 --- /dev/null +++ b/psycopg2/doc/api/private/__builtin__.object-class.html @@ -0,0 +1,270 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>__builtin__.object</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + Module __builtin__ :: + Class object + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[show private | <a href="../public/__builtin__.object-class.html">hide private</a>]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="__builtin__.object-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Type object</h2> + +<dl><dt>Known Subclasses:</dt> +<dd> + <a href="psycopg2.pool.AbstractConnectionPool-class.html"><code>AbstractConnectionPool</code></a>, + <a href="__builtin__.list-class.html"><code>list</code></a>, + <a href="psycopg2.extras.SQL_IN-class.html"><code>SQL_IN</code></a>, + <a href="__builtin__.type-class.html"><code>type</code></a>, + <a href="datetime.tzinfo-class.html"><code>tzinfo</code></a>, + <a href="../private/psycopg2._psycopg.connection-class.html"><code>connection</code></a>, + <a href="../private/psycopg2._psycopg.cursor-class.html"><code>cursor</code></a>, + <a href="../private/psycopg2._psycopg.ISQLQuote-class.html"><code>ISQLQuote</code></a></dd></dl> + +<hr/> + +<p>The most base type</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__init__(...) initializes x; see x.__class__.__doc__ for signature</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__delattr__('name') <==> del x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__getattribute__('name') <==> x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__hash__"></a><span class="summary-sig"><span class="summary-sig-name">__hash__</span>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return hash(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__new__"></a><span class="summary-sig"><span class="summary-sig-name">__new__</span>(<span class="summary-sig-arg">T</span>, + <span class="summary-sig-arg">S</span>, + <span class="summary-sig-vararg">...</span>)</span></code> +<br /> +Return a new object with type S, a subtype of T...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__repr__"></a><span class="summary-sig"><span class="summary-sig-name">__repr__</span>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return repr(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__setattr__('name', value) <==> x.name = value</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__str__"></a><span class="summary-sig"><span class="summary-sig-name">__str__</span>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return str(x)...</td></tr> +</table><br /> + + +<!-- =========== START OF CLASS VARIABLE SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Class Variable Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> + <td><a name="__class__"></a><strong><code class="vname">__class__</code></strong> = <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr> +</table><br /> + + +<!-- =========== START OF METHOD DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Method Details</th></tr> +</table> + +<a name="__init__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-vararg">...</span>)</span> + <br /><em class="fname">(Constructor)</em> + </h3> +<p>x.__init__(...) initializes x; see x.__class__.__doc__ for signature</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="__delattr__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__delattr__</span>(<span class="sig-vararg">...</span>)</span> + </h3> +<p>x.__delattr__('name') <==> del x.name</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="__getattribute__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__getattribute__</span>(<span class="sig-vararg">...</span>)</span> + </h3> +<p>x.__getattribute__('name') <==> x.name</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="__hash__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__hash__</span>(<span class="sig-arg">x</span>)</span> + <br /><em class="fname">(Hashing function)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +hash(x) +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__new__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__new__</span>(<span class="sig-arg">T</span>, + <span class="sig-arg">S</span>, + <span class="sig-vararg">...</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +a new object with type S, a subtype of T +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__reduce__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__reduce__</span>(<span class="sig-vararg">...</span>)</span> + </h3> +<p>helper for pickle</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="__reduce_ex__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__reduce_ex__</span>(<span class="sig-vararg">...</span>)</span> + </h3> +<p>helper for pickle</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="__repr__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__repr__</span>(<span class="sig-arg">x</span>)</span> + <br /><em class="fname">(Representation operator)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +repr(x) +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__setattr__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__setattr__</span>(<span class="sig-vararg">...</span>)</span> + </h3> +<p>x.__setattr__('name', value) <==> x.name = value</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="__str__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__str__</span>(<span class="sig-arg">x</span>)</span> + <br /><em class="fname">(Informal representation operator)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +str(x) +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/private/__builtin__.type-class.html b/psycopg2/doc/api/private/__builtin__.type-class.html new file mode 100644 index 00000000..b388e76f --- /dev/null +++ b/psycopg2/doc/api/private/__builtin__.type-class.html @@ -0,0 +1,384 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>__builtin__.type</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + Module __builtin__ :: + Class type + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[show private | <a href="../public/__builtin__.type-class.html">hide private</a>]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="__builtin__.type-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Type type</h2> + +<pre class="base-tree"> +<a href="__builtin__.object-class.html"><code>object</code></a> --+ + | + <strong class="uidshort">type</strong> +</pre><br /> + +<hr/> + +<p>type(object) -> the object's type +type(name, bases, dict) -> a new type</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__call__"></a><span class="summary-sig"><span class="summary-sig-name">__call__</span>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-vararg">...</span>)</span></code> +<br /> +Return x(...)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__cmp__"></a><span class="summary-sig"><span class="summary-sig-name">__cmp__</span>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return cmp(x,y)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.type-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__delattr__('name') <==> del x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.type-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__getattribute__('name') <==> x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__hash__"></a><span class="summary-sig"><span class="summary-sig-name">__hash__</span>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return hash(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__new__"></a><span class="summary-sig"><span class="summary-sig-name">__new__</span>(<span class="summary-sig-arg">T</span>, + <span class="summary-sig-arg">S</span>, + <span class="summary-sig-vararg">...</span>)</span></code> +<br /> +Return a new object with type S, a subtype of T...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__repr__"></a><span class="summary-sig"><span class="summary-sig-name">__repr__</span>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return repr(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.type-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__setattr__('name', value) <==> x.name = value</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">list of immediate subclasses</td> + <td><code><a name="__subclasses__"></a><span class="summary-sig"><span class="summary-sig-name">__subclasses__</span>()</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">list</td> + <td><code><span class="summary-sig"><a href="__builtin__.type-class.html#mro" class="summary-sig-name"><code>mro</code></a>()</span></code> +<br /> +return a type's method resolution order</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from object</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__init__(...) initializes x; see x.__class__.__doc__ for signature</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return str(x)...</td></tr> +</table><br /> + + +<!-- =========== START OF PROPERTY SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Property Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><a name="__base__"></a><strong><code>__base__</code></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><a name="__basicsize__"></a><strong><code>__basicsize__</code></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><a name="__dictoffset__"></a><strong><code>__dictoffset__</code></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><a name="__flags__"></a><strong><code>__flags__</code></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><a name="__itemsize__"></a><strong><code>__itemsize__</code></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><a name="__mro__"></a><strong><code>__mro__</code></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><a name="__weakrefoffset__"></a><strong><code>__weakrefoffset__</code></strong></td></tr></table><br /> + + +<!-- =========== START OF CLASS VARIABLE SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Class Variable Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>tuple</code></td> +<td><strong><a href="__builtin__.type-class.html#__bases__"><code>__bases__</code></a></strong> = <span title="(<type 'object'>,)"><code>(<type 'object'>,) </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>str</code></td> +<td><strong><a href="__builtin__.type-class.html#__name__"><code>__name__</code></a></strong> = <span title="'type'"><code><span class="variable-quote">'</span>type<span class="variable-quote">'</span> </code> +</span></td></tr> +</table><br /> + + +<!-- =========== START OF METHOD DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Method Details</th></tr> +</table> + +<a name="__call__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__call__</span>(<span class="sig-arg">x</span>, + <span class="sig-vararg">...</span>)</span> + <br /><em class="fname">(Call operator)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +x(...) +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__cmp__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__cmp__</span>(<span class="sig-arg">x</span>, + <span class="sig-arg">y</span>)</span> + <br /><em class="fname">(Comparison operator)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +cmp(x,y) +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__delattr__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__delattr__</span>(<span class="sig-vararg">...</span>)</span> + </h3> +<p>x.__delattr__('name') <==> del x.name</p> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__delattr__"><code>__builtin__.object.__delattr__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__getattribute__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__getattribute__</span>(<span class="sig-vararg">...</span>)</span> + </h3> +<p>x.__getattribute__('name') <==> x.name</p> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__getattribute__"><code>__builtin__.object.__getattribute__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__hash__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__hash__</span>(<span class="sig-arg">x</span>)</span> + <br /><em class="fname">(Hashing function)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +hash(x) +</pre> + </dd> + </dl> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__hash__"><code>__builtin__.object.__hash__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__new__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__new__</span>(<span class="sig-arg">T</span>, + <span class="sig-arg">S</span>, + <span class="sig-vararg">...</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +a new object with type S, a subtype of T +</pre> + </dd> + </dl> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__new__"><code>__builtin__.object.__new__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__repr__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__repr__</span>(<span class="sig-arg">x</span>)</span> + <br /><em class="fname">(Representation operator)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +repr(x) +</pre> + </dd> + </dl> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__repr__"><code>__builtin__.object.__repr__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__setattr__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__setattr__</span>(<span class="sig-vararg">...</span>)</span> + </h3> +<p>x.__setattr__('name', value) <==> x.name = value</p> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__setattr__"><code>__builtin__.object.__setattr__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__subclasses__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__subclasses__</span>()</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +list of immediate subclasses </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="mro"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">mro</span>()</span> + </h3> +<p>return a type's method resolution order</p> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +list </dd> + </dl> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF CLASS VARIABLE DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Class Variable Details</th></tr> +</table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="__bases__"></a> +<h3>__bases__</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>tuple</code> + + </dd> + <dt title="(<type 'object'>,)">Value:</dt> + <dd title="(<type 'object'>,)"><table><tr><td> +<pre class="variable"> +(<type 'object'>,) </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="__name__"></a> +<h3>__name__</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>str</code> + + </dd> + <dt title="'type'">Value:</dt> + <dd title="'type'"><table><tr><td> +<pre class="variable"> +<span class="variable-quote">'</span>type<span class="variable-quote">'</span> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:34 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/private/datetime.tzinfo-class.html b/psycopg2/doc/api/private/datetime.tzinfo-class.html new file mode 100644 index 00000000..337ac1ac --- /dev/null +++ b/psycopg2/doc/api/private/datetime.tzinfo-class.html @@ -0,0 +1,239 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>datetime.tzinfo</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + Module datetime :: + Class tzinfo + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[show private | <a href="../public/datetime.tzinfo-class.html">hide private</a>]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="datetime.tzinfo-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Type tzinfo</h2> + +<pre class="base-tree"> +<a href="__builtin__.object-class.html"><code>object</code></a> --+ + | + <strong class="uidshort">tzinfo</strong> +</pre><br /> + +<dl><dt>Known Subclasses:</dt> +<dd> + <a href="psycopg2.tz.FixedOffsetTimezone-class.html"><code>FixedOffsetTimezone</code></a>, + <a href="psycopg2.tz.LocalTimezone-class.html"><code>LocalTimezone</code></a></dd></dl> + +<hr/> + +<p>Abstract base class for time zone info objects.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__getattribute__('name') <==> x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__new__"></a><span class="summary-sig"><span class="summary-sig-name">__new__</span>(<span class="summary-sig-arg">T</span>, + <span class="summary-sig-arg">S</span>, + <span class="summary-sig-vararg">...</span>)</span></code> +<br /> +Return a new object with type S, a subtype of T...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +-> (cls, state)</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#dst" class="summary-sig-name"><code>dst</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +datetime -> DST offset in minutes east of UTC.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#fromutc" class="summary-sig-name"><code>fromutc</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +datetime in UTC -> datetime in local time.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#tzname" class="summary-sig-name"><code>tzname</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +datetime -> string name of time zone.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#utcoffset" class="summary-sig-name"><code>utcoffset</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +datetime -> minutes east of UTC (negative for west of UTC).</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from object</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__init__(...) initializes x; see x.__class__.__doc__ for signature</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__delattr__('name') <==> del x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return hash(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return repr(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__setattr__('name', value) <==> x.name = value</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return str(x)...</td></tr> +</table><br /> + + +<!-- =========== START OF METHOD DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Method Details</th></tr> +</table> + +<a name="__getattribute__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__getattribute__</span>(<span class="sig-vararg">...</span>)</span> + </h3> +<p>x.__getattribute__('name') <==> x.name</p> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__getattribute__"><code>__builtin__.object.__getattribute__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__new__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__new__</span>(<span class="sig-arg">T</span>, + <span class="sig-arg">S</span>, + <span class="sig-vararg">...</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +a new object with type S, a subtype of T +</pre> + </dd> + </dl> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__new__"><code>__builtin__.object.__new__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__reduce__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__reduce__</span>(<span class="sig-vararg">...</span>)</span> + </h3> +<p>-> (cls, state)</p> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__reduce__"><code>__builtin__.object.__reduce__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="dst"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">dst</span>(<span class="sig-vararg">...</span>)</span> + </h3> +<p>datetime -> DST offset in minutes east of UTC.</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="fromutc"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">fromutc</span>(<span class="sig-vararg">...</span>)</span> + </h3> +<p>datetime in UTC -> datetime in local time.</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="tzname"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">tzname</span>(<span class="sig-vararg">...</span>)</span> + </h3> +<p>datetime -> string name of time zone.</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="utcoffset"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">utcoffset</span>(<span class="sig-vararg">...</span>)</span> + </h3> +<p>datetime -> minutes east of UTC (negative for west of UTC).</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/private/epydoc.css b/psycopg2/doc/api/private/epydoc.css new file mode 100644 index 00000000..22e8f7ed --- /dev/null +++ b/psycopg2/doc/api/private/epydoc.css @@ -0,0 +1,138 @@ +/* Based on the Epydoc "default.css" +** with some missing reST-related classes +** and Python syntax support (from SilverCity) +*/ + +/* Body color */ +body { background: #ffffff; color: #000000; } + +/* Tables */ +table.summary, table.details, table.index + { background: #e8f0f8; color: #000000; } +tr.summary, tr.details, tr.index + { background: #70b0f0; color: #000000; + text-align: left; font-size: 120%; } +tr.group { background: #c0e0f8; color: #000000; + text-align: left; font-size: 120%; + font-style: italic; } + +/* Documentation page titles */ +h2.module { margin-top: 0.2em; } +h2.class { margin-top: 0.2em; } + +/* Headings */ +h1.heading { font-size: +140%; font-style: italic; + font-weight: bold; } +h2.heading { font-size: +125%; font-style: italic; + font-weight: bold; } +h3.heading { font-size: +110%; font-style: italic; + font-weight: normal; } + +/* Base tree */ +pre.base-tree { font-size: 80%; margin: 0; } + +/* TOC */ +p.toc { margin: 0; } + +/* Details Sections */ +table.func-details { background: #e8f0f8; color: #000000; + border: 2px groove #c0d0d0; + padding: 0 1em 0 1em; margin: 0.4em 0 0 0; } +h3.func-detail { background: transparent; color: #000000; + margin: 0 0 1em 0; } + +table.var-details { background: #e8f0f8; color: #000000; + border: 2px groove #c0d0d0; + padding: 0 1em 0 1em; margin: 0.4em 0 0 0; } +h3.var-details { background: transparent; color: #000000; + margin: 0 0 1em 0; } + +/* Function signatures */ +.sig { background: transparent; color: #000000; + font-weight: bold; } +.sig-name { background: transparent; color: #006080; } +.sig-arg, .sig-kwarg, .sig-vararg + { background: transparent; color: #008060; } +.sig-default { background: transparent; color: #602000; } +.summary-sig { background: transparent; color: #000000; } +.summary-sig-name { background: transparent; color: #204080; } +.summary-sig-arg, .summary-sig-kwarg, .summary-sig-vararg + { background: transparent; color: #008060; } + +/* Doctest blocks */ +.py-src { background: transparent; color: #000000; } +.py-prompt { background: transparent; color: #005050; + font-weight: bold;} +.py-string { background: transparent; color: #006030; } +.py-comment { background: transparent; color: #003060; } +.py-keyword { background: transparent; color: #600000; } +.py-output { background: transparent; color: #404040; } +div.code-block, +pre.literal-block, +pre.doctestblock { background: #f4faff; color: #000000; + padding: .5em; margin: 1em; + border: 1px solid #708890; } +table pre.doctestblock + { background: #dce4ec; color: #000000; + padding: .5em; margin: 1em; + border: 1px solid #708890; } +div.code-block { font-family: monospace; } + +/* Variable values */ +pre.variable { background: #dce4ec; color: #000000; + padding: .5em; margin: 0; + border: 1px solid #708890; } +.variable-linewrap { background: transparent; color: #604000; } +.variable-ellipsis { background: transparent; color: #604000; } +.variable-quote { background: transparent; color: #604000; } +.re { background: transparent; color: #000000; } +.re-char { background: transparent; color: #006030; } +.re-op { background: transparent; color: #600000; } +.re-group { background: transparent; color: #003060; } +.re-ref { background: transparent; color: #404040; } + +/* Navigation bar */ +table.navbar { background: #a0c0ff; color: #0000ff; + border: 2px groove #c0d0d0; } +th.navbar { background: #a0c0ff; color: #0000ff; } +th.navselect { background: #70b0ff; color: #000000; } +.nomargin { margin: 0; } + +/* Links */ +a:link { background: transparent; color: #0000ff; } +a:visited { background: transparent; color: #204080; } +a.navbar:link { background: transparent; color: #0000ff; + text-decoration: none; } +a.navbar:visited { background: transparent; color: #204080; + text-decoration: none; } + +/* Admonitions */ +div.warning, +div.note { background-color: #c0e0f8; + border: thin solid black; + padding: 1em; + margin-left: 1em; + margin-right: 1em; } +div.warning .first, +div.note .first { font-family: sans-serif; + font-size: 110%; + margin-right: 0.5em; } + +/* Lists */ +ul { margin-top: 0; } + +/* Python syntax */ +.p_character { color: olive; } +.p_classname { color: blue; font-weight: bold; } +.p_commentblock {color: gray; font-style: italic; } +.p_commentline { color: green; font-style: italic; } +.p_default {} +.p_defname { color: #009999; font-weight: bold; } +.p_identifier { color: black; } +.p_number { color: #009999; } +.p_operator { color: black; } +.p_string { color: #7F007F; } +.p_stringeol { color: #7F007F; } +.p_triple { color: #7F0000; } +.p_tripledouble { color: #7F0000; } +.p_word { color: navy; font-weight: bold; } diff --git a/psycopg2/doc/api/private/exceptions.Exception-class.html b/psycopg2/doc/api/private/exceptions.Exception-class.html new file mode 100644 index 00000000..3064c510 --- /dev/null +++ b/psycopg2/doc/api/private/exceptions.Exception-class.html @@ -0,0 +1,128 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>exceptions.Exception</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + Module exceptions :: + Class Exception + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[show private | <a href="../public/exceptions.Exception-class.html">hide private</a>]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="exceptions.Exception-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Class Exception</h2> + +<dl><dt>Known Subclasses:</dt> +<dd> + <a href="exceptions.StandardError-class.html"><code>StandardError</code></a></dd></dl> + +<hr/> + +<p>Common base class for all exceptions.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__init__"></a><span class="summary-sig"><span class="summary-sig-name">__init__</span>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__getitem__"></a><span class="summary-sig"><span class="summary-sig-name">__getitem__</span>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__str__"></a><span class="summary-sig"><span class="summary-sig-name">__str__</span>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +</table><br /> + + +<!-- =========== START OF METHOD DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Method Details</th></tr> +</table> + +<a name="__init__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-vararg">...</span>)</span> + <br /><em class="fname">(Constructor)</em> + </h3> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="__getitem__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__getitem__</span>(<span class="sig-vararg">...</span>)</span> + <br /><em class="fname">(Indexing operator)</em> + </h3> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="__str__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__str__</span>(<span class="sig-vararg">...</span>)</span> + <br /><em class="fname">(Informal representation operator)</em> + </h3> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:35 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/private/exceptions.StandardError-class.html b/psycopg2/doc/api/private/exceptions.StandardError-class.html new file mode 100644 index 00000000..1b491dd5 --- /dev/null +++ b/psycopg2/doc/api/private/exceptions.StandardError-class.html @@ -0,0 +1,102 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>exceptions.StandardError</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + Module exceptions :: + Class StandardError + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[show private | <a href="../public/exceptions.StandardError-class.html">hide private</a>]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="exceptions.StandardError-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Class StandardError</h2> + +<pre class="base-tree"> +<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ + | + <strong class="uidshort">StandardError</strong> +</pre><br /> + +<dl><dt>Known Subclasses:</dt> +<dd> + <a href="psycopg2.Error-class.html"><code>Error</code></a>, + <a href="psycopg2.Warning-class.html"><code>Warning</code></a></dd></dl> + +<hr/> + +<p>Base class for all standard Python exceptions.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from Exception</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +</table><br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/private/frames.html b/psycopg2/doc/api/private/frames.html new file mode 100644 index 00000000..ffd65360 --- /dev/null +++ b/psycopg2/doc/api/private/frames.html @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" + "DTD/xhtml1-frameset.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title> API Documentation </title> +</head> +<frameset cols="20%,80%"> + <frameset rows="30%,70%"> + <frame src="toc.html" name="moduleListFrame" id="moduleListFrame" /> + <frame src="toc-everything.html" name="moduleFrame" id="moduleFrame" /> + </frameset> + <frame src="psycopg2-module.html" name="mainFrame" id="mainFrame" /> +</frameset> +</html> diff --git a/psycopg2/doc/api/private/help.html b/psycopg2/doc/api/private/help.html new file mode 100644 index 00000000..21f2560f --- /dev/null +++ b/psycopg2/doc/api/private/help.html @@ -0,0 +1,231 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>Help</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th bgcolor="#70b0f0" class="navselect"> Help </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[show private | <a href="../public/help.html">hide private</a>]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="help.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<h1 class="help"> API Documentation </h1> + +<p> This document contains the API (Application Programming Interface) +documentation for this project. Documentation for the Python +objects defined by the project is divided into separate pages for each +package, module, and class. The API documentation also includes two +pages containing information about the project as a whole: a trees +page, and an index page. </p> + +<h2> Object Documentation </h2> + + <p>Each <strong>Package Documentation</strong> page contains: </p> + <ul> + <li> A description of the package. </li> + <li> A list of the modules and sub-packages contained by the + package. </li> + <li> A summary of the classes defined by the package. </li> + <li> A summary of the functions defined by the package. </li> + <li> A summary of the variables defined by the package. </li> + <li> A detailed description of each function defined by the + package. </li> + <li> A detailed description of each variable defined by the + package. </li> + </ul> + + <p>Each <strong>Module Documentation</strong> page contains:</p> + <ul> + <li> A description of the module. </li> + <li> A summary of the classes defined by the module. </li> + <li> A summary of the functions defined by the module. </li> + <li> A summary of the variables defined by the module. </li> + <li> A detailed description of each function defined by the + module. </li> + <li> A detailed description of each variable defined by the + module. </li> + </ul> + + <p>Each <strong>Class Documentation</strong> page contains: </p> + <ul> + <li> A class inheritance diagram. </li> + <li> A list of known subclasses. </li> + <li> A description of the class. </li> + <li> A summary of the methods defined by the class. </li> + <li> A summary of the instance variables defined by the class. </li> + <li> A summary of the class (static) variables defined by the + class. </li> + <li> A detailed description of each method defined by the + class. </li> + <li> A detailed description of each instance variable defined by the + class. </li> + <li> A detailed description of each class (static) variable defined + by the class. </li> + </ul> + +<h2> Project Documentation </h2> + + <p> The <strong>Trees</strong> page contains the module and class hierarchies: </p> + <ul> + <li> The <em>module hierarchy</em> lists every package and module, with + modules grouped into packages. At the top level, and within each + package, modules and sub-packages are listed alphabetically. </li> + <li> The <em>class hierarchy</em> lists every class, grouped by base + class. If a class has more than one base class, then it will be + listed under each base class. At the top level, and under each base + class, classes are listed alphabetically. </li> + </ul> + + <p> The <strong>Index</strong> page contains indices of terms and + identifiers: </p> + <ul> + <li> The <em>term index</em> lists every term indexed by any object's + documentation. For each term, the index provides links to each + place where the term is indexed. </li> + <li> The <em>identifier index</em> lists the (short) name of every package, + module, class, method, function, variable, and parameter. For each + identifier, the index provides a short description, and a link to + its documentation. </li> + </ul> + +<h2> The Table of Contents </h2> + +<p> The table of contents occupies the two frames on the left side of +the window. The upper-left frame displays the <em>project +contents</em>, and the lower-left frame displays the <em>module +contents</em>: </p> + +<table class="help summary" border="1" cellspacing="0" cellpadding="3"> + <tr style="height: 30%"> + <td align="center" style="font-size: small"> + Project<br />Contents<hr />...</td> + <td align="center" style="font-size: small" rowspan="2" width="70%"> + API<br />Documentation<br />Frame<br /><br /><br /> + </td> + </tr> + <tr> + <td align="center" style="font-size: small"> + Module<br />Contents<hr /> <br />...<br /> + </td> + </tr> +</table><br /> + +<p> The <strong>project contents frame</strong> contains a list of all packages +and modules that are defined by the project. Clicking on an entry +will display its contents in the module contents frame. Clicking on a +special entry, labeled "Everything," will display the contents of +the entire project. </p> + +<p> The <strong>module contents frame</strong> contains a list of every +submodule, class, type, exception, function, and variable defined by a +module or package. Clicking on an entry will display its +documentation in the API documentation frame. Clicking on the name of +the module, at the top of the frame, will display the documentation +for the module itself. </p> + +<p> The "<strong>frames</strong>" and "<strong>no frames</strong>" buttons below the top +navigation bar can be used to control whether the table of contents is +displayed or not. </p> + +<h2> The Navigation Bar </h2> + +<p> A navigation bar is located at the top and bottom of every page. +It indicates what type of page you are currently viewing, and allows +you to go to related pages. The following table describes the labels +on the navigation bar. Note that not some labels (such as +[Parent]) are not displayed on all pages. </p> + +<table class="summary" border="1" cellspacing="0" cellpadding="3" width="100%"> +<tr class="summary"> + <th>Label</th> + <th>Highlighted when...</th> + <th>Links to...</th> +</tr> + <tr><td valign="top"><strong>[Parent]</strong></td> + <td valign="top"><em>(never highlighted)</em></td> + <td valign="top"> the parent of the current package </td></tr> + <tr><td valign="top"><strong>[Package]</strong></td> + <td valign="top">viewing a package</td> + <td valign="top">the package containing the current object + </td></tr> + <tr><td valign="top"><strong>[Module]</strong></td> + <td valign="top">viewing a module</td> + <td valign="top">the module containing the current object + </td></tr> + <tr><td valign="top"><strong>[Class]</strong></td> + <td valign="top">viewing a class </td> + <td valign="top">the class containing the current object</td></tr> + <tr><td valign="top"><strong>[Trees]</strong></td> + <td valign="top">viewing the trees page</td> + <td valign="top"> the trees page </td></tr> + <tr><td valign="top"><strong>[Index]</strong></td> + <td valign="top">viewing the index page</td> + <td valign="top"> the index page </td></tr> + <tr><td valign="top"><strong>[Help]</strong></td> + <td valign="top">viewing the help page</td> + <td valign="top"> the help page </td></tr> +</table> + +<p> The "<strong>show private</strong>" and "<strong>hide private</strong>" buttons below +the top navigation bar can be used to control whether documentation +for private objects is displayed. Private objects are usually defined +as objects whose (short) names begin with a single underscore, but do +not end with an underscore. For example, "<code>_x</code>", +"<code>__pprint</code>", and "<code>epydoc.epytext._tokenize</code>" +are private objects; but "<code>re.sub</code>", +"<code>__init__</code>", and "<code>type_</code>" are not. However, +if a module defines the "<code>__all__</code>" variable, then its +contents are used to decide which objects are private. </p> + +<p> A timestamp below the bottom navigation bar indicates when each +page was last updated. </p> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th bgcolor="#70b0f0" class="navselect"> Help </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:37 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/private/index.html b/psycopg2/doc/api/private/index.html new file mode 100644 index 00000000..ffd65360 --- /dev/null +++ b/psycopg2/doc/api/private/index.html @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" + "DTD/xhtml1-frameset.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title> API Documentation </title> +</head> +<frameset cols="20%,80%"> + <frameset rows="30%,70%"> + <frame src="toc.html" name="moduleListFrame" id="moduleListFrame" /> + <frame src="toc-everything.html" name="moduleFrame" id="moduleFrame" /> + </frameset> + <frame src="psycopg2-module.html" name="mainFrame" id="mainFrame" /> +</frameset> +</html> diff --git a/psycopg2/doc/api/private/indices.html b/psycopg2/doc/api/private/indices.html new file mode 100644 index 00000000..6a224a16 --- /dev/null +++ b/psycopg2/doc/api/private/indices.html @@ -0,0 +1,666 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>Index</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th bgcolor="#70b0f0" class="navselect"> Index </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[show private | <a href="../public/indices.html">hide private</a>]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="indices.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> +<br /> + +<!-- =========== START OF IDENTIFIER INDEX =========== --> +<table class="index" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="index"> + <th colspan="2">Identifier Index</th></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__add__"><code>__add__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.type-class.html#__base__"><code>__base__</code></a></td> + <td>member_descriptor in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.type-class.html#__bases__"><code>__bases__</code></a></td> + <td>Variable in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.type-class.html#__basicsize__"><code>__basicsize__</code></a></td> + <td>member_descriptor in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2.psycopg1.cursor-class.html#__build_dict"><code>__build_dict</code></a></td> + <td>Method in class <a href="psycopg2.psycopg1.cursor-class.html"><code>psycopg2.psycopg1.cursor</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.type-class.html#__call__"><code>__call__</code></a></td> + <td>Method in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.type-class.html"><code>type</code></a></td> + <td>Class in module <code>__builtin__</code></td></tr> + <tr><td width="15%"><a href="__builtin__.type-class.html#__cmp__"><code>__cmp__</code></a></td> + <td>Method in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__contains__"><code>__contains__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.object-class.html#__delattr__"><code>__delattr__</code></a></td> + <td>Method in class <a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.type-class.html#__delattr__"><code>__delattr__</code></a></td> + <td>Method in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__delitem__"><code>__delitem__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__delslice__"><code>__delslice__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.type-class.html#__dictoffset__"><code>__dictoffset__</code></a></td> + <td>member_descriptor in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__eq__"><code>__eq__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.type-class.html#__flags__"><code>__flags__</code></a></td> + <td>member_descriptor in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__ge__"><code>__ge__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__getattribute__"><code>__getattribute__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.object-class.html#__getattribute__"><code>__getattribute__</code></a></td> + <td>Method in class <a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.type-class.html#__getattribute__"><code>__getattribute__</code></a></td> + <td>Method in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr> + <tr><td width="15%"><a href="datetime.tzinfo-class.html#__getattribute__"><code>__getattribute__</code></a></td> + <td>Method in class <a href="datetime.tzinfo-class.html"><code>datetime.tzinfo</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__getitem__"><code>__getitem__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="exceptions.Exception-class.html#__getitem__"><code>__getitem__</code></a></td> + <td>Method in class <a href="exceptions.Exception-class.html"><code>exceptions.Exception</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extras.DictRow-class.html#__getitem__"><code>__getitem__</code></a></td> + <td>Method in class <a href="psycopg2.extras.DictRow-class.html"><code>psycopg2.extras.DictRow</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__getslice__"><code>__getslice__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__gt__"><code>__gt__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__hash__"><code>__hash__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.object-class.html#__hash__"><code>__hash__</code></a></td> + <td>Method in class <a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.type-class.html#__hash__"><code>__hash__</code></a></td> + <td>Method in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__iadd__"><code>__iadd__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__imul__"><code>__imul__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__init__"><code>__init__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.object-class.html#__init__"><code>__init__</code></a></td> + <td>Method in class <a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></td></tr> + <tr><td width="15%"><a href="exceptions.Exception-class.html#__init__"><code>__init__</code></a></td> + <td>Method in class <a href="exceptions.Exception-class.html"><code>exceptions.Exception</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.ISQLQuote-class.html#__init__"><code>__init__</code></a></td> + <td>Method in class <a href="../private/psycopg2._psycopg.ISQLQuote-class.html"><code>psycopg2._psycopg.ISQLQuote</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#__init__"><code>__init__</code></a></td> + <td>Method in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#__init__"><code>__init__</code></a></td> + <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extras.DictRow-class.html#__init__"><code>__init__</code></a></td> + <td>Method in class <a href="psycopg2.extras.DictRow-class.html"><code>psycopg2.extras.DictRow</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extras.SQL_IN-class.html#__init__"><code>__init__</code></a></td> + <td>Method in class <a href="psycopg2.extras.SQL_IN-class.html"><code>psycopg2.extras.SQL_IN</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.pool.AbstractConnectionPool-class.html#__init__"><code>__init__</code></a></td> + <td>Method in class <a href="psycopg2.pool.AbstractConnectionPool-class.html"><code>psycopg2.pool.AbstractConnectionPool</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.pool.PersistentConnectionPool-class.html#__init__"><code>__init__</code></a></td> + <td>Method in class <a href="psycopg2.pool.PersistentConnectionPool-class.html"><code>psycopg2.pool.PersistentConnectionPool</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.pool.ThreadedConnectionPool-class.html#__init__"><code>__init__</code></a></td> + <td>Method in class <a href="psycopg2.pool.ThreadedConnectionPool-class.html"><code>psycopg2.pool.ThreadedConnectionPool</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.tz.FixedOffsetTimezone-class.html#__init__"><code>__init__</code></a></td> + <td>Method in class <a href="psycopg2.tz.FixedOffsetTimezone-class.html"><code>psycopg2.tz.FixedOffsetTimezone</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.type-class.html#__itemsize__"><code>__itemsize__</code></a></td> + <td>member_descriptor in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__iter__"><code>__iter__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#__iter__"><code>__iter__</code></a></td> + <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__le__"><code>__le__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__len__"><code>__len__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__lt__"><code>__lt__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.type-class.html#__mro__"><code>__mro__</code></a></td> + <td>member_descriptor in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__mul__"><code>__mul__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.type-class.html#__name__"><code>__name__</code></a></td> + <td>Variable in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__ne__"><code>__ne__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__new__"><code>__new__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.object-class.html#__new__"><code>__new__</code></a></td> + <td>Method in class <a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.type-class.html#__new__"><code>__new__</code></a></td> + <td>Method in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr> + <tr><td width="15%"><a href="datetime.tzinfo-class.html#__new__"><code>__new__</code></a></td> + <td>Method in class <a href="datetime.tzinfo-class.html"><code>datetime.tzinfo</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.ISQLQuote-class.html#__new__"><code>__new__</code></a></td> + <td>Method in class <a href="../private/psycopg2._psycopg.ISQLQuote-class.html"><code>psycopg2._psycopg.ISQLQuote</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#__new__"><code>__new__</code></a></td> + <td>Method in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#__new__"><code>__new__</code></a></td> + <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.object-class.html#__reduce__"><code>__reduce__</code></a></td> + <td>Method in class <a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></td></tr> + <tr><td width="15%"><a href="datetime.tzinfo-class.html#__reduce__"><code>__reduce__</code></a></td> + <td>Method in class <a href="datetime.tzinfo-class.html"><code>datetime.tzinfo</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.object-class.html#__reduce_ex__"><code>__reduce_ex__</code></a></td> + <td>Method in class <a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__repr__"><code>__repr__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.object-class.html#__repr__"><code>__repr__</code></a></td> + <td>Method in class <a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.type-class.html#__repr__"><code>__repr__</code></a></td> + <td>Method in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#__repr__"><code>__repr__</code></a></td> + <td>Method in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#__repr__"><code>__repr__</code></a></td> + <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__rmul__"><code>__rmul__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.object-class.html#__setattr__"><code>__setattr__</code></a></td> + <td>Method in class <a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.type-class.html#__setattr__"><code>__setattr__</code></a></td> + <td>Method in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__setitem__"><code>__setitem__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__setslice__"><code>__setslice__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.object-class.html#__str__"><code>__str__</code></a></td> + <td>Method in class <a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></td></tr> + <tr><td width="15%"><a href="exceptions.Exception-class.html#__str__"><code>__str__</code></a></td> + <td>Method in class <a href="exceptions.Exception-class.html"><code>exceptions.Exception</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#__str__"><code>__str__</code></a></td> + <td>Method in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#__str__"><code>__str__</code></a></td> + <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.type-class.html#__subclasses__"><code>__subclasses__</code></a></td> + <td>Method in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#__version__"><code>__version__</code></a></td> + <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.type-class.html#__weakrefoffset__"><code>__weakrefoffset__</code></a></td> + <td>member_descriptor in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2.extras.DictCursor-class.html#_build_index"><code>_build_index</code></a></td> + <td>Method in class <a href="psycopg2.extras.DictCursor-class.html"><code>psycopg2.extras.DictCursor</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#_C_API"><code>_C_API</code></a></td> + <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_closeall"><code>_closeall</code></a></td> + <td>Method in class <a href="psycopg2.pool.AbstractConnectionPool-class.html"><code>psycopg2.pool.AbstractConnectionPool</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_connect"><code>_connect</code></a></td> + <td>Method in class <a href="psycopg2.pool.AbstractConnectionPool-class.html"><code>psycopg2.pool.AbstractConnectionPool</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2.extras.DictCursor-class.html#__query_executed"><code>__query_executed</code></a></td> + <td>Variable in class <a href="psycopg2.extras.DictCursor-class.html"><code>psycopg2.extras.DictCursor</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_getconn"><code>_getconn</code></a></td> + <td>Method in class <a href="psycopg2.pool.AbstractConnectionPool-class.html"><code>psycopg2.pool.AbstractConnectionPool</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_getkey"><code>_getkey</code></a></td> + <td>Method in class <a href="psycopg2.pool.AbstractConnectionPool-class.html"><code>psycopg2.pool.AbstractConnectionPool</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2.tz.LocalTimezone-class.html#_isdst"><code>_isdst</code></a></td> + <td>Method in class <a href="psycopg2.tz.LocalTimezone-class.html"><code>psycopg2.tz.LocalTimezone</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2.tz.FixedOffsetTimezone-class.html#_name"><code>_name</code></a></td> + <td>Variable in class <a href="psycopg2.tz.FixedOffsetTimezone-class.html"><code>psycopg2.tz.FixedOffsetTimezone</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2.tz.FixedOffsetTimezone-class.html#_offset"><code>_offset</code></a></td> + <td>Variable in class <a href="psycopg2.tz.FixedOffsetTimezone-class.html"><code>psycopg2.tz.FixedOffsetTimezone</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html"><code>_psycopg</code></a></td> + <td>Module in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_putconn"><code>_putconn</code></a></td> + <td>Method in class <a href="psycopg2.pool.AbstractConnectionPool-class.html"><code>psycopg2.pool.AbstractConnectionPool</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.ISQLQuote-class.html#_wrapped"><code>_wrapped</code></a></td> + <td>member_descriptor in class <a href="../private/psycopg2._psycopg.ISQLQuote-class.html"><code>psycopg2._psycopg.ISQLQuote</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.pool.AbstractConnectionPool-class.html"><code>AbstractConnectionPool</code></a></td> + <td>Class in module <a href="psycopg2.pool-module.html"><code>psycopg2.pool</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extensions-module.html#adapt"><code>adapt</code></a></td> + <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#adapters"><code>adapters</code></a></td> + <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#apilevel"><code>apilevel</code></a></td> + <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#append"><code>append</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#arraysize"><code>arraysize</code></a></td> + <td>member_descriptor in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extensions-module.html#AsIs"><code>AsIs</code></a></td> + <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.psycopg1.connection-class.html#autocommit"><code>autocommit</code></a></td> + <td>Method in class <a href="psycopg2.psycopg1.connection-class.html"><code>psycopg2.psycopg1.connection</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2-module.html#Binary"><code>Binary</code></a></td> + <td>Function in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#BINARY"><code>BINARY</code></a></td> + <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#binary_types"><code>binary_types</code></a></td> + <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#binary_types"><code>binary_types</code></a></td> + <td>member_descriptor in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#BINARYARRAY"><code>BINARYARRAY</code></a></td> + <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#BOOLEAN"><code>BOOLEAN</code></a></td> + <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extensions-module.html#Boolean"><code>Boolean</code></a></td> + <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#BOOLEANARRAY"><code>BOOLEANARRAY</code></a></td> + <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#callproc"><code>callproc</code></a></td> + <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extras.DictCursor-class.html#callproc"><code>callproc</code></a></td> + <td>Method in class <a href="psycopg2.extras.DictCursor-class.html"><code>psycopg2.extras.DictCursor</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#close"><code>close</code></a></td> + <td>Method in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#close"><code>close</code></a></td> + <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.pool.PersistentConnectionPool-class.html#closeall"><code>closeall</code></a></td> + <td>Method in class <a href="psycopg2.pool.PersistentConnectionPool-class.html"><code>psycopg2.pool.PersistentConnectionPool</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.pool.ThreadedConnectionPool-class.html#closeall"><code>closeall</code></a></td> + <td>Method in class <a href="psycopg2.pool.ThreadedConnectionPool-class.html"><code>psycopg2.pool.ThreadedConnectionPool</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#closed"><code>closed</code></a></td> + <td>member_descriptor in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#commit"><code>commit</code></a></td> + <td>Method in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2-module.html#connect"><code>connect</code></a></td> + <td>Function in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.psycopg1-module.html#connect"><code>connect</code></a></td> + <td>Function in module <a href="psycopg2.psycopg1-module.html"><code>psycopg2.psycopg1</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html"><code>connection</code></a></td> + <td>Class in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#connection"><code>connection</code></a></td> + <td>member_descriptor in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.psycopg1.connection-class.html"><code>connection</code></a></td> + <td>Class in module <a href="psycopg2.psycopg1-module.html"><code>psycopg2.psycopg1</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#copy_from"><code>copy_from</code></a></td> + <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#copy_to"><code>copy_to</code></a></td> + <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#count"><code>count</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#cursor"><code>cursor</code></a></td> + <td>Method in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html"><code>cursor</code></a></td> + <td>Class in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extras.DictConnection-class.html#cursor"><code>cursor</code></a></td> + <td>Method in class <a href="psycopg2.extras.DictConnection-class.html"><code>psycopg2.extras.DictConnection</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.psycopg1.connection-class.html#cursor"><code>cursor</code></a></td> + <td>Method in class <a href="psycopg2.psycopg1.connection-class.html"><code>psycopg2.psycopg1.connection</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.psycopg1.cursor-class.html"><code>cursor</code></a></td> + <td>Class in module <a href="psycopg2.psycopg1-module.html"><code>psycopg2.psycopg1</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.DatabaseError-class.html"><code>DatabaseError</code></a></td> + <td>Class in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#DatabaseError"><code>DatabaseError</code></a></td> + <td>member_descriptor in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.DataError-class.html"><code>DataError</code></a></td> + <td>Class in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#DataError"><code>DataError</code></a></td> + <td>member_descriptor in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2-module.html#Date"><code>Date</code></a></td> + <td>Function in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#DATE"><code>DATE</code></a></td> + <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#DATEARRAY"><code>DATEARRAY</code></a></td> + <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extensions-module.html#DateFromPy"><code>DateFromPy</code></a></td> + <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2-module.html#DateFromTicks"><code>DateFromTicks</code></a></td> + <td>Function in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#DATETIME"><code>DATETIME</code></a></td> + <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#DATETIMEARRAY"><code>DATETIMEARRAY</code></a></td> + <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.pool-module.html#dbg"><code>dbg</code></a></td> + <td>Function in module <a href="psycopg2.pool-module.html"><code>psycopg2.pool</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#DECIMAL"><code>DECIMAL</code></a></td> + <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#DECIMALARRAY"><code>DECIMALARRAY</code></a></td> + <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#description"><code>description</code></a></td> + <td>member_descriptor in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extras.DictConnection-class.html"><code>DictConnection</code></a></td> + <td>Class in module <a href="psycopg2.extras-module.html"><code>psycopg2.extras</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extras.DictCursor-class.html"><code>DictCursor</code></a></td> + <td>Class in module <a href="psycopg2.extras-module.html"><code>psycopg2.extras</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.psycopg1.cursor-class.html#dictfetchall"><code>dictfetchall</code></a></td> + <td>Method in class <a href="psycopg2.psycopg1.cursor-class.html"><code>psycopg2.psycopg1.cursor</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.psycopg1.cursor-class.html#dictfetchmany"><code>dictfetchmany</code></a></td> + <td>Method in class <a href="psycopg2.psycopg1.cursor-class.html"><code>psycopg2.psycopg1.cursor</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.psycopg1.cursor-class.html#dictfetchone"><code>dictfetchone</code></a></td> + <td>Method in class <a href="psycopg2.psycopg1.cursor-class.html"><code>psycopg2.psycopg1.cursor</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extras.DictRow-class.html"><code>DictRow</code></a></td> + <td>Class in module <a href="psycopg2.extras-module.html"><code>psycopg2.extras</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#dsn"><code>dsn</code></a></td> + <td>member_descriptor in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr> + <tr><td width="15%"><a href="datetime.tzinfo-class.html#dst"><code>dst</code></a></td> + <td>Method in class <a href="datetime.tzinfo-class.html"><code>datetime.tzinfo</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.tz.FixedOffsetTimezone-class.html#dst"><code>dst</code></a></td> + <td>Method in class <a href="psycopg2.tz.FixedOffsetTimezone-class.html"><code>psycopg2.tz.FixedOffsetTimezone</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.tz.LocalTimezone-class.html#dst"><code>dst</code></a></td> + <td>Method in class <a href="psycopg2.tz.LocalTimezone-class.html"><code>psycopg2.tz.LocalTimezone</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.tz-module.html#DSTDIFF"><code>DSTDIFF</code></a></td> + <td>Variable in module <a href="psycopg2.tz-module.html"><code>psycopg2.tz</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#encoding"><code>encoding</code></a></td> + <td>member_descriptor in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#encodings"><code>encodings</code></a></td> + <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.Error-class.html"><code>Error</code></a></td> + <td>Class in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#Error"><code>Error</code></a></td> + <td>member_descriptor in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr> + <tr><td width="15%"><a href="exceptions.Exception-class.html"><code>Exception</code></a></td> + <td>Class in module <code>exceptions</code></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#execute"><code>execute</code></a></td> + <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extras.DictCursor-class.html#execute"><code>execute</code></a></td> + <td>Method in class <a href="psycopg2.extras.DictCursor-class.html"><code>psycopg2.extras.DictCursor</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#executemany"><code>executemany</code></a></td> + <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#extend"><code>extend</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extensions-module.html"><code>extensions</code></a></td> + <td>Module in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extras-module.html"><code>extras</code></a></td> + <td>Module in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#fetchall"><code>fetchall</code></a></td> + <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extras.DictCursor-class.html#fetchall"><code>fetchall</code></a></td> + <td>Method in class <a href="psycopg2.extras.DictCursor-class.html"><code>psycopg2.extras.DictCursor</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#fetchmany"><code>fetchmany</code></a></td> + <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extras.DictCursor-class.html#fetchmany"><code>fetchmany</code></a></td> + <td>Method in class <a href="psycopg2.extras.DictCursor-class.html"><code>psycopg2.extras.DictCursor</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#fetchone"><code>fetchone</code></a></td> + <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extras.DictCursor-class.html#fetchone"><code>fetchone</code></a></td> + <td>Method in class <a href="psycopg2.extras.DictCursor-class.html"><code>psycopg2.extras.DictCursor</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#fileno"><code>fileno</code></a></td> + <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.tz.FixedOffsetTimezone-class.html"><code>FixedOffsetTimezone</code></a></td> + <td>Class in module <a href="psycopg2.tz-module.html"><code>psycopg2.tz</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#FLOAT"><code>FLOAT</code></a></td> + <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#FLOATARRAY"><code>FLOATARRAY</code></a></td> + <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="datetime.tzinfo-class.html#fromutc"><code>fromutc</code></a></td> + <td>Method in class <a href="datetime.tzinfo-class.html"><code>datetime.tzinfo</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extras.DictRow-class.html#get"><code>get</code></a></td> + <td>Method in class <a href="psycopg2.extras.DictRow-class.html"><code>psycopg2.extras.DictRow</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.ISQLQuote-class.html#getbinary"><code>getbinary</code></a></td> + <td>Method in class <a href="../private/psycopg2._psycopg.ISQLQuote-class.html"><code>psycopg2._psycopg.ISQLQuote</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.ISQLQuote-class.html#getbuffer"><code>getbuffer</code></a></td> + <td>Method in class <a href="../private/psycopg2._psycopg.ISQLQuote-class.html"><code>psycopg2._psycopg.ISQLQuote</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.pool.PersistentConnectionPool-class.html#getconn"><code>getconn</code></a></td> + <td>Method in class <a href="psycopg2.pool.PersistentConnectionPool-class.html"><code>psycopg2.pool.PersistentConnectionPool</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.pool.ThreadedConnectionPool-class.html#getconn"><code>getconn</code></a></td> + <td>Method in class <a href="psycopg2.pool.ThreadedConnectionPool-class.html"><code>psycopg2.pool.ThreadedConnectionPool</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.ISQLQuote-class.html#getquoted"><code>getquoted</code></a></td> + <td>Method in class <a href="../private/psycopg2._psycopg.ISQLQuote-class.html"><code>psycopg2._psycopg.ISQLQuote</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extras.SQL_IN-class.html#getquoted"><code>getquoted</code></a></td> + <td>Method in class <a href="psycopg2.extras.SQL_IN-class.html"><code>psycopg2.extras.SQL_IN</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extras.DictRow-class.html#has_key"><code>has_key</code></a></td> + <td>Method in class <a href="psycopg2.extras.DictRow-class.html"><code>psycopg2.extras.DictRow</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#index"><code>index</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#insert"><code>insert</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#INTEGER"><code>INTEGER</code></a></td> + <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#INTEGERARRAY"><code>INTEGERARRAY</code></a></td> + <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.IntegrityError-class.html"><code>IntegrityError</code></a></td> + <td>Class in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#IntegrityError"><code>IntegrityError</code></a></td> + <td>member_descriptor in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.InterfaceError-class.html"><code>InterfaceError</code></a></td> + <td>Class in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#InterfaceError"><code>InterfaceError</code></a></td> + <td>member_descriptor in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.InternalError-class.html"><code>InternalError</code></a></td> + <td>Class in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#InternalError"><code>InternalError</code></a></td> + <td>member_descriptor in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#INTERVAL"><code>INTERVAL</code></a></td> + <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#INTERVALARRAY"><code>INTERVALARRAY</code></a></td> + <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extensions-module.html#IntervalFromPy"><code>IntervalFromPy</code></a></td> + <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#isolation_level"><code>isolation_level</code></a></td> + <td>member_descriptor in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extensions-module.html#ISOLATION_LEVEL_AUTOCOMMIT"><code>ISOLATION_LEVEL_AUTOCOMMIT</code></a></td> + <td>Variable in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extensions-module.html#ISOLATION_LEVEL_READ_COMMITTED"><code>ISOLATION_LEVEL_READ_COMMITTED</code></a></td> + <td>Variable in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extensions-module.html#ISOLATION_LEVEL_READ_UNCOMMITTED"><code>ISOLATION_LEVEL_READ_UNCOMMITTED</code></a></td> + <td>Variable in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extensions-module.html#ISOLATION_LEVEL_REPEATABLE_READ"><code>ISOLATION_LEVEL_REPEATABLE_READ</code></a></td> + <td>Variable in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extensions-module.html#ISOLATION_LEVEL_SERIALIZABLE"><code>ISOLATION_LEVEL_SERIALIZABLE</code></a></td> + <td>Variable in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.ISQLQuote-class.html"><code>ISQLQuote</code></a></td> + <td>Class in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#isready"><code>isready</code></a></td> + <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extras.DictRow-class.html#items"><code>items</code></a></td> + <td>Method in class <a href="psycopg2.extras.DictRow-class.html"><code>psycopg2.extras.DictRow</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extras.DictRow-class.html#keys"><code>keys</code></a></td> + <td>Method in class <a href="psycopg2.extras.DictRow-class.html"><code>psycopg2.extras.DictRow</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#lastrowid"><code>lastrowid</code></a></td> + <td>member_descriptor in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html"><code>list</code></a></td> + <td>Class in module <code>__builtin__</code></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#List"><code>List</code></a></td> + <td>Function in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.tz-module.html#LOCAL"><code>LOCAL</code></a></td> + <td>Variable in module <a href="psycopg2.tz-module.html"><code>psycopg2.tz</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.tz.LocalTimezone-class.html"><code>LocalTimezone</code></a></td> + <td>Class in module <a href="psycopg2.tz-module.html"><code>psycopg2.tz</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#LONGINTEGER"><code>LONGINTEGER</code></a></td> + <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#LONGINTEGERARRAY"><code>LONGINTEGERARRAY</code></a></td> + <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#mogrify"><code>mogrify</code></a></td> + <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.type-class.html#mro"><code>mro</code></a></td> + <td>Method in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#name"><code>name</code></a></td> + <td>member_descriptor in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extensions-module.html#new_type"><code>new_type</code></a></td> + <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#next"><code>next</code></a></td> + <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#nextset"><code>nextset</code></a></td> + <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#notices"><code>notices</code></a></td> + <td>member_descriptor in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#notifies"><code>notifies</code></a></td> + <td>member_descriptor in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.NotSupportedError-class.html"><code>NotSupportedError</code></a></td> + <td>Class in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#NotSupportedError"><code>NotSupportedError</code></a></td> + <td>member_descriptor in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#NUMBER"><code>NUMBER</code></a></td> + <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.object-class.html"><code>object</code></a></td> + <td>Class in module <code>__builtin__</code></td></tr> + <tr><td width="15%"><a href="psycopg2.OperationalError-class.html"><code>OperationalError</code></a></td> + <td>Class in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#OperationalError"><code>OperationalError</code></a></td> + <td>member_descriptor in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#paramstyle"><code>paramstyle</code></a></td> + <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.pool.PersistentConnectionPool-class.html"><code>PersistentConnectionPool</code></a></td> + <td>Class in module <a href="psycopg2.pool-module.html"><code>psycopg2.pool</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.pool-module.html"><code>pool</code></a></td> + <td>Module in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.pool.PoolError-class.html"><code>PoolError</code></a></td> + <td>Class in module <a href="psycopg2.pool-module.html"><code>psycopg2.pool</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#pop"><code>pop</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.ProgrammingError-class.html"><code>ProgrammingError</code></a></td> + <td>Class in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#ProgrammingError"><code>ProgrammingError</code></a></td> + <td>member_descriptor in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.psycopg1-module.html"><code>psycopg1</code></a></td> + <td>Module in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2-module.html"><code>psycopg2</code></a></td> + <td>Package</td></tr> + <tr><td width="15%"><a href="psycopg2.pool.PersistentConnectionPool-class.html#putconn"><code>putconn</code></a></td> + <td>Method in class <a href="psycopg2.pool.PersistentConnectionPool-class.html"><code>psycopg2.pool.PersistentConnectionPool</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.pool.ThreadedConnectionPool-class.html#putconn"><code>putconn</code></a></td> + <td>Method in class <a href="psycopg2.pool.ThreadedConnectionPool-class.html"><code>psycopg2.pool.ThreadedConnectionPool</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#PYDATE"><code>PYDATE</code></a></td> + <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#PYDATETIME"><code>PYDATETIME</code></a></td> + <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#PYINTERVAL"><code>PYINTERVAL</code></a></td> + <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#PYTIME"><code>PYTIME</code></a></td> + <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#query"><code>query</code></a></td> + <td>member_descriptor in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extensions-module.html#QuotedString"><code>QuotedString</code></a></td> + <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extensions-module.html#register_adapter"><code>register_adapter</code></a></td> + <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extensions-module.html#register_type"><code>register_type</code></a></td> + <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#remove"><code>remove</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#reverse"><code>reverse</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#rollback"><code>rollback</code></a></td> + <td>Method in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#row_factory"><code>row_factory</code></a></td> + <td>member_descriptor in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#rowcount"><code>rowcount</code></a></td> + <td>member_descriptor in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#ROWID"><code>ROWID</code></a></td> + <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#ROWIDARRAY"><code>ROWIDARRAY</code></a></td> + <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#rownumber"><code>rownumber</code></a></td> + <td>member_descriptor in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#scroll"><code>scroll</code></a></td> + <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#set_client_encoding"><code>set_client_encoding</code></a></td> + <td>Method in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#set_isolation_level"><code>set_isolation_level</code></a></td> + <td>Method in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#setinputsizes"><code>setinputsizes</code></a></td> + <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#setoutputsize"><code>setoutputsize</code></a></td> + <td>Method in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.pool.SimpleConnectionPool-class.html"><code>SimpleConnectionPool</code></a></td> + <td>Class in module <a href="psycopg2.pool-module.html"><code>psycopg2.pool</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#sort"><code>sort</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extras.SQL_IN-class.html"><code>SQL_IN</code></a></td> + <td>Class in module <a href="psycopg2.extras-module.html"><code>psycopg2.extras</code></a></td></tr> + <tr><td width="15%"><a href="exceptions.StandardError-class.html"><code>StandardError</code></a></td> + <td>Class in module <code>exceptions</code></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#statusmessage"><code>statusmessage</code></a></td> + <td>member_descriptor in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.tz-module.html#STDOFFSET"><code>STDOFFSET</code></a></td> + <td>Variable in module <a href="psycopg2.tz-module.html"><code>psycopg2.tz</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#STRING"><code>STRING</code></a></td> + <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#string_types"><code>string_types</code></a></td> + <td>member_descriptor in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#string_types"><code>string_types</code></a></td> + <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#STRINGARRAY"><code>STRINGARRAY</code></a></td> + <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.pool.ThreadedConnectionPool-class.html"><code>ThreadedConnectionPool</code></a></td> + <td>Class in module <a href="psycopg2.pool-module.html"><code>psycopg2.pool</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#threadsafety"><code>threadsafety</code></a></td> + <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2-module.html#Time"><code>Time</code></a></td> + <td>Function in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#TIME"><code>TIME</code></a></td> + <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#TIMEARRAY"><code>TIMEARRAY</code></a></td> + <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extensions-module.html#TimeFromPy"><code>TimeFromPy</code></a></td> + <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2-module.html#TimeFromTicks"><code>TimeFromTicks</code></a></td> + <td>Function in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2-module.html#Timestamp"><code>Timestamp</code></a></td> + <td>Function in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extensions-module.html#TimestampFromPy"><code>TimestampFromPy</code></a></td> + <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2-module.html#TimestampFromTicks"><code>TimestampFromTicks</code></a></td> + <td>Function in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.type-class.html"><code>type</code></a></td> + <td>Class in module <code>__builtin__</code></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#typecaster"><code>typecaster</code></a></td> + <td>member_descriptor in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.tz-module.html"><code>tz</code></a></td> + <td>Module in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="datetime.tzinfo-class.html"><code>tzinfo</code></a></td> + <td>Class in module <code>datetime</code></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.cursor-class.html#tzinfo_factory"><code>tzinfo_factory</code></a></td> + <td>member_descriptor in class <a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></td></tr> + <tr><td width="15%"><a href="datetime.tzinfo-class.html#tzname"><code>tzname</code></a></td> + <td>Method in class <a href="datetime.tzinfo-class.html"><code>datetime.tzinfo</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.tz.FixedOffsetTimezone-class.html#tzname"><code>tzname</code></a></td> + <td>Method in class <a href="psycopg2.tz.FixedOffsetTimezone-class.html"><code>psycopg2.tz.FixedOffsetTimezone</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.tz.LocalTimezone-class.html#tzname"><code>tzname</code></a></td> + <td>Method in class <a href="psycopg2.tz.LocalTimezone-class.html"><code>psycopg2.tz.LocalTimezone</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#UNICODE"><code>UNICODE</code></a></td> + <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg-module.html#UNICODEARRAY"><code>UNICODEARRAY</code></a></td> + <td>Variable in module <a href="../private/psycopg2._psycopg-module.html"><code>psycopg2._psycopg</code></a></td></tr> + <tr><td width="15%"><a href="datetime.tzinfo-class.html#utcoffset"><code>utcoffset</code></a></td> + <td>Method in class <a href="datetime.tzinfo-class.html"><code>datetime.tzinfo</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.tz.FixedOffsetTimezone-class.html#utcoffset"><code>utcoffset</code></a></td> + <td>Method in class <a href="psycopg2.tz.FixedOffsetTimezone-class.html"><code>psycopg2.tz.FixedOffsetTimezone</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.tz.LocalTimezone-class.html#utcoffset"><code>utcoffset</code></a></td> + <td>Method in class <a href="psycopg2.tz.LocalTimezone-class.html"><code>psycopg2.tz.LocalTimezone</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extras.DictRow-class.html#values"><code>values</code></a></td> + <td>Method in class <a href="psycopg2.extras.DictRow-class.html"><code>psycopg2.extras.DictRow</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.Warning-class.html"><code>Warning</code></a></td> + <td>Class in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="../private/psycopg2._psycopg.connection-class.html#Warning"><code>Warning</code></a></td> + <td>member_descriptor in class <a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.tz-module.html#ZERO"><code>ZERO</code></a></td> + <td>Variable in module <a href="psycopg2.tz-module.html"><code>psycopg2.tz</code></a></td></tr> +</table> +<br /> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th bgcolor="#70b0f0" class="navselect"> Index </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:37 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/private/psycopg2-module.html b/psycopg2/doc/api/private/psycopg2-module.html new file mode 100644 index 00000000..dd7e92d5 --- /dev/null +++ b/psycopg2/doc/api/private/psycopg2-module.html @@ -0,0 +1,336 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th bgcolor="#70b0f0" class="navselect"> Home </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + Package psycopg2 + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2-module.html">hide private</a>]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2-module.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF PACKAGE DESCRIPTION =========== --> +<h2 class="package">Package psycopg2</h2> + +<p>A Python driver for PostgreSQL</p> +<p>psycopg is a <a class="reference" href="http://www.postgresql.org/">PostgreSQL</a> database adapter for the <a class="reference" href="http://www.python.org/">Python</a> programming +language. This is version 2, a complete rewrite of the original code to +provide new-style classes for connection and cursor objects and other sweet +candies. Like the original, psycopg 2 was written with the aim of being very +small and fast, and stable as a rock.</p> +<p>Homepage: <a class="reference" href="http://initd.org/projects/psycopg2">http://initd.org/projects/psycopg2</a></p> +<hr/> + +<!-- =========== START OF SUBMODULES =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Submodules</th></tr> + <tr><td><ul> +<li> <strong class="uidlink"><a href="psycopg2.extensions-module.html"><code>extensions</code></a></strong>: <em class="summary">psycopg extensions to the DBAPI-2.0</em></li> +<li> <strong class="uidlink"><a href="psycopg2.extras-module.html"><code>extras</code></a></strong>: <em class="summary">Miscellaneous goodies for psycopg2</em></li> +<li> <strong class="uidlink"><a href="psycopg2.pool-module.html"><code>pool</code></a></strong>: <em class="summary">Connection pooling for psycopg2</em></li> +<li> <strong class="uidlink"><a href="psycopg2.psycopg1-module.html"><code>psycopg1</code></a></strong>: <em class="summary">psycopg 1.1.x compatibility module</em></li> +<li> <strong class="uidlink"><a href="psycopg2.tz-module.html"><code>tz</code></a></strong>: <em class="summary">tzinfo implementations for psycopg2</em></li> +<li> <strong class="uidlink"><a href="../private/psycopg2._psycopg-module.html"><code>_psycopg</code></a></strong>: <em class="summary">psycopg PostgreSQL driver</em></li> + </ul></td></tr> +</table><br /> + + +<!-- =========== START OF EXCEPTIONS =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Exceptions</th></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.DatabaseError-class.html"><code>DatabaseError</code></a></strong></td> + <td>Error related to the database engine.</td></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.DataError-class.html"><code>DataError</code></a></strong></td> + <td>Error related to problems with the processed data.</td></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.Error-class.html"><code>Error</code></a></strong></td> + <td>Base class for error exceptions.</td></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.IntegrityError-class.html"><code>IntegrityError</code></a></strong></td> + <td>Error related to database integrity.</td></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.InterfaceError-class.html"><code>InterfaceError</code></a></strong></td> + <td>Error related to the database interface.</td></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.InternalError-class.html"><code>InternalError</code></a></strong></td> + <td>The database encountered an internal error.</td></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.NotSupportedError-class.html"><code>NotSupportedError</code></a></strong></td> + <td>A not supported datbase API was called.</td></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.OperationalError-class.html"><code>OperationalError</code></a></strong></td> + <td>Error related to database operation (disconnect, memory allocation etc).</td></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.ProgrammingError-class.html"><code>ProgrammingError</code></a></strong></td> + <td>Error related to database programming (SQL error, table not found etc).</td></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.Warning-class.html"><code>Warning</code></a></strong></td> + <td>A database warning.</td></tr> +</table><br /> + + +<!-- =========== START OF FUNCTION SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Function Summary</th></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Connections creation</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"><a href="../private/psycopg2._psycopg.connection-class.html" class="link"><code>extensions.connection</code></a></td> + <td><code><span class="summary-sig"><a href="psycopg2-module.html#connect" class="summary-sig-name"><code>connect</code></a>(<span class="summary-sig-arg">dsn</span>, + <span class="summary-sig-vararg">...</span>)</span></code> +<br /> +Create a new database connection.</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Value objects constructors</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">new binary object</td> + <td><code><span class="summary-sig"><a href="psycopg2-module.html#Binary" class="summary-sig-name"><code>Binary</code></a>(<span class="summary-sig-arg">buffer</span>)</span></code> +<br /> +Build an object capable to hold a bynary string value.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">new date</td> + <td><code><span class="summary-sig"><a href="psycopg2-module.html#Date" class="summary-sig-name"><code>Date</code></a>(<span class="summary-sig-arg">year</span>, + <span class="summary-sig-arg">month</span>, + <span class="summary-sig-arg">day</span>)</span></code> +<br /> +Build an object holding a date value.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">new date</td> + <td><code><span class="summary-sig"><a href="psycopg2-module.html#DateFromTicks" class="summary-sig-name"><code>DateFromTicks</code></a>(<span class="summary-sig-arg">ticks</span>)</span></code> +<br /> +Build an object holding a date value from the given ticks value.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">new time</td> + <td><code><span class="summary-sig"><a href="psycopg2-module.html#Time" class="summary-sig-name"><code>Time</code></a>(<span class="summary-sig-arg">hour</span>, + <span class="summary-sig-arg">minutes</span>, + <span class="summary-sig-arg">seconds</span>, + <span class="summary-sig-arg">tzinfo</span>)</span></code> +<br /> +Build an object holding a time value.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">new time</td> + <td><code><span class="summary-sig"><a href="psycopg2-module.html#TimeFromTicks" class="summary-sig-name"><code>TimeFromTicks</code></a>(<span class="summary-sig-arg">ticks</span>)</span></code> +<br /> +Build an object holding a time value from the given ticks value.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">new timestamp</td> + <td><code><span class="summary-sig"><a href="psycopg2-module.html#Timestamp" class="summary-sig-name"><code>Timestamp</code></a>(<span class="summary-sig-arg">year</span>, + <span class="summary-sig-arg">month</span>, + <span class="summary-sig-arg">day</span>, + <span class="summary-sig-arg">hour</span>, + <span class="summary-sig-arg">minutes</span>, + <span class="summary-sig-arg">seconds</span>, + <span class="summary-sig-arg">tzinfo</span>)</span></code> +<br /> +Build an object holding a timestamp value.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">new timestamp</td> + <td><code><span class="summary-sig"><a href="psycopg2-module.html#TimestampFromTicks" class="summary-sig-name"><code>TimestampFromTicks</code></a>(<span class="summary-sig-arg">ticks</span>)</span></code> +<br /> +Build an object holding a timestamp value from the given ticks value.</td></tr> +</table><br /> + + +<!-- =========== START OF FUNCTION DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Function Details</th></tr> +</table> + +<a name="connect"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">connect</span>(<span class="sig-arg">dsn</span>, + <span class="sig-vararg">...</span>)</span> + </h3> +<p>Create a new database connection.</p> +<p>This function supports two different but equivalent sets of arguments. +A single data source name or <tt class="docutils literal"><span class="pre">dsn</span></tt> string can be used to specify the +connection parameters, as follows:</p> +<pre class="literal-block"> +psycopg2.connect("dbname=xxx user=xxx ...") +</pre> +<p>If <tt class="docutils literal"><span class="pre">dsn</span></tt> is not provided it is possible to pass the parameters as +keyword arguments; e.g.:</p> +<pre class="literal-block"> +psycopg2.connect(database='xxx', user='xxx', ...) +</pre> +<p>The full list of available parameters is:</p> +<ul class="rst-simple"> +<li><tt class="docutils literal"><span class="pre">dbname</span></tt> -- database name (only in 'dsn')</li> +<li><tt class="docutils literal"><span class="pre">database</span></tt> -- database name (only as keyword argument)</li> +<li><tt class="docutils literal"><span class="pre">host</span></tt> -- host address (defaults to UNIX socket if not provided)</li> +<li><tt class="docutils literal"><span class="pre">port</span></tt> -- port number (defaults to 5432 if not provided)</li> +<li><tt class="docutils literal"><span class="pre">user</span></tt> -- user name used to authenticate</li> +<li><tt class="docutils literal"><span class="pre">password</span></tt> -- password used to authenticate</li> +<li><tt class="docutils literal"><span class="pre">sslmode</span></tt> -- SSL mode (see PostgreSQL documentation)</li> +</ul> +<p>If the <tt class="docutils literal"><span class="pre">connection_factory</span></tt> keyword argument is not provided this +function always return an instance of the <code>connection</code> class. +Else the given sub-class of <a href="../private/psycopg2._psycopg.connection-class.html" class="link"><code>extensions.connection</code></a> will be used to +instantiate the connection object.</p> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +New database connection <br /><em> + (type=<a href="../private/psycopg2._psycopg.connection-class.html" class="link"><code>extensions.connection</code></a>)</em> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="Binary"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">Binary</span>(<span class="sig-arg">buffer</span>)</span> + </h3> +<p>Build an object capable to hold a bynary string value.</p> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +new binary object </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="Date"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">Date</span>(<span class="sig-arg">year</span>, + <span class="sig-arg">month</span>, + <span class="sig-arg">day</span>)</span> + </h3> +<p>Build an object holding a date value.</p> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +new date </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="DateFromTicks"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">DateFromTicks</span>(<span class="sig-arg">ticks</span>)</span> + </h3> +<p>Build an object holding a date value from the given ticks value.</p> +<p>Ticks are the number of seconds since the epoch; see the documentation of the standard Python time module for details).</p> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +new date </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="Time"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">Time</span>(<span class="sig-arg">hour</span>, + <span class="sig-arg">minutes</span>, + <span class="sig-arg">seconds</span>, + <span class="sig-arg">tzinfo</span>=<span class="sig-default">None</span>)</span> + </h3> +<p>Build an object holding a time value.</p> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +new time </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="TimeFromTicks"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">TimeFromTicks</span>(<span class="sig-arg">ticks</span>)</span> + </h3> +<p>Build an object holding a time value from the given ticks value.</p> +<p>Ticks are the number of seconds since the epoch; see the documentation of the standard Python time module for details).</p> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +new time </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="Timestamp"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">Timestamp</span>(<span class="sig-arg">year</span>, + <span class="sig-arg">month</span>, + <span class="sig-arg">day</span>, + <span class="sig-arg">hour</span>, + <span class="sig-arg">minutes</span>, + <span class="sig-arg">seconds</span>, + <span class="sig-arg">tzinfo</span>=<span class="sig-default">None</span>)</span> + </h3> +<p>Build an object holding a timestamp value.</p> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +new timestamp </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="TimestampFromTicks"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">TimestampFromTicks</span>(<span class="sig-arg">ticks</span>)</span> + </h3> +<p>Build an object holding a timestamp value from the given ticks value.</p> +<p>Ticks are the number of seconds since the epoch; see the documentation of the standard Python time module for details).</p> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +new timestamp </dd> + </dl> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th bgcolor="#70b0f0" class="navselect"> Home </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:35 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/private/psycopg2.DataError-class.html b/psycopg2/doc/api/private/psycopg2.DataError-class.html new file mode 100644 index 00000000..58054006 --- /dev/null +++ b/psycopg2/doc/api/private/psycopg2.DataError-class.html @@ -0,0 +1,103 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.DataError</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + Class DataError + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.DataError-class.html">hide private</a>]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.DataError-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Class DataError</h2> + +<pre class="base-tree"> +<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ + | +<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+ + | + <a href="psycopg2.Error-class.html"><code>Error</code></a> --+ + | + <a href="psycopg2.DatabaseError-class.html"><code>DatabaseError</code></a> --+ + | + <strong class="uidshort">DataError</strong> +</pre><br /> + +<hr/> + +<p>Error related to problems with the processed data.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from Exception</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +</table><br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/private/psycopg2.DatabaseError-class.html b/psycopg2/doc/api/private/psycopg2.DatabaseError-class.html new file mode 100644 index 00000000..adc28d4a --- /dev/null +++ b/psycopg2/doc/api/private/psycopg2.DatabaseError-class.html @@ -0,0 +1,110 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.DatabaseError</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + Class DatabaseError + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.DatabaseError-class.html">hide private</a>]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.DatabaseError-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Class DatabaseError</h2> + +<pre class="base-tree"> +<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ + | +<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+ + | + <a href="psycopg2.Error-class.html"><code>Error</code></a> --+ + | + <strong class="uidshort">DatabaseError</strong> +</pre><br /> + +<dl><dt>Known Subclasses:</dt> +<dd> + <a href="psycopg2.DataError-class.html"><code>DataError</code></a>, + <a href="psycopg2.IntegrityError-class.html"><code>IntegrityError</code></a>, + <a href="psycopg2.InternalError-class.html"><code>InternalError</code></a>, + <a href="psycopg2.NotSupportedError-class.html"><code>NotSupportedError</code></a>, + <a href="psycopg2.OperationalError-class.html"><code>OperationalError</code></a>, + <a href="psycopg2.ProgrammingError-class.html"><code>ProgrammingError</code></a></dd></dl> + +<hr/> + +<p>Error related to the database engine.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from Exception</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +</table><br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:34 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/private/psycopg2.Error-class.html b/psycopg2/doc/api/private/psycopg2.Error-class.html new file mode 100644 index 00000000..33bff571 --- /dev/null +++ b/psycopg2/doc/api/private/psycopg2.Error-class.html @@ -0,0 +1,105 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.Error</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + Class Error + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.Error-class.html">hide private</a>]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.Error-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Class Error</h2> + +<pre class="base-tree"> +<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ + | +<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+ + | + <strong class="uidshort">Error</strong> +</pre><br /> + +<dl><dt>Known Subclasses:</dt> +<dd> + <a href="psycopg2.DatabaseError-class.html"><code>DatabaseError</code></a>, + <a href="psycopg2.InterfaceError-class.html"><code>InterfaceError</code></a>, + <a href="psycopg2.pool.PoolError-class.html"><code>PoolError</code></a></dd></dl> + +<hr/> + +<p>Base class for error exceptions.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from Exception</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +</table><br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/private/psycopg2.IntegrityError-class.html b/psycopg2/doc/api/private/psycopg2.IntegrityError-class.html new file mode 100644 index 00000000..c1804f67 --- /dev/null +++ b/psycopg2/doc/api/private/psycopg2.IntegrityError-class.html @@ -0,0 +1,103 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.IntegrityError</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + Class IntegrityError + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.IntegrityError-class.html">hide private</a>]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.IntegrityError-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Class IntegrityError</h2> + +<pre class="base-tree"> +<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ + | +<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+ + | + <a href="psycopg2.Error-class.html"><code>Error</code></a> --+ + | + <a href="psycopg2.DatabaseError-class.html"><code>DatabaseError</code></a> --+ + | + <strong class="uidshort">IntegrityError</strong> +</pre><br /> + +<hr/> + +<p>Error related to database integrity.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from Exception</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +</table><br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:34 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/private/psycopg2.InterfaceError-class.html b/psycopg2/doc/api/private/psycopg2.InterfaceError-class.html new file mode 100644 index 00000000..099ee901 --- /dev/null +++ b/psycopg2/doc/api/private/psycopg2.InterfaceError-class.html @@ -0,0 +1,101 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.InterfaceError</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + Class InterfaceError + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.InterfaceError-class.html">hide private</a>]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.InterfaceError-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Class InterfaceError</h2> + +<pre class="base-tree"> +<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ + | +<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+ + | + <a href="psycopg2.Error-class.html"><code>Error</code></a> --+ + | + <strong class="uidshort">InterfaceError</strong> +</pre><br /> + +<hr/> + +<p>Error related to the database interface.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from Exception</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +</table><br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:34 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/private/psycopg2.InternalError-class.html b/psycopg2/doc/api/private/psycopg2.InternalError-class.html new file mode 100644 index 00000000..5390de5e --- /dev/null +++ b/psycopg2/doc/api/private/psycopg2.InternalError-class.html @@ -0,0 +1,103 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.InternalError</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + Class InternalError + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.InternalError-class.html">hide private</a>]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.InternalError-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Class InternalError</h2> + +<pre class="base-tree"> +<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ + | +<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+ + | + <a href="psycopg2.Error-class.html"><code>Error</code></a> --+ + | + <a href="psycopg2.DatabaseError-class.html"><code>DatabaseError</code></a> --+ + | + <strong class="uidshort">InternalError</strong> +</pre><br /> + +<hr/> + +<p>The database encountered an internal error.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from Exception</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +</table><br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:34 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/private/psycopg2.NotSupportedError-class.html b/psycopg2/doc/api/private/psycopg2.NotSupportedError-class.html new file mode 100644 index 00000000..c677f5b7 --- /dev/null +++ b/psycopg2/doc/api/private/psycopg2.NotSupportedError-class.html @@ -0,0 +1,103 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.NotSupportedError</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + Class NotSupportedError + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.NotSupportedError-class.html">hide private</a>]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.NotSupportedError-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Class NotSupportedError</h2> + +<pre class="base-tree"> +<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ + | +<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+ + | + <a href="psycopg2.Error-class.html"><code>Error</code></a> --+ + | + <a href="psycopg2.DatabaseError-class.html"><code>DatabaseError</code></a> --+ + | + <strong class="uidshort">NotSupportedError</strong> +</pre><br /> + +<hr/> + +<p>A not supported datbase API was called.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from Exception</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +</table><br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/private/psycopg2.OperationalError-class.html b/psycopg2/doc/api/private/psycopg2.OperationalError-class.html new file mode 100644 index 00000000..6cca463e --- /dev/null +++ b/psycopg2/doc/api/private/psycopg2.OperationalError-class.html @@ -0,0 +1,103 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.OperationalError</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + Class OperationalError + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.OperationalError-class.html">hide private</a>]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.OperationalError-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Class OperationalError</h2> + +<pre class="base-tree"> +<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ + | +<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+ + | + <a href="psycopg2.Error-class.html"><code>Error</code></a> --+ + | + <a href="psycopg2.DatabaseError-class.html"><code>DatabaseError</code></a> --+ + | + <strong class="uidshort">OperationalError</strong> +</pre><br /> + +<hr/> + +<p>Error related to database operation (disconnect, memory allocation etc).</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from Exception</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +</table><br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:35 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/private/psycopg2.ProgrammingError-class.html b/psycopg2/doc/api/private/psycopg2.ProgrammingError-class.html new file mode 100644 index 00000000..9fcd4efa --- /dev/null +++ b/psycopg2/doc/api/private/psycopg2.ProgrammingError-class.html @@ -0,0 +1,103 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.ProgrammingError</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + Class ProgrammingError + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.ProgrammingError-class.html">hide private</a>]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.ProgrammingError-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Class ProgrammingError</h2> + +<pre class="base-tree"> +<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ + | +<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+ + | + <a href="psycopg2.Error-class.html"><code>Error</code></a> --+ + | + <a href="psycopg2.DatabaseError-class.html"><code>DatabaseError</code></a> --+ + | + <strong class="uidshort">ProgrammingError</strong> +</pre><br /> + +<hr/> + +<p>Error related to database programming (SQL error, table not found etc).</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from Exception</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +</table><br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:35 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/private/psycopg2.Warning-class.html b/psycopg2/doc/api/private/psycopg2.Warning-class.html new file mode 100644 index 00000000..741c9a7c --- /dev/null +++ b/psycopg2/doc/api/private/psycopg2.Warning-class.html @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.Warning</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + Class Warning + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.Warning-class.html">hide private</a>]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.Warning-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Class Warning</h2> + +<pre class="base-tree"> +<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ + | +<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+ + | + <strong class="uidshort">Warning</strong> +</pre><br /> + +<hr/> + +<p>A database warning.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from Exception</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +</table><br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/private/psycopg2._psycopg-module.html b/psycopg2/doc/api/private/psycopg2._psycopg-module.html new file mode 100644 index 00000000..6e4cb253 --- /dev/null +++ b/psycopg2/doc/api/private/psycopg2._psycopg-module.html @@ -0,0 +1,1072 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2._psycopg</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + Module _psycopg + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<strong>show private</strong> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="../private/psycopg2._psycopg-module.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF MODULE DESCRIPTION =========== --> +<h2 class="module">Module psycopg2._psycopg</h2> + +<p>psycopg PostgreSQL driver</p> +<hr/> + +<!-- =========== START OF CLASSES =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Classes</th></tr> +<tr><td width="15%"> + <strong><a href="../private/psycopg2._psycopg.connection-class.html"><code>connection</code></a></strong></td> + <td>connection(dsn, ...) -> new connection object</td></tr> +<tr><td width="15%"> + <strong><a href="../private/psycopg2._psycopg.cursor-class.html"><code>cursor</code></a></strong></td> + <td>A database cursor.</td></tr> +<tr><td width="15%"> + <strong><a href="../private/psycopg2._psycopg.ISQLQuote-class.html"><code>ISQLQuote</code></a></strong></td> + <td>Abstract ISQLQuote protocol</td></tr> +</table><br /> + + +<!-- =========== START OF FUNCTION SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Function Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">new quoted list</td> + <td><code><a name="List"></a><span class="summary-sig"><span class="summary-sig-name">List</span>(<span class="summary-sig-arg">list</span>, + <span class="summary-sig-arg">enc</span>)</span></code> +</td></tr> +</table><br /> + + +<!-- =========== START OF VARIABLE SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Variable Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>str</code></td> +<td><strong><a href="../private/psycopg2._psycopg-module.html#__version__"><code>__version__</code></a></strong> = <span title="'2.0b7 (dt ext pq3)'"><code><span class="variable-quote">'</span>2.0b7 (dt ext pq3)<span class="variable-quote">'</span> </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>PyCObject</code></td> +<td><strong><a href="../private/psycopg2._psycopg-module.html#_C_API"><code>_C_API</code></a></strong> = <span title="<PyCObject object at 0x0076A320>"><code><PyCObject object at 0x0076A320> </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>dict</code></td> +<td><strong><a href="../private/psycopg2._psycopg-module.html#adapters"><code>adapters</code></a></strong> = <span title="{(<type 'bool'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.Boolean'>, (<type 'list'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.List'>, (<type 'datetime.datetime'>, <type 'psycopg2._psycopg.ISQLQuote'>): <built-in function TimestampFromPy>, (<type 'buffer'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.Binary'>, (<type 'unicode'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.QuotedString'>, (<type 'datetime.date'>, <type 'psycopg2._psycopg.ISQLQuote'>): <built-in function DateFromPy>, (<type 'datetime.time'>, ..."><code>{(<type 'bool'>, <type 'psycopg2._psycopg.ISQ<span class="variable-ellipsis">...</span></code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>str</code></td> +<td><strong><a href="../private/psycopg2._psycopg-module.html#apilevel"><code>apilevel</code></a></strong> = <span title="'2.0'"><code><span class="variable-quote">'</span>2.0<span class="variable-quote">'</span> </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="../private/psycopg2._psycopg-module.html#BINARY"><code>BINARY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847A00>"><code><psycopg2._psycopg.type object at 0x00847A00> </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>dict</code></td> +<td><strong><a href="../private/psycopg2._psycopg-module.html#binary_types"><code>binary_types</code></a></strong> = <span title="{}"><code>{} </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="../private/psycopg2._psycopg-module.html#BINARYARRAY"><code>BINARYARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847CA0>"><code><psycopg2._psycopg.type object at 0x00847C<span class="variable-ellipsis">...</span></code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="../private/psycopg2._psycopg-module.html#BOOLEAN"><code>BOOLEAN</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847880>"><code><psycopg2._psycopg.type object at 0x00847880> </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="../private/psycopg2._psycopg-module.html#BOOLEANARRAY"><code>BOOLEANARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847BA0>"><code><psycopg2._psycopg.type object at 0x00847<span class="variable-ellipsis">...</span></code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="../private/psycopg2._psycopg-module.html#DATE"><code>DATE</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847960>"><code><psycopg2._psycopg.type object at 0x00847960> </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="../private/psycopg2._psycopg-module.html#DATEARRAY"><code>DATEARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847C20>"><code><psycopg2._psycopg.type object at 0x00847C20<span class="variable-ellipsis">...</span></code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="../private/psycopg2._psycopg-module.html#DATETIME"><code>DATETIME</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x008478C0>"><code><psycopg2._psycopg.type object at 0x008478C0> </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="../private/psycopg2._psycopg-module.html#DATETIMEARRAY"><code>DATETIMEARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847BC0>"><code><psycopg2._psycopg.type object at 0x0084<span class="variable-ellipsis">...</span></code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="../private/psycopg2._psycopg-module.html#DECIMAL"><code>DECIMAL</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x008477A0>"><code><psycopg2._psycopg.type object at 0x008477A0> </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="../private/psycopg2._psycopg-module.html#DECIMALARRAY"><code>DECIMALARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847B20>"><code><psycopg2._psycopg.type object at 0x00847<span class="variable-ellipsis">...</span></code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>dict</code></td> +<td><strong><a href="../private/psycopg2._psycopg-module.html#encodings"><code>encodings</code></a></strong> = <span title="{'UTF8': 'utf_8', 'LATIN-1': 'latin_1', 'SQL_ASCII': 'ascii', 'UNICODE': 'utf_8', 'LATIN1': 'latin_1'}"><code>{'UTF8': 'utf_8', 'LATIN-1': 'latin_1', 'SQL<span class="variable-ellipsis">...</span></code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="../private/psycopg2._psycopg-module.html#FLOAT"><code>FLOAT</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847740>"><code><psycopg2._psycopg.type object at 0x00847740> </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="../private/psycopg2._psycopg-module.html#FLOATARRAY"><code>FLOATARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847AE0>"><code><psycopg2._psycopg.type object at 0x00847AE<span class="variable-ellipsis">...</span></code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="../private/psycopg2._psycopg-module.html#INTEGER"><code>INTEGER</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847700>"><code><psycopg2._psycopg.type object at 0x00847700> </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="../private/psycopg2._psycopg-module.html#INTEGERARRAY"><code>INTEGERARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847AC0>"><code><psycopg2._psycopg.type object at 0x00847<span class="variable-ellipsis">...</span></code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="../private/psycopg2._psycopg-module.html#INTERVAL"><code>INTERVAL</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x008479A0>"><code><psycopg2._psycopg.type object at 0x008479A0> </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="../private/psycopg2._psycopg-module.html#INTERVALARRAY"><code>INTERVALARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847C60>"><code><psycopg2._psycopg.type object at 0x0084<span class="variable-ellipsis">...</span></code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="../private/psycopg2._psycopg-module.html#LONGINTEGER"><code>LONGINTEGER</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x008476C0>"><code><psycopg2._psycopg.type object at 0x008476<span class="variable-ellipsis">...</span></code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="../private/psycopg2._psycopg-module.html#LONGINTEGERARRAY"><code>LONGINTEGERARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847AA0>"><code><psycopg2._psycopg.type object at 0x0<span class="variable-ellipsis">...</span></code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="../private/psycopg2._psycopg-module.html#NUMBER"><code>NUMBER</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847680>"><code><psycopg2._psycopg.type object at 0x00847680> </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>str</code></td> +<td><strong><a href="../private/psycopg2._psycopg-module.html#paramstyle"><code>paramstyle</code></a></strong> = <span title="'pyformat'"><code><span class="variable-quote">'</span>pyformat<span class="variable-quote">'</span> </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="../private/psycopg2._psycopg-module.html#PYDATE"><code>PYDATE</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847DC0>"><code><psycopg2._psycopg.type object at 0x00847DC0> </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="../private/psycopg2._psycopg-module.html#PYDATETIME"><code>PYDATETIME</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847D20>"><code><psycopg2._psycopg.type object at 0x00847D2<span class="variable-ellipsis">...</span></code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="../private/psycopg2._psycopg-module.html#PYINTERVAL"><code>PYINTERVAL</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847DE0>"><code><psycopg2._psycopg.type object at 0x00847DE<span class="variable-ellipsis">...</span></code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="../private/psycopg2._psycopg-module.html#PYTIME"><code>PYTIME</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847D60>"><code><psycopg2._psycopg.type object at 0x00847D60> </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="../private/psycopg2._psycopg-module.html#ROWID"><code>ROWID</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847A60>"><code><psycopg2._psycopg.type object at 0x00847A60> </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="../private/psycopg2._psycopg-module.html#ROWIDARRAY"><code>ROWIDARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847CC0>"><code><psycopg2._psycopg.type object at 0x00847CC<span class="variable-ellipsis">...</span></code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="../private/psycopg2._psycopg-module.html#STRING"><code>STRING</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847820>"><code><psycopg2._psycopg.type object at 0x00847820> </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>dict</code></td> +<td><strong><a href="../private/psycopg2._psycopg-module.html#string_types"><code>string_types</code></a></strong> = <span title="{1028: <psycopg2._psycopg.type object at 0x00847CC0>, 1005: <psycopg2._psycopg.type object at 0x00847AC0>, 16: <psycopg2._psycopg.type object at 0x00847880>, 17: <psycopg2._psycopg.type object at 0x00847A00>, 1042: <psycopg2._psycopg.type object at 0x00847820>, 1043: <psycopg2._psycopg.type object at 0x00847820>, 20: <psycopg2._psycopg.type object at 0x008476C0>, 21: <psycopg2._psycopg.type object at 0x00847700>, 23: <psycopg2._psycopg.type object at 0x00847700>, 25: <psycopg2._psycopg.type object at 0x00847820>, 26: <psycopg2._psycopg.type object at 0x00847A60>, 1182: <psycopg2._psycopg.ty..."><code>{1028: <psycopg2._psycopg.type object at <span class="variable-ellipsis">...</span></code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="../private/psycopg2._psycopg-module.html#STRINGARRAY"><code>STRINGARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847B60>"><code><psycopg2._psycopg.type object at 0x00847B<span class="variable-ellipsis">...</span></code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>int</code></td> +<td><strong><a href="../private/psycopg2._psycopg-module.html#threadsafety"><code>threadsafety</code></a></strong> = <span title="2">2 </span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="../private/psycopg2._psycopg-module.html#TIME"><code>TIME</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847900>"><code><psycopg2._psycopg.type object at 0x00847900> </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="../private/psycopg2._psycopg-module.html#TIMEARRAY"><code>TIMEARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847BE0>"><code><psycopg2._psycopg.type object at 0x00847BE0<span class="variable-ellipsis">...</span></code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="../private/psycopg2._psycopg-module.html#UNICODE"><code>UNICODE</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x008477E0>"><code><psycopg2._psycopg.type object at 0x008477E0> </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="../private/psycopg2._psycopg-module.html#UNICODEARRAY"><code>UNICODEARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00847B40>"><code><psycopg2._psycopg.type object at 0x00847<span class="variable-ellipsis">...</span></code> +</span></td></tr> +</table><br /> + + +<!-- =========== START OF FUNCTION DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Function Details</th></tr> +</table> + +<a name="List"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">List</span>(<span class="sig-arg">list</span>, + <span class="sig-arg">enc</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +new quoted list </dd> + </dl> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF VARIABLE DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Variable Details</th></tr> +</table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="__version__"></a> +<h3>__version__</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>str</code> + + </dd> + <dt title="'2.0b7 (dt ext pq3)'">Value:</dt> + <dd title="'2.0b7 (dt ext pq3)'"><table><tr><td> +<pre class="variable"> +<span class="variable-quote">'</span>2.0b7 (dt ext pq3)<span class="variable-quote">'</span> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="_C_API"></a> +<h3>_C_API</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>PyCObject</code> + + </dd> + <dt title="<PyCObject object at 0x0076A320>">Value:</dt> + <dd title="<PyCObject object at 0x0076A320>"><table><tr><td> +<pre class="variable"> +<PyCObject object at 0x0076A320> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="adapters"></a> +<h3>adapters</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>dict</code> + + </dd> + <dt title="{(<type 'bool'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.Boolean'>, (<type 'list'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.List'>, (<type 'datetime.datetime'>, <type 'psycopg2._psycopg.ISQLQuote'>): <built-in function TimestampFromPy>, (<type 'buffer'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.Binary'>, (<type 'unicode'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.QuotedString'>, (<type 'datetime.date'>, <type 'psycopg2._psycopg.ISQLQuote'>): <built-in function DateFromPy>, (<type 'datetime.time'>, ...">Value:</dt> + <dd title="{(<type 'bool'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.Boolean'>, (<type 'list'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.List'>, (<type 'datetime.datetime'>, <type 'psycopg2._psycopg.ISQLQuote'>): <built-in function TimestampFromPy>, (<type 'buffer'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.Binary'>, (<type 'unicode'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.QuotedString'>, (<type 'datetime.date'>, <type 'psycopg2._psycopg.ISQLQuote'>): <built-in function DateFromPy>, (<type 'datetime.time'>, ..."><table><tr><td> +<pre class="variable"> +{(<type 'datetime.timedelta'>, <type 'psycopg2._psycopg.ISQLQuote'>): <span class="variable-linewrap">\</span> +<built-in function IntervalFromPy>, + (<type 'datetime.date'>, <type 'psycopg2._psycopg.ISQLQuote'>): <buil<span class="variable-linewrap">\</span> +t-in function DateFromPy>, + (<type 'datetime.time'>, <type 'psycopg2._psycopg.ISQLQuote'>): <buil<span class="variable-linewrap">\</span> +t-in function TimeFromPy>, + (<type 'datetime.datetime'>, <type 'psycopg2._psycopg.ISQLQuote'>): <<span class="variable-linewrap">\</span> +built-in function TimestampFromPy>, +<span class="variable-ellipsis">...</span> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="apilevel"></a> +<h3>apilevel</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>str</code> + + </dd> + <dt title="'2.0'">Value:</dt> + <dd title="'2.0'"><table><tr><td> +<pre class="variable"> +<span class="variable-quote">'</span>2.0<span class="variable-quote">'</span> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="BINARY"></a> +<h3>BINARY</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00847A00>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00847A00>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00847A00> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="binary_types"></a> +<h3>binary_types</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>dict</code> + + </dd> + <dt title="{}">Value:</dt> + <dd title="{}"><table><tr><td> +<pre class="variable"> +{} </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="BINARYARRAY"></a> +<h3>BINARYARRAY</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00847CA0>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00847CA0>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00847CA0> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="BOOLEAN"></a> +<h3>BOOLEAN</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00847880>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00847880>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00847880> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="BOOLEANARRAY"></a> +<h3>BOOLEANARRAY</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00847BA0>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00847BA0>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00847BA0> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="DATE"></a> +<h3>DATE</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00847960>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00847960>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00847960> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="DATEARRAY"></a> +<h3>DATEARRAY</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00847C20>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00847C20>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00847C20> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="DATETIME"></a> +<h3>DATETIME</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x008478C0>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x008478C0>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x008478C0> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="DATETIMEARRAY"></a> +<h3>DATETIMEARRAY</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00847BC0>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00847BC0>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00847BC0> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="DECIMAL"></a> +<h3>DECIMAL</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x008477A0>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x008477A0>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x008477A0> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="DECIMALARRAY"></a> +<h3>DECIMALARRAY</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00847B20>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00847B20>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00847B20> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="encodings"></a> +<h3>encodings</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>dict</code> + + </dd> + <dt title="{'UTF8': 'utf_8', 'LATIN-1': 'latin_1', 'SQL_ASCII': 'ascii', 'UNICODE': 'utf_8', 'LATIN1': 'latin_1'}">Value:</dt> + <dd title="{'UTF8': 'utf_8', 'LATIN-1': 'latin_1', 'SQL_ASCII': 'ascii', 'UNICODE': 'utf_8', 'LATIN1': 'latin_1'}"><table><tr><td> +<pre class="variable"> +{'LATIN-1': 'latin_1', + 'LATIN1': 'latin_1', + 'SQL_ASCII': 'ascii', + 'UNICODE': 'utf_8', + 'UTF8': 'utf_8'} </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="FLOAT"></a> +<h3>FLOAT</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00847740>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00847740>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00847740> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="FLOATARRAY"></a> +<h3>FLOATARRAY</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00847AE0>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00847AE0>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00847AE0> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="INTEGER"></a> +<h3>INTEGER</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00847700>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00847700>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00847700> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="INTEGERARRAY"></a> +<h3>INTEGERARRAY</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00847AC0>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00847AC0>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00847AC0> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="INTERVAL"></a> +<h3>INTERVAL</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x008479A0>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x008479A0>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x008479A0> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="INTERVALARRAY"></a> +<h3>INTERVALARRAY</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00847C60>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00847C60>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00847C60> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="LONGINTEGER"></a> +<h3>LONGINTEGER</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x008476C0>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x008476C0>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x008476C0> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="LONGINTEGERARRAY"></a> +<h3>LONGINTEGERARRAY</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00847AA0>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00847AA0>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00847AA0> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="NUMBER"></a> +<h3>NUMBER</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00847680>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00847680>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00847680> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="paramstyle"></a> +<h3>paramstyle</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>str</code> + + </dd> + <dt title="'pyformat'">Value:</dt> + <dd title="'pyformat'"><table><tr><td> +<pre class="variable"> +<span class="variable-quote">'</span>pyformat<span class="variable-quote">'</span> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="PYDATE"></a> +<h3>PYDATE</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00847DC0>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00847DC0>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00847DC0> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="PYDATETIME"></a> +<h3>PYDATETIME</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00847D20>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00847D20>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00847D20> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="PYINTERVAL"></a> +<h3>PYINTERVAL</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00847DE0>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00847DE0>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00847DE0> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="PYTIME"></a> +<h3>PYTIME</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00847D60>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00847D60>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00847D60> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="ROWID"></a> +<h3>ROWID</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00847A60>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00847A60>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00847A60> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="ROWIDARRAY"></a> +<h3>ROWIDARRAY</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00847CC0>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00847CC0>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00847CC0> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="STRING"></a> +<h3>STRING</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00847820>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00847820>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00847820> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="string_types"></a> +<h3>string_types</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>dict</code> + + </dd> + <dt title="{1028: <psycopg2._psycopg.type object at 0x00847CC0>, 1005: <psycopg2._psycopg.type object at 0x00847AC0>, 16: <psycopg2._psycopg.type object at 0x00847880>, 17: <psycopg2._psycopg.type object at 0x00847A00>, 1042: <psycopg2._psycopg.type object at 0x00847820>, 1043: <psycopg2._psycopg.type object at 0x00847820>, 20: <psycopg2._psycopg.type object at 0x008476C0>, 21: <psycopg2._psycopg.type object at 0x00847700>, 23: <psycopg2._psycopg.type object at 0x00847700>, 25: <psycopg2._psycopg.type object at 0x00847820>, 26: <psycopg2._psycopg.type object at 0x00847A60>, 1182: <psycopg2._psycopg.ty...">Value:</dt> + <dd title="{1028: <psycopg2._psycopg.type object at 0x00847CC0>, 1005: <psycopg2._psycopg.type object at 0x00847AC0>, 16: <psycopg2._psycopg.type object at 0x00847880>, 17: <psycopg2._psycopg.type object at 0x00847A00>, 1042: <psycopg2._psycopg.type object at 0x00847820>, 1043: <psycopg2._psycopg.type object at 0x00847820>, 20: <psycopg2._psycopg.type object at 0x008476C0>, 21: <psycopg2._psycopg.type object at 0x00847700>, 23: <psycopg2._psycopg.type object at 0x00847700>, 25: <psycopg2._psycopg.type object at 0x00847820>, 26: <psycopg2._psycopg.type object at 0x00847A60>, 1182: <psycopg2._psycopg.ty..."><table><tr><td> +<pre class="variable"> +{16: <psycopg2._psycopg.type object at 0x00847880>, + 17: <psycopg2._psycopg.type object at 0x00847A00>, + 18: <psycopg2._psycopg.type object at 0x00847820>, + 19: <psycopg2._psycopg.type object at 0x00847820>, + 20: <psycopg2._psycopg.type object at 0x008476C0>, + 21: <psycopg2._psycopg.type object at 0x00847700>, + 23: <psycopg2._psycopg.type object at 0x00847700>, + 25: <psycopg2._psycopg.type object at 0x00847820>, +<span class="variable-ellipsis">...</span> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="STRINGARRAY"></a> +<h3>STRINGARRAY</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00847B60>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00847B60>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00847B60> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="threadsafety"></a> +<h3>threadsafety</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>int</code> + + </dd> + <dt title="2">Value:</dt> + <dd title="2"><table><tr><td> +<pre class="variable"> +2 </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="TIME"></a> +<h3>TIME</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00847900>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00847900>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00847900> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="TIMEARRAY"></a> +<h3>TIMEARRAY</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00847BE0>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00847BE0>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00847BE0> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="UNICODE"></a> +<h3>UNICODE</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x008477E0>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x008477E0>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x008477E0> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="UNICODEARRAY"></a> +<h3>UNICODEARRAY</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00847B40>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00847B40>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00847B40> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:33 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/private/psycopg2._psycopg.ISQLQuote-class.html b/psycopg2/doc/api/private/psycopg2._psycopg.ISQLQuote-class.html new file mode 100644 index 00000000..3a7db8eb --- /dev/null +++ b/psycopg2/doc/api/private/psycopg2._psycopg.ISQLQuote-class.html @@ -0,0 +1,221 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2._psycopg.ISQLQuote</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + <a href="../private/psycopg2._psycopg-module.html">Module _psycopg</a> :: + Class ISQLQuote + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<strong>show private</strong> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="../private/psycopg2._psycopg.ISQLQuote-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Type ISQLQuote</h2> + +<pre class="base-tree"> +<a href="__builtin__.object-class.html"><code>object</code></a> --+ + | + <strong class="uidshort">ISQLQuote</strong> +</pre><br /> + +<hr/> + +<p>Abstract ISQLQuote protocol</p> +<p>An object conform to this protocol should expose a <tt class="docutils literal"><span class="pre">getquoted()</span></tt> method +returning the SQL representation of the object.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.ISQLQuote-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__init__(...) initializes x; see x.__class__.__doc__ for signature</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__new__"></a><span class="summary-sig"><span class="summary-sig-name">__new__</span>(<span class="summary-sig-arg">T</span>, + <span class="summary-sig-arg">S</span>, + <span class="summary-sig-vararg">...</span>)</span></code> +<br /> +Return a new object with type S, a subtype of T...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.ISQLQuote-class.html#getbinary" class="summary-sig-name"><code>getbinary</code></a>()</span></code> +<br /> +return SQL-quoted binary representation of this object</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.ISQLQuote-class.html#getbuffer" class="summary-sig-name"><code>getbuffer</code></a>()</span></code> +<br /> +return this object</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.ISQLQuote-class.html#getquoted" class="summary-sig-name"><code>getquoted</code></a>()</span></code> +<br /> +return SQL-quoted representation of this object</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from object</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__delattr__('name') <==> del x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__getattribute__('name') <==> x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return hash(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return repr(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__setattr__('name', value) <==> x.name = value</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return str(x)...</td></tr> +</table><br /> + + +<!-- =========== START OF PROPERTY SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Property Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><a name="_wrapped"></a><strong><code>_wrapped</code></strong></td></tr></table><br /> + + +<!-- =========== START OF METHOD DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Method Details</th></tr> +</table> + +<a name="__init__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-vararg">...</span>)</span> + <br /><em class="fname">(Constructor)</em> + </h3> +<p>x.__init__(...) initializes x; see x.__class__.__doc__ for signature</p> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__init__"><code>__builtin__.object.__init__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__new__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__new__</span>(<span class="sig-arg">T</span>, + <span class="sig-arg">S</span>, + <span class="sig-vararg">...</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +a new object with type S, a subtype of T +</pre> + </dd> + </dl> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__new__"><code>__builtin__.object.__new__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="getbinary"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">getbinary</span>()</span> + </h3> +<p>return SQL-quoted binary representation of this object</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="getbuffer"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">getbuffer</span>()</span> + </h3> +<p>return this object</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="getquoted"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">getquoted</span>()</span> + </h3> +<p>return SQL-quoted representation of this object</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:35 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/private/psycopg2._psycopg.connection-class.html b/psycopg2/doc/api/private/psycopg2._psycopg.connection-class.html new file mode 100644 index 00000000..0b6076ef --- /dev/null +++ b/psycopg2/doc/api/private/psycopg2._psycopg.connection-class.html @@ -0,0 +1,405 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2._psycopg.connection</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + <a href="../private/psycopg2._psycopg-module.html">Module _psycopg</a> :: + Class connection + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<strong>show private</strong> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="../private/psycopg2._psycopg.connection-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Type connection</h2> + +<pre class="base-tree"> +<a href="__builtin__.object-class.html"><code>object</code></a> --+ + | + <strong class="uidshort">connection</strong> +</pre><br /> + +<dl><dt>Known Subclasses:</dt> +<dd> + <a href="psycopg2.psycopg1.connection-class.html"><code>connection</code></a>, + <a href="psycopg2.extras.DictConnection-class.html"><code>DictConnection</code></a></dd></dl> + +<hr/> + +<p>connection(dsn, ...) -> new connection object</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__init__(...) initializes x; see x.__class__.__doc__ for signature</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__new__"></a><span class="summary-sig"><span class="summary-sig-name">__new__</span>(<span class="summary-sig-arg">T</span>, + <span class="summary-sig-arg">S</span>, + <span class="summary-sig-vararg">...</span>)</span></code> +<br /> +Return a new object with type S, a subtype of T...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__repr__"></a><span class="summary-sig"><span class="summary-sig-name">__repr__</span>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return repr(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__str__"></a><span class="summary-sig"><span class="summary-sig-name">__str__</span>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return str(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#close" class="summary-sig-name"><code>close</code></a>()</span></code> +<br /> +Close the connection.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#commit" class="summary-sig-name"><code>commit</code></a>()</span></code> +<br /> +Commit all changes to database.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"><a href="../private/psycopg2._psycopg.cursor-class.html" class="link"><code>extensions.cursor</code></a></td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#cursor" class="summary-sig-name"><code>cursor</code></a>(<span class="summary-sig-arg">cursor_factory</span>)</span></code> +<br /> +new cursor</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#rollback" class="summary-sig-name"><code>rollback</code></a>()</span></code> +<br /> +Roll back all changes done to database.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#set_client_encoding" class="summary-sig-name"><code>set_client_encoding</code></a>(<span class="summary-sig-arg">encoding</span>)</span></code> +<br /> +Set client encoding to <tt class="docutils literal docutils literal"><span class="pre">encoding</span></tt>.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#set_isolation_level" class="summary-sig-name"><code>set_isolation_level</code></a>(<span class="summary-sig-arg">level</span>)</span></code> +<br /> +Switch isolation level to <tt class="docutils literal docutils literal"><span class="pre">level</span></tt>.</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from object</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__delattr__('name') <==> del x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__getattribute__('name') <==> x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return hash(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__setattr__('name', value) <==> x.name = value</td></tr> +</table><br /> + + +<!-- =========== START OF PROPERTY SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Property Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#closed"><code>closed</code></a></strong>: True if the connection is closed.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#dsn"><code>dsn</code></a></strong>: The current connection string.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#encoding"><code>encoding</code></a></strong>: The current client encoding.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#isolation_level"><code>isolation_level</code></a></strong>: The current isolation level.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><a name="notices"></a><strong><code>notices</code></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><a name="notifies"></a><strong><code>notifies</code></strong></td></tr><tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> DBAPI-2.0 errors</th></tr> +<tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#Error"><code>Error</code></a></strong>: Base class for error exceptions.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#Warning"><code>Warning</code></a></strong>: A database warning.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#InterfaceError"><code>InterfaceError</code></a></strong>: Error related to the database interface.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#DatabaseError"><code>DatabaseError</code></a></strong>: Error related to the database engine.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#InternalError"><code>InternalError</code></a></strong>: The database encountered an internal error.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#OperationalError"><code>OperationalError</code></a></strong>: Error related to database operation (disconnect, memory allocation etc).</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#ProgrammingError"><code>ProgrammingError</code></a></strong>: Error related to database programming (SQL error, table not found etc).</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#IntegrityError"><code>IntegrityError</code></a></strong>: Error related to database integrity.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#DataError"><code>DataError</code></a></strong>: Error related to problems with the processed data.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#NotSupportedError"><code>NotSupportedError</code></a></strong>: A not supported datbase API was called.</td></tr></table><br /> + + +<!-- =========== START OF METHOD DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Method Details</th></tr> +</table> + +<a name="__init__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-vararg">...</span>)</span> + <br /><em class="fname">(Constructor)</em> + </h3> +<p>x.__init__(...) initializes x; see x.__class__.__doc__ for signature</p> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__init__"><code>__builtin__.object.__init__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__new__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__new__</span>(<span class="sig-arg">T</span>, + <span class="sig-arg">S</span>, + <span class="sig-vararg">...</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +a new object with type S, a subtype of T +</pre> + </dd> + </dl> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__new__"><code>__builtin__.object.__new__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__repr__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__repr__</span>(<span class="sig-arg">x</span>)</span> + <br /><em class="fname">(Representation operator)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +repr(x) +</pre> + </dd> + </dl> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__repr__"><code>__builtin__.object.__repr__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__str__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__str__</span>(<span class="sig-arg">x</span>)</span> + <br /><em class="fname">(Informal representation operator)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +str(x) +</pre> + </dd> + </dl> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__str__"><code>__builtin__.object.__str__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="close"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">close</span>()</span> + </h3> +<p>Close the connection.</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="commit"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">commit</span>()</span> + </h3> +<p>Commit all changes to database.</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="cursor"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">cursor</span>(<span class="sig-arg">cursor_factory</span>=<span class="sig-default">extensions.cursor</span>)</span> + </h3> +<p>new cursor</p> +<p>Return a new cursor.</p> +<p>The <tt class="docutils literal"><span class="pre">cursor_factory</span></tt> argument can be used to +create non-standard cursors by passing a class different from the +default. Note that the new class <em>should</em> be a sub-class of +<a href="../private/psycopg2._psycopg.cursor-class.html" class="link"><code>extensions.cursor</code></a>.</p> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<a href="../private/psycopg2._psycopg.cursor-class.html" class="link"><code>extensions.cursor</code></a> </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="rollback"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">rollback</span>()</span> + </h3> +<p>Roll back all changes done to database.</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="set_client_encoding"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">set_client_encoding</span>(<span class="sig-arg">encoding</span>)</span> + </h3> +<p>Set client encoding to <tt class="docutils literal docutils literal docutils literal"><span class="pre">encoding</span></tt>.</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="set_isolation_level"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">set_isolation_level</span>(<span class="sig-arg">level</span>)</span> + </h3> +<p>Switch isolation level to <tt class="docutils literal docutils literal docutils literal"><span class="pre">level</span></tt>.</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF PROPERTY DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Property Details</th></tr> +</table> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + +<a name="Error"></a> +<h3>Error</h3> +<p>Base class for error exceptions.</p> +</td></tr></table><table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + +<a name="Warning"></a> +<h3>Warning</h3> +<p>A database warning.</p> +</td></tr></table><table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + +<a name="InterfaceError"></a> +<h3>InterfaceError</h3> +<p>Error related to the database interface.</p> +</td></tr></table><table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + +<a name="DatabaseError"></a> +<h3>DatabaseError</h3> +<p>Error related to the database engine.</p> +</td></tr></table><table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + +<a name="InternalError"></a> +<h3>InternalError</h3> +<p>The database encountered an internal error.</p> +</td></tr></table><table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + +<a name="OperationalError"></a> +<h3>OperationalError</h3> +<p>Error related to database operation (disconnect, memory allocation etc).</p> +</td></tr></table><table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + +<a name="ProgrammingError"></a> +<h3>ProgrammingError</h3> +<p>Error related to database programming (SQL error, table not found etc).</p> +</td></tr></table><table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + +<a name="IntegrityError"></a> +<h3>IntegrityError</h3> +<p>Error related to database integrity.</p> +</td></tr></table><table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + +<a name="DataError"></a> +<h3>DataError</h3> +<p>Error related to problems with the processed data.</p> +</td></tr></table><table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + +<a name="NotSupportedError"></a> +<h3>NotSupportedError</h3> +<p>A not supported datbase API was called.</p> +</td></tr></table><table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + +<a name="closed"></a> +<h3>closed</h3> +<p>True if the connection is closed.</p> +</td></tr></table><table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + +<a name="dsn"></a> +<h3>dsn</h3> +<p>The current connection string.</p> +</td></tr></table><table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + +<a name="encoding"></a> +<h3>encoding</h3> +<p>The current client encoding.</p> +</td></tr></table><table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + +<a name="isolation_level"></a> +<h3>isolation_level</h3> +<p>The current isolation level.</p> +</td></tr></table><br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:31 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/private/psycopg2._psycopg.cursor-class.html b/psycopg2/doc/api/private/psycopg2._psycopg.cursor-class.html new file mode 100644 index 00000000..d3947aaf --- /dev/null +++ b/psycopg2/doc/api/private/psycopg2._psycopg.cursor-class.html @@ -0,0 +1,599 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2._psycopg.cursor</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + <a href="../private/psycopg2._psycopg-module.html">Module _psycopg</a> :: + Class cursor + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<strong>show private</strong> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="../private/psycopg2._psycopg.cursor-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Type cursor</h2> + +<pre class="base-tree"> +<a href="__builtin__.object-class.html"><code>object</code></a> --+ + | + <strong class="uidshort">cursor</strong> +</pre><br /> + +<dl><dt>Known Subclasses:</dt> +<dd> + <a href="psycopg2.psycopg1.cursor-class.html"><code>cursor</code></a>, + <a href="psycopg2.extras.DictCursor-class.html"><code>DictCursor</code></a></dd></dl> + +<hr/> + +<p>A database cursor.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__init__(...) initializes x; see x.__class__.__doc__ for signature</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__iter__"></a><span class="summary-sig"><span class="summary-sig-name">__iter__</span>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return iter(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__new__"></a><span class="summary-sig"><span class="summary-sig-name">__new__</span>(<span class="summary-sig-arg">T</span>, + <span class="summary-sig-arg">S</span>, + <span class="summary-sig-vararg">...</span>)</span></code> +<br /> +Return a new object with type S, a subtype of T...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__repr__"></a><span class="summary-sig"><span class="summary-sig-name">__repr__</span>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return repr(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__str__"></a><span class="summary-sig"><span class="summary-sig-name">__str__</span>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return str(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#callproc" class="summary-sig-name"><code>callproc</code></a>(<span class="summary-sig-arg">procname</span>, + <span class="summary-sig-arg">parameters</span>, + <span class="summary-sig-arg">async</span>)</span></code> +<br /> +Execute stored procedure.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#close" class="summary-sig-name"><code>close</code></a>()</span></code> +<br /> +Close the cursor.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#copy_from" class="summary-sig-name"><code>copy_from</code></a>(<span class="summary-sig-arg">file</span>, + <span class="summary-sig-arg">table</span>, + <span class="summary-sig-arg">sep</span>, + <span class="summary-sig-arg">null</span>)</span></code> +<br /> +Copy table from file.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#copy_to" class="summary-sig-name"><code>copy_to</code></a>(<span class="summary-sig-arg">file</span>, + <span class="summary-sig-arg">table</span>, + <span class="summary-sig-arg">sep</span>, + <span class="summary-sig-arg">null</span>)</span></code> +<br /> +Copy table to file.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#execute" class="summary-sig-name"><code>execute</code></a>(<span class="summary-sig-arg">query</span>, + <span class="summary-sig-arg">vars</span>, + <span class="summary-sig-arg">async</span>)</span></code> +<br /> +Execute query with bound vars.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#executemany" class="summary-sig-name"><code>executemany</code></a>(<span class="summary-sig-arg">query</span>, + <span class="summary-sig-arg">vars_list</span>, + <span class="summary-sig-arg">async</span>)</span></code> +<br /> +Execute many queries with bound vars.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">list of tuple</td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#fetchall" class="summary-sig-name"><code>fetchall</code></a>()</span></code> +<br /> +Return all the remaining rows of a query result set.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">list of tuple</td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#fetchmany" class="summary-sig-name"><code>fetchmany</code></a>(<span class="summary-sig-arg">size</span>)</span></code> +<br /> +Return the next <a href="../private/psycopg2._psycopg.cursor-class.html#fetchmany" class="link"><code>size</code></a> rows of a query result set in the form of a list +of tuples (by default) or using the sequence factory previously set in +the <a href="../private/psycopg2._psycopg.cursor-class.html#row_factory" class="link"><code>row_factory</code></a> attribute.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">tuple or None</td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#fetchone" class="summary-sig-name"><code>fetchone</code></a>()</span></code> +<br /> +Return the next row of a query result set in the form of a tuple (by +default) or using the sequence factory previously set in the +<a href="../private/psycopg2._psycopg.cursor-class.html#row_factory" class="link"><code>row_factory</code></a> attribute.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">int</td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#fileno" class="summary-sig-name"><code>fileno</code></a>()</span></code> +<br /> +Return file descriptor associated to database connection.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">bool</td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#isready" class="summary-sig-name"><code>isready</code></a>()</span></code> +<br /> +Return True if data is ready after an async query.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">str</td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#mogrify" class="summary-sig-name"><code>mogrify</code></a>(<span class="summary-sig-arg">query</span>, + <span class="summary-sig-arg">vars</span>)</span></code> +<br /> +Return query after vars binding.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="next"></a><span class="summary-sig"><span class="summary-sig-name">next</span>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return the next value, or raise StopIteration...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#nextset" class="summary-sig-name"><code>nextset</code></a>()</span></code> +<br /> +Skip to next set of data.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#scroll" class="summary-sig-name"><code>scroll</code></a>(<span class="summary-sig-arg">value</span>, + <span class="summary-sig-arg">mode</span>)</span></code> +<br /> +Scroll to new position according to mode.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#setinputsizes" class="summary-sig-name"><code>setinputsizes</code></a>(<span class="summary-sig-arg">sizes</span>)</span></code> +<br /> +Set memory areas before execute.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#setoutputsize" class="summary-sig-name"><code>setoutputsize</code></a>(<span class="summary-sig-arg">size</span>, + <span class="summary-sig-arg">column</span>)</span></code> +<br /> +Set column buffer size.</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from object</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__delattr__('name') <==> del x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__getattribute__('name') <==> x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return hash(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__setattr__('name', value) <==> x.name = value</td></tr> +</table><br /> + + +<!-- =========== START OF PROPERTY SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Property Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#arraysize"><code>arraysize</code></a></strong>: Number of records <a href="../private/psycopg2._psycopg.cursor-class.html#fetchmany" class="link"><code>fetchmany()</code></a> must fetch if not explicitely specified.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><a name="binary_types"></a><strong><code>binary_types</code></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#connection"><code>connection</code></a></strong>: The connection where the cursor comes from.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#description"><code>description</code></a></strong>: Cursor description as defined in DBAPI-2.0.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#lastrowid"><code>lastrowid</code></a></strong>: The <tt class="docutils literal docutils literal docutils literal"><span class="pre">oid</span></tt> of the last row inserted by the cursor.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><a name="name"></a><strong><code>name</code></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#query"><code>query</code></a></strong>: The last query text sent to the backend.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><a name="row_factory"></a><strong><code>row_factory</code></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#rowcount"><code>rowcount</code></a></strong>: Number of rows read from the backend in the last command.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#rownumber"><code>rownumber</code></a></strong>: The current row position.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#statusmessage"><code>statusmessage</code></a></strong>: The return message of the last command.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><a name="string_types"></a><strong><code>string_types</code></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><a name="typecaster"></a><strong><code>typecaster</code></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><a name="tzinfo_factory"></a><strong><code>tzinfo_factory</code></strong></td></tr></table><br /> + + +<!-- =========== START OF METHOD DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Method Details</th></tr> +</table> + +<a name="__init__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-vararg">...</span>)</span> + <br /><em class="fname">(Constructor)</em> + </h3> +<p>x.__init__(...) initializes x; see x.__class__.__doc__ for signature</p> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__init__"><code>__builtin__.object.__init__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__iter__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__iter__</span>(<span class="sig-arg">x</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +iter(x) +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__new__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__new__</span>(<span class="sig-arg">T</span>, + <span class="sig-arg">S</span>, + <span class="sig-vararg">...</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +a new object with type S, a subtype of T +</pre> + </dd> + </dl> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__new__"><code>__builtin__.object.__new__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__repr__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__repr__</span>(<span class="sig-arg">x</span>)</span> + <br /><em class="fname">(Representation operator)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +repr(x) +</pre> + </dd> + </dl> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__repr__"><code>__builtin__.object.__repr__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__str__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__str__</span>(<span class="sig-arg">x</span>)</span> + <br /><em class="fname">(Informal representation operator)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +str(x) +</pre> + </dd> + </dl> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__str__"><code>__builtin__.object.__str__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="callproc"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">callproc</span>(<span class="sig-arg">procname</span>, + <span class="sig-arg">parameters</span>=<span class="sig-default">None</span>, + <span class="sig-arg">async</span>=<span class="sig-default">0</span>)</span> + </h3> +<p>Execute stored procedure.</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="close"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">close</span>()</span> + </h3> +<p>Close the cursor.</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="copy_from"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">copy_from</span>(<span class="sig-arg">file</span>, + <span class="sig-arg">table</span>, + <span class="sig-arg">sep</span>=<span class="sig-default">'\t'</span>, + <span class="sig-arg">null</span>=<span class="sig-default">'\N'</span>)</span> + </h3> +<p>Copy table from file.</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="copy_to"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">copy_to</span>(<span class="sig-arg">file</span>, + <span class="sig-arg">table</span>, + <span class="sig-arg">sep</span>=<span class="sig-default">'\t'</span>, + <span class="sig-arg">null</span>=<span class="sig-default">'\N'</span>)</span> + </h3> +<p>Copy table to file.</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="execute"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">execute</span>(<span class="sig-arg">query</span>, + <span class="sig-arg">vars</span>=<span class="sig-default">None</span>, + <span class="sig-arg">async</span>=<span class="sig-default">0</span>)</span> + </h3> +<p>Execute query with bound vars.</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="executemany"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">executemany</span>(<span class="sig-arg">query</span>, + <span class="sig-arg">vars_list</span>=<span class="sig-default">()</span>, + <span class="sig-arg">async</span>=<span class="sig-default">0</span>)</span> + </h3> +<p>Execute many queries with bound vars.</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="fetchall"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">fetchall</span>()</span> + </h3> +<p>Return all the remaining rows of a query result set.</p> +<p>Rows are returned in the form of a list of tuples (by default) or using +the sequence factory previously set in the <a href="../private/psycopg2._psycopg.cursor-class.html#row_factory" class="link"><code>row_factory</code></a> attribute. +Return <code>None</code> when no more data is available.</p> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +list of tuple </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="fetchmany"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">fetchmany</span>(<span class="sig-arg">size</span>=<span class="sig-default">self.arraysize</span>)</span> + </h3> +<p>Return the next <a href="../private/psycopg2._psycopg.cursor-class.html#fetchmany" class="link"><code>size</code></a> rows of a query result set in the form of a list +of tuples (by default) or using the sequence factory previously set in +the <a href="../private/psycopg2._psycopg.cursor-class.html#row_factory" class="link"><code>row_factory</code></a> attribute. Return <code>None</code> when no more data is available.</p> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +list of tuple </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="fetchone"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">fetchone</span>()</span> + </h3> +<p>Return the next row of a query result set in the form of a tuple (by +default) or using the sequence factory previously set in the +<a href="../private/psycopg2._psycopg.cursor-class.html#row_factory" class="link"><code>row_factory</code></a> attribute. Return <code>None</code> when no more data is available.</p> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +tuple or None </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="fileno"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">fileno</span>()</span> + </h3> +<p>Return file descriptor associated to database connection.</p> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +int </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="isready"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">isready</span>()</span> + </h3> +<p>Return True if data is ready after an async query.</p> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +bool </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="mogrify"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">mogrify</span>(<span class="sig-arg">query</span>, + <span class="sig-arg">vars</span>=<span class="sig-default">None</span>)</span> + </h3> +<p>Return query after vars binding.</p> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +str </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="next"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">next</span>(<span class="sig-arg">x</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +the next value, or raise StopIteration +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="nextset"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">nextset</span>()</span> + </h3> +<p>Skip to next set of data.</p> +<p>This method is not supported (PostgreSQL does not have multiple data +sets) and will raise a NotSupportedError exception.</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="scroll"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">scroll</span>(<span class="sig-arg">value</span>, + <span class="sig-arg">mode</span>=<span class="sig-default">'relative'</span>)</span> + </h3> +<p>Scroll to new position according to mode.</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="setinputsizes"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">setinputsizes</span>(<span class="sig-arg">sizes</span>)</span> + </h3> +<p>Set memory areas before execute.</p> +<p>This method currently does nothing but it is safe to call it.</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="setoutputsize"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">setoutputsize</span>(<span class="sig-arg">size</span>, + <span class="sig-arg">column</span>=<span class="sig-default">None</span>)</span> + </h3> +<p>Set column buffer size.</p> +<p>This method currently does nothing but it is safe to call it.</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF PROPERTY DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Property Details</th></tr> +</table> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + +<a name="arraysize"></a> +<h3>arraysize</h3> +<p>Number of records <a href="../private/psycopg2._psycopg.cursor-class.html#fetchmany" class="link"><code>fetchmany()</code></a> must fetch if not explicitely specified.</p> +</td></tr></table><table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + +<a name="connection"></a> +<h3>connection</h3> +<p>The connection where the cursor comes from.</p> +</td></tr></table><table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + +<a name="description"></a> +<h3>description</h3> +<p>Cursor description as defined in DBAPI-2.0.</p> +</td></tr></table><table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + +<a name="lastrowid"></a> +<h3>lastrowid</h3> +<p>The <tt class="docutils literal docutils literal docutils literal docutils literal"><span class="pre">oid</span></tt> of the last row inserted by the cursor.</p> +</td></tr></table><table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + +<a name="query"></a> +<h3>query</h3> +<p>The last query text sent to the backend.</p> +</td></tr></table><table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + +<a name="rowcount"></a> +<h3>rowcount</h3> +<p>Number of rows read from the backend in the last command.</p> +</td></tr></table><table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + +<a name="rownumber"></a> +<h3>rownumber</h3> +<p>The current row position.</p> +</td></tr></table><table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + +<a name="statusmessage"></a> +<h3>statusmessage</h3> +<p>The return message of the last command.</p> +</td></tr></table><br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:34 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/private/psycopg2.extensions-module.html b/psycopg2/doc/api/private/psycopg2.extensions-module.html new file mode 100644 index 00000000..a78fd662 --- /dev/null +++ b/psycopg2/doc/api/private/psycopg2.extensions-module.html @@ -0,0 +1,418 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.extensions</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + Module extensions + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.extensions-module.html">hide private</a>]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.extensions-module.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF MODULE DESCRIPTION =========== --> +<h2 class="module">Module psycopg2.extensions</h2> + +<p>psycopg extensions to the DBAPI-2.0</p> +<p>This module holds all the extensions to the DBAPI-2.0 provided by psycopg.</p> +<ul class="rst-simple"> +<li><a href="../private/psycopg2._psycopg.connection-class.html" class="link"><code>connection</code></a> -- the new-type inheritable connection class</li> +<li><a href="../private/psycopg2._psycopg.cursor-class.html" class="link"><code>cursor</code></a> -- the new-type inheritable cursor class</li> +<li><a href="psycopg2.extensions-module.html#adapt" class="link"><code>adapt()</code></a> -- exposes the <a class="reference" href="http://www.python.org/peps/pep-0246.html">PEP-246</a> compatible adapting mechanism used +by psycopg to adapt Python types to PostgreSQL ones</li> +</ul> +<hr/> + +<!-- =========== START OF FUNCTION SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Function Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">object</td> + <td><code><span class="summary-sig"><a href="psycopg2.extensions-module.html#adapt" class="summary-sig-name"><code>adapt</code></a>(<span class="summary-sig-arg">obj</span>, + <span class="summary-sig-arg">protocol</span>, + <span class="summary-sig-arg">alternate</span>)</span></code> +<br /> +adapt obj to given protocol</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">new AsIs wrapper object</td> + <td><code><a name="AsIs"></a><span class="summary-sig"><span class="summary-sig-name">AsIs</span>(<span class="summary-sig-arg">obj</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">new boolean value</td> + <td><code><a name="Boolean"></a><span class="summary-sig"><span class="summary-sig-name">Boolean</span>(<span class="summary-sig-arg">obj</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">new wrapper</td> + <td><code><a name="DateFromPy"></a><span class="summary-sig"><span class="summary-sig-name">DateFromPy</span>(<span class="summary-sig-arg">datetime.date</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">new wrapper</td> + <td><code><a name="IntervalFromPy"></a><span class="summary-sig"><span class="summary-sig-name">IntervalFromPy</span>(<span class="summary-sig-arg">datetime.timedelta</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">new type object</td> + <td><code><span class="summary-sig"><a href="psycopg2.extensions-module.html#new_type" class="summary-sig-name"><code>new_type</code></a>(<span class="summary-sig-arg">oids</span>, + <span class="summary-sig-arg">name</span>, + <span class="summary-sig-arg">adapter</span>)</span></code> +<br /> +Create a new binding object.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">new quoted string</td> + <td><code><a name="QuotedString"></a><span class="summary-sig"><span class="summary-sig-name">QuotedString</span>(<span class="summary-sig-arg">str</span>, + <span class="summary-sig-arg">enc</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="psycopg2.extensions-module.html#register_adapter" class="summary-sig-name"><code>register_adapter</code></a>(<span class="summary-sig-arg">typ</span>, + <span class="summary-sig-arg">callable</span>)</span></code> +<br /> +Register 'callable' as an ISQLQuote adapter for type 'typ'.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">None</td> + <td><code><span class="summary-sig"><a href="psycopg2.extensions-module.html#register_type" class="summary-sig-name"><code>register_type</code></a>(<span class="summary-sig-arg">obj</span>)</span></code> +<br /> +register obj with psycopg type system</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">new wrapper</td> + <td><code><a name="TimeFromPy"></a><span class="summary-sig"><span class="summary-sig-name">TimeFromPy</span>(<span class="summary-sig-arg">datetime.time</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">new wrapper</td> + <td><code><a name="TimestampFromPy"></a><span class="summary-sig"><span class="summary-sig-name">TimestampFromPy</span>(<span class="summary-sig-arg">datetime.datetime</span>)</span></code> +</td></tr> +</table><br /> + + +<!-- =========== START OF VARIABLE SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Variable Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>int</code></td> +<td><strong><a href="psycopg2.extensions-module.html#ISOLATION_LEVEL_AUTOCOMMIT"><code>ISOLATION_LEVEL_AUTOCOMMIT</code></a></strong> = <span title="0">0 </span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>int</code></td> +<td><strong><a href="psycopg2.extensions-module.html#ISOLATION_LEVEL_READ_COMMITTED"><code>ISOLATION_LEVEL_READ_COMMITTED</code></a></strong> = <span title="1">1 </span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>int</code></td> +<td><strong><a href="psycopg2.extensions-module.html#ISOLATION_LEVEL_READ_UNCOMMITTED"><code>ISOLATION_LEVEL_READ_UNCOMMITTED</code></a></strong> = <span title="1">1 </span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>int</code></td> +<td><strong><a href="psycopg2.extensions-module.html#ISOLATION_LEVEL_REPEATABLE_READ"><code>ISOLATION_LEVEL_REPEATABLE_READ</code></a></strong> = <span title="2">2 </span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>int</code></td> +<td><strong><a href="psycopg2.extensions-module.html#ISOLATION_LEVEL_SERIALIZABLE"><code>ISOLATION_LEVEL_SERIALIZABLE</code></a></strong> = <span title="2">2 </span></td></tr> +</table><br /> + + +<!-- =========== START OF FUNCTION DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Function Details</th></tr> +</table> + +<a name="adapt"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">adapt</span>(<span class="sig-arg">obj</span>, + <span class="sig-arg">protocol</span>, + <span class="sig-arg">alternate</span>)</span> + </h3> +<p>adapt obj to given protocol</p> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +object </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="AsIs"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">AsIs</span>(<span class="sig-arg">obj</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +new AsIs wrapper object </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="Boolean"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">Boolean</span>(<span class="sig-arg">obj</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +new boolean value </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="DateFromPy"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">DateFromPy</span>(<span class="sig-arg">datetime.date</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +new wrapper </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="IntervalFromPy"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">IntervalFromPy</span>(<span class="sig-arg">datetime.timedelta</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +new wrapper </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="new_type"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">new_type</span>(<span class="sig-arg">oids</span>, + <span class="sig-arg">name</span>, + <span class="sig-arg">adapter</span>)</span> + </h3> +<p>Create a new binding object. The object can be used with the +<a href="psycopg2.extensions-module.html#register_type" class="link"><code>register_type()</code></a> function to bind PostgreSQL objects to python objects.</p> + <dl><dt></dt><dd> + <dl><dt>Parameters:</dt> + <dd><code><strong class="pname">oids</strong></code> - + Tuple of <tt class="docutils literal"><span class="pre">oid</span></tt> of the PostgreSQL types to convert. + </dd> + <dd><code><strong class="pname">name</strong></code> - + Name for the new type + </dd> + <dd><code><strong class="pname">adapter</strong></code> - + Callable to perform type conversion. +It must have the signature <tt class="docutils literal"><span class="pre">fun(value,</span> <span class="pre">cur)</span></tt> where <tt class="docutils literal"><span class="pre">value</span></tt> is +the string representation returned by PostgreSQL (<code>None</code> if <tt class="docutils literal"><span class="pre">NULL</span></tt>) +and <tt class="docutils literal"><span class="pre">cur</span></tt> is the cursor from which data are read. + </dd> + </dl> + <dl><dt>Returns:</dt> + <dd> +new type object </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="QuotedString"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">QuotedString</span>(<span class="sig-arg">str</span>, + <span class="sig-arg">enc</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +new quoted string </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="register_adapter"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">register_adapter</span>(<span class="sig-arg">typ</span>, + <span class="sig-arg">callable</span>)</span> + </h3> +<p>Register 'callable' as an ISQLQuote adapter for type 'typ'.</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="register_type"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">register_type</span>(<span class="sig-arg">obj</span>)</span> + </h3> +<p>register obj with psycopg type system</p> + <dl><dt></dt><dd> + <dl><dt>Parameters:</dt> + <dd><code><strong class="pname">obj</strong></code> - + A type adapter created by <a href="psycopg2.extensions-module.html#new_type" class="link"><code>new_type()</code></a> + </dd> + </dl> + <dl><dt>Returns:</dt> + <dd> +None </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="TimeFromPy"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">TimeFromPy</span>(<span class="sig-arg">datetime.time</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +new wrapper </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="TimestampFromPy"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">TimestampFromPy</span>(<span class="sig-arg">datetime.datetime</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +new wrapper </dd> + </dl> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF VARIABLE DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Variable Details</th></tr> +</table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="ISOLATION_LEVEL_AUTOCOMMIT"></a> +<h3>ISOLATION_LEVEL_AUTOCOMMIT</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>int</code> + + </dd> + <dt title="0">Value:</dt> + <dd title="0"><table><tr><td> +<pre class="variable"> +0 </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="ISOLATION_LEVEL_READ_COMMITTED"></a> +<h3>ISOLATION_LEVEL_READ_COMMITTED</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>int</code> + + </dd> + <dt title="1">Value:</dt> + <dd title="1"><table><tr><td> +<pre class="variable"> +1 </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="ISOLATION_LEVEL_READ_UNCOMMITTED"></a> +<h3>ISOLATION_LEVEL_READ_UNCOMMITTED</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>int</code> + + </dd> + <dt title="1">Value:</dt> + <dd title="1"><table><tr><td> +<pre class="variable"> +1 </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="ISOLATION_LEVEL_REPEATABLE_READ"></a> +<h3>ISOLATION_LEVEL_REPEATABLE_READ</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>int</code> + + </dd> + <dt title="2">Value:</dt> + <dd title="2"><table><tr><td> +<pre class="variable"> +2 </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="ISOLATION_LEVEL_SERIALIZABLE"></a> +<h3>ISOLATION_LEVEL_SERIALIZABLE</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>int</code> + + </dd> + <dt title="2">Value:</dt> + <dd title="2"><table><tr><td> +<pre class="variable"> +2 </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:32 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/private/psycopg2.extras-module.html b/psycopg2/doc/api/private/psycopg2.extras-module.html new file mode 100644 index 00000000..463fc228 --- /dev/null +++ b/psycopg2/doc/api/private/psycopg2.extras-module.html @@ -0,0 +1,91 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.extras</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + Module extras + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.extras-module.html">hide private</a>]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.extras-module.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF MODULE DESCRIPTION =========== --> +<h2 class="module">Module psycopg2.extras</h2> + +<p>Miscellaneous goodies for psycopg2</p> +<p>This module is a generic place used to hold little helper functions +and classes untill a better place in the distribution is found.</p> +<hr/> + +<!-- =========== START OF CLASSES =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Classes</th></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.extras.DictConnection-class.html"><code>DictConnection</code></a></strong></td> + <td>A connection that uses DictCursor automatically.</td></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.extras.DictCursor-class.html"><code>DictCursor</code></a></strong></td> + <td>A cursor that keeps a list of column name -> index mappings.</td></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.extras.DictRow-class.html"><code>DictRow</code></a></strong></td> + <td>A row object that allow by-colun-name access to data.</td></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.extras.SQL_IN-class.html"><code>SQL_IN</code></a></strong></td> + <td>Adapt any iterable to an SQL quotable object.</td></tr> +</table><br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:32 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/private/psycopg2.extras.DictConnection-class.html b/psycopg2/doc/api/private/psycopg2.extras.DictConnection-class.html new file mode 100644 index 00000000..73989b59 --- /dev/null +++ b/psycopg2/doc/api/private/psycopg2.extras.DictConnection-class.html @@ -0,0 +1,202 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.extras.DictConnection</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + <a href="psycopg2.extras-module.html">Module extras</a> :: + Class DictConnection + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.extras.DictConnection-class.html">hide private</a>]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.extras.DictConnection-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Type DictConnection</h2> + +<pre class="base-tree"> +<a href="__builtin__.object-class.html"><code>object</code></a> --+ + | +<a href="../private/psycopg2._psycopg.connection-class.html"><code>connection</code></a> --+ + | + <strong class="uidshort">DictConnection</strong> +</pre><br /> + +<hr/> + +<p>A connection that uses DictCursor automatically.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="cursor"></a><span class="summary-sig"><span class="summary-sig-name">cursor</span>(<span class="summary-sig-arg">self</span>)</span></code> +</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from connection</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__init__(...) initializes x; see x.__class__.__doc__ for signature</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#__new__" class="summary-sig-name"><code>__new__</code></a>(<span class="summary-sig-arg">T</span>, + <span class="summary-sig-arg">S</span>, + <span class="summary-sig-vararg">...</span>)</span></code> +<br /> +Return a new object with type S, a subtype of T...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return repr(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return str(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#close" class="summary-sig-name"><code>close</code></a>()</span></code> +<br /> +Close the connection.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#commit" class="summary-sig-name"><code>commit</code></a>()</span></code> +<br /> +Commit all changes to database.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#rollback" class="summary-sig-name"><code>rollback</code></a>()</span></code> +<br /> +Roll back all changes done to database.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#set_client_encoding" class="summary-sig-name"><code>set_client_encoding</code></a>(<span class="summary-sig-arg">encoding</span>)</span></code> +<br /> +Set client encoding to <tt class="docutils literal"><span class="pre">encoding</span></tt>.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#set_isolation_level" class="summary-sig-name"><code>set_isolation_level</code></a>(<span class="summary-sig-arg">level</span>)</span></code> +<br /> +Switch isolation level to <tt class="docutils literal"><span class="pre">level</span></tt>.</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from object</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__delattr__('name') <==> del x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__getattribute__('name') <==> x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return hash(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__setattr__('name', value) <==> x.name = value</td></tr> +</table><br /> + + +<!-- =========== START OF PROPERTY SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Property Summary</th></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from connection</th></tr> +<tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#closed"><code>closed</code></a></strong>: True if the connection is closed.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#DatabaseError"><code>DatabaseError</code></a></strong>: Error related to the database engine.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#DataError"><code>DataError</code></a></strong>: Error related to problems with the processed data.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#dsn"><code>dsn</code></a></strong>: The current connection string.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#encoding"><code>encoding</code></a></strong>: The current client encoding.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#Error"><code>Error</code></a></strong>: Base class for error exceptions.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#IntegrityError"><code>IntegrityError</code></a></strong>: Error related to database integrity.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#InterfaceError"><code>InterfaceError</code></a></strong>: Error related to the database interface.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#InternalError"><code>InternalError</code></a></strong>: The database encountered an internal error.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#isolation_level"><code>isolation_level</code></a></strong>: The current isolation level.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#notices"><code>notices</code></a></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#notifies"><code>notifies</code></a></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#NotSupportedError"><code>NotSupportedError</code></a></strong>: A not supported datbase API was called.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#OperationalError"><code>OperationalError</code></a></strong>: Error related to database operation (disconnect, memory allocation etc).</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#ProgrammingError"><code>ProgrammingError</code></a></strong>: Error related to database programming (SQL error, table not found etc).</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#Warning"><code>Warning</code></a></strong>: A database warning.</td></tr></table><br /> + + +<!-- =========== START OF METHOD DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Method Details</th></tr> +</table> + +<a name="cursor"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">cursor</span>(<span class="sig-arg">self</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="../private/psycopg2._psycopg.connection-class.html#cursor"><code>psycopg2._psycopg.connection.cursor</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:31 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/private/psycopg2.extras.DictCursor-class.html b/psycopg2/doc/api/private/psycopg2.extras.DictCursor-class.html new file mode 100644 index 00000000..80a05c96 --- /dev/null +++ b/psycopg2/doc/api/private/psycopg2.extras.DictCursor-class.html @@ -0,0 +1,359 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.extras.DictCursor</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + <a href="psycopg2.extras-module.html">Module extras</a> :: + Class DictCursor + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.extras.DictCursor-class.html">hide private</a>]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.extras.DictCursor-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Type DictCursor</h2> + +<pre class="base-tree"> +<a href="__builtin__.object-class.html"><code>object</code></a> --+ + | + <a href="../private/psycopg2._psycopg.cursor-class.html"><code>cursor</code></a> --+ + | + <strong class="uidshort">DictCursor</strong> +</pre><br /> + +<hr/> + +<p>A cursor that keeps a list of column name -> index mappings.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="callproc"></a><span class="summary-sig"><span class="summary-sig-name">callproc</span>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">procname</span>, + <span class="summary-sig-arg">vars</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="execute"></a><span class="summary-sig"><span class="summary-sig-name">execute</span>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">query</span>, + <span class="summary-sig-arg">vars</span>, + <span class="summary-sig-arg">async</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="fetchall"></a><span class="summary-sig"><span class="summary-sig-name">fetchall</span>(<span class="summary-sig-arg">self</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="fetchmany"></a><span class="summary-sig"><span class="summary-sig-name">fetchmany</span>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">size</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="fetchone"></a><span class="summary-sig"><span class="summary-sig-name">fetchone</span>(<span class="summary-sig-arg">self</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="_build_index"></a><span class="summary-sig"><span class="summary-sig-name">_build_index</span>(<span class="summary-sig-arg">self</span>)</span></code> +</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from cursor</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__init__(...) initializes x; see x.__class__.__doc__ for signature</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#__iter__" class="summary-sig-name"><code>__iter__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return iter(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#__new__" class="summary-sig-name"><code>__new__</code></a>(<span class="summary-sig-arg">T</span>, + <span class="summary-sig-arg">S</span>, + <span class="summary-sig-vararg">...</span>)</span></code> +<br /> +Return a new object with type S, a subtype of T...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return repr(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return str(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#close" class="summary-sig-name"><code>close</code></a>()</span></code> +<br /> +Close the cursor.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#copy_from" class="summary-sig-name"><code>copy_from</code></a>(<span class="summary-sig-arg">file</span>, + <span class="summary-sig-arg">table</span>, + <span class="summary-sig-arg">sep</span>, + <span class="summary-sig-arg">null</span>)</span></code> +<br /> +Copy table from file.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#copy_to" class="summary-sig-name"><code>copy_to</code></a>(<span class="summary-sig-arg">file</span>, + <span class="summary-sig-arg">table</span>, + <span class="summary-sig-arg">sep</span>, + <span class="summary-sig-arg">null</span>)</span></code> +<br /> +Copy table to file.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#executemany" class="summary-sig-name"><code>executemany</code></a>(<span class="summary-sig-arg">query</span>, + <span class="summary-sig-arg">vars_list</span>, + <span class="summary-sig-arg">async</span>)</span></code> +<br /> +Execute many queries with bound vars.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">int</td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#fileno" class="summary-sig-name"><code>fileno</code></a>()</span></code> +<br /> +Return file descriptor associated to database connection.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">bool</td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#isready" class="summary-sig-name"><code>isready</code></a>()</span></code> +<br /> +Return True if data is ready after an async query.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">str</td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#mogrify" class="summary-sig-name"><code>mogrify</code></a>(<span class="summary-sig-arg">query</span>, + <span class="summary-sig-arg">vars</span>)</span></code> +<br /> +Return query after vars binding.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#next" class="summary-sig-name"><code>next</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return the next value, or raise StopIteration...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#nextset" class="summary-sig-name"><code>nextset</code></a>()</span></code> +<br /> +Skip to next set of data.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#scroll" class="summary-sig-name"><code>scroll</code></a>(<span class="summary-sig-arg">value</span>, + <span class="summary-sig-arg">mode</span>)</span></code> +<br /> +Scroll to new position according to mode.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#setinputsizes" class="summary-sig-name"><code>setinputsizes</code></a>(<span class="summary-sig-arg">sizes</span>)</span></code> +<br /> +Set memory areas before execute.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#setoutputsize" class="summary-sig-name"><code>setoutputsize</code></a>(<span class="summary-sig-arg">size</span>, + <span class="summary-sig-arg">column</span>)</span></code> +<br /> +Set column buffer size.</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from object</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__delattr__('name') <==> del x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__getattribute__('name') <==> x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return hash(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__setattr__('name', value) <==> x.name = value</td></tr> +</table><br /> + + +<!-- =========== START OF PROPERTY SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Property Summary</th></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from cursor</th></tr> +<tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#arraysize"><code>arraysize</code></a></strong>: Number of records <a href="../private/psycopg2._psycopg.cursor-class.html#fetchmany" class="link"><code>fetchmany()</code></a> must fetch if not explicitely specified.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#binary_types"><code>binary_types</code></a></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#connection"><code>connection</code></a></strong>: The connection where the cursor comes from.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#description"><code>description</code></a></strong>: Cursor description as defined in DBAPI-2.0.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#lastrowid"><code>lastrowid</code></a></strong>: The <tt class="docutils literal"><span class="pre">oid</span></tt> of the last row inserted by the cursor.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#name"><code>name</code></a></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#query"><code>query</code></a></strong>: The last query text sent to the backend.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#row_factory"><code>row_factory</code></a></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#rowcount"><code>rowcount</code></a></strong>: Number of rows read from the backend in the last command.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#rownumber"><code>rownumber</code></a></strong>: The current row position.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#statusmessage"><code>statusmessage</code></a></strong>: The return message of the last command.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#string_types"><code>string_types</code></a></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#typecaster"><code>typecaster</code></a></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#tzinfo_factory"><code>tzinfo_factory</code></a></strong></td></tr></table><br /> + + +<!-- =========== START OF CLASS VARIABLE SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Class Variable Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>int</code></td> +<td><strong><a href="../private/psycopg2.extras.DictCursor-class.html#__query_executed"><code>_DictCursor__query_executed</code></a></strong> = <span title="0">0 </span></td></tr> +</table><br /> + + +<!-- =========== START OF METHOD DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Method Details</th></tr> +</table> + +<a name="callproc"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">callproc</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">procname</span>, + <span class="sig-arg">vars</span>=<span class="sig-default">None</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="../private/psycopg2._psycopg.cursor-class.html#callproc"><code>psycopg2._psycopg.cursor.callproc</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="execute"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">execute</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">query</span>, + <span class="sig-arg">vars</span>=<span class="sig-default">None</span>, + <span class="sig-arg">async</span>=<span class="sig-default">0</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="../private/psycopg2._psycopg.cursor-class.html#execute"><code>psycopg2._psycopg.cursor.execute</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="fetchall"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">fetchall</span>(<span class="sig-arg">self</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="../private/psycopg2._psycopg.cursor-class.html#fetchall"><code>psycopg2._psycopg.cursor.fetchall</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="fetchmany"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">fetchmany</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">size</span>=<span class="sig-default">None</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="../private/psycopg2._psycopg.cursor-class.html#fetchmany"><code>psycopg2._psycopg.cursor.fetchmany</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="fetchone"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">fetchone</span>(<span class="sig-arg">self</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="../private/psycopg2._psycopg.cursor-class.html#fetchone"><code>psycopg2._psycopg.cursor.fetchone</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="_build_index"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">_build_index</span>(<span class="sig-arg">self</span>)</span> + </h3> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF CLASS VARIABLE DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Class Variable Details</th></tr> +</table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="_DictCursor__query_executed"></a> +<h3>_DictCursor__query_executed</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>int</code> + + </dd> + <dt title="0">Value:</dt> + <dd title="0"><table><tr><td> +<pre class="variable"> +0 </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:32 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/private/psycopg2.extras.DictRow-class.html b/psycopg2/doc/api/private/psycopg2.extras.DictRow-class.html new file mode 100644 index 00000000..db749909 --- /dev/null +++ b/psycopg2/doc/api/private/psycopg2.extras.DictRow-class.html @@ -0,0 +1,376 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.extras.DictRow</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + <a href="psycopg2.extras-module.html">Module extras</a> :: + Class DictRow + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.extras.DictRow-class.html">hide private</a>]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.extras.DictRow-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Type DictRow</h2> + +<pre class="base-tree"> +<a href="__builtin__.object-class.html"><code>object</code></a> --+ + | + <a href="__builtin__.list-class.html"><code>list</code></a> --+ + | + <strong class="uidshort">DictRow</strong> +</pre><br /> + +<hr/> + +<p>A row object that allow by-colun-name access to data.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__init__"></a><span class="summary-sig"><span class="summary-sig-name">__init__</span>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">cursor</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__getitem__"></a><span class="summary-sig"><span class="summary-sig-name">__getitem__</span>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">x</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="get"></a><span class="summary-sig"><span class="summary-sig-name">get</span>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">default</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="has_key"></a><span class="summary-sig"><span class="summary-sig-name">has_key</span>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">x</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="items"></a><span class="summary-sig"><span class="summary-sig-name">items</span>(<span class="summary-sig-arg">self</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="keys"></a><span class="summary-sig"><span class="summary-sig-name">keys</span>(<span class="summary-sig-arg">self</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="values"></a><span class="summary-sig"><span class="summary-sig-name">values</span>(<span class="summary-sig-arg">self</span>)</span></code> +</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from list</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__add__" class="summary-sig-name"><code>__add__</code></a>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return x+y...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__contains__" class="summary-sig-name"><code>__contains__</code></a>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return y in x...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__delitem__" class="summary-sig-name"><code>__delitem__</code></a>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return del x[y]...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__delslice__" class="summary-sig-name"><code>__delslice__</code></a>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">i</span>, + <span class="summary-sig-arg">j</span>)</span></code> +<br /> +Use of negative indices is not supported.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__eq__" class="summary-sig-name"><code>__eq__</code></a>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return x==y...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__ge__" class="summary-sig-name"><code>__ge__</code></a>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return x>=y...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__getattribute__('name') <==> x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__getslice__" class="summary-sig-name"><code>__getslice__</code></a>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">i</span>, + <span class="summary-sig-arg">j</span>)</span></code> +<br /> +Use of negative indices is not supported.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__gt__" class="summary-sig-name"><code>__gt__</code></a>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return x>y...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return hash(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__iadd__" class="summary-sig-name"><code>__iadd__</code></a>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return x+=y...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__imul__" class="summary-sig-name"><code>__imul__</code></a>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return x*=y...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__iter__" class="summary-sig-name"><code>__iter__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return iter(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__le__" class="summary-sig-name"><code>__le__</code></a>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return x<=y...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__len__" class="summary-sig-name"><code>__len__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return len(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__lt__" class="summary-sig-name"><code>__lt__</code></a>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return x<y...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__mul__" class="summary-sig-name"><code>__mul__</code></a>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">n</span>)</span></code> +<br /> +Return x*n...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__ne__" class="summary-sig-name"><code>__ne__</code></a>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return x!=y...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__new__" class="summary-sig-name"><code>__new__</code></a>(<span class="summary-sig-arg">T</span>, + <span class="summary-sig-arg">S</span>, + <span class="summary-sig-vararg">...</span>)</span></code> +<br /> +Return a new object with type S, a subtype of T...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return repr(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__rmul__" class="summary-sig-name"><code>__rmul__</code></a>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">n</span>)</span></code> +<br /> +Return n*x...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__setitem__" class="summary-sig-name"><code>__setitem__</code></a>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">i</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return x[i]=y...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__setslice__" class="summary-sig-name"><code>__setslice__</code></a>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">i</span>, + <span class="summary-sig-arg">j</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Use of negative indices is not supported.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#append" class="summary-sig-name"><code>append</code></a>(<span class="summary-sig-arg">L</span>, + <span class="summary-sig-arg">object</span>)</span></code> +<br /> +append object to end</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#count" class="summary-sig-name"><code>count</code></a>(<span class="summary-sig-arg">L</span>, + <span class="summary-sig-arg">value</span>)</span></code> +<br /> +return number of occurrences of value</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#extend" class="summary-sig-name"><code>extend</code></a>(<span class="summary-sig-arg">L</span>, + <span class="summary-sig-arg">iterable</span>)</span></code> +<br /> +extend list by appending elements from the iterable</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#index" class="summary-sig-name"><code>index</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +L.index(value, [start, [stop]]) -> integer -- return first index of value</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#insert" class="summary-sig-name"><code>insert</code></a>(<span class="summary-sig-arg">L</span>, + <span class="summary-sig-arg">index</span>, + <span class="summary-sig-arg">object</span>)</span></code> +<br /> +insert object before index</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#pop" class="summary-sig-name"><code>pop</code></a>(<span class="summary-sig-arg">L</span>, + <span class="summary-sig-arg">index</span>)</span></code> +<br /> +remove and return item at index (default last)</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#remove" class="summary-sig-name"><code>remove</code></a>(<span class="summary-sig-arg">L</span>, + <span class="summary-sig-arg">value</span>)</span></code> +<br /> +remove first occurrence of value</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#reverse" class="summary-sig-name"><code>reverse</code></a>(<span class="summary-sig-arg">L</span>)</span></code> +<br /> +reverse <em>IN PLACE</em></td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#sort" class="summary-sig-name"><code>sort</code></a>(<span class="summary-sig-arg">L</span>, + <span class="summary-sig-arg">cmpfunc</span>)</span></code> +<br /> +stable sort <em>IN PLACE</em>; cmpfunc(x, y) -> -1, 0, 1</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from object</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__delattr__('name') <==> del x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__setattr__('name', value) <==> x.name = value</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return str(x)...</td></tr> +</table><br /> + + +<!-- =========== START OF METHOD DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Method Details</th></tr> +</table> + +<a name="__init__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">cursor</span>)</span> + <br /><em class="fname">(Constructor)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.list-class.html#__init__"><code>__builtin__.list.__init__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__getitem__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__getitem__</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">x</span>)</span> + <br /><em class="fname">(Indexing operator)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.list-class.html#__getitem__"><code>__builtin__.list.__getitem__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="get"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">get</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">x</span>, + <span class="sig-arg">default</span>=<span class="sig-default">None</span>)</span> + </h3> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="has_key"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">has_key</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">x</span>)</span> + </h3> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="items"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">items</span>(<span class="sig-arg">self</span>)</span> + </h3> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="keys"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">keys</span>(<span class="sig-arg">self</span>)</span> + </h3> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="values"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">values</span>(<span class="sig-arg">self</span>)</span> + </h3> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/private/psycopg2.extras.SQL_IN-class.html b/psycopg2/doc/api/private/psycopg2.extras.SQL_IN-class.html new file mode 100644 index 00000000..6b7009b0 --- /dev/null +++ b/psycopg2/doc/api/private/psycopg2.extras.SQL_IN-class.html @@ -0,0 +1,171 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.extras.SQL_IN</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + <a href="psycopg2.extras-module.html">Module extras</a> :: + Class SQL_IN + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.extras.SQL_IN-class.html">hide private</a>]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.extras.SQL_IN-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Type SQL_IN</h2> + +<pre class="base-tree"> +<a href="__builtin__.object-class.html"><code>object</code></a> --+ + | + <strong class="uidshort">SQL_IN</strong> +</pre><br /> + +<hr/> + +<p>Adapt any iterable to an SQL quotable object.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__init__"></a><span class="summary-sig"><span class="summary-sig-name">__init__</span>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">seq</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="getquoted"></a><span class="summary-sig"><span class="summary-sig-name">__str__</span>(<span class="summary-sig-arg">self</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="getquoted"></a><span class="summary-sig"><span class="summary-sig-name">getquoted</span>(<span class="summary-sig-arg">self</span>)</span></code> +</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from object</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__delattr__('name') <==> del x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__getattribute__('name') <==> x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return hash(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__new__" class="summary-sig-name"><code>__new__</code></a>(<span class="summary-sig-arg">T</span>, + <span class="summary-sig-arg">S</span>, + <span class="summary-sig-vararg">...</span>)</span></code> +<br /> +Return a new object with type S, a subtype of T...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return repr(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__setattr__('name', value) <==> x.name = value</td></tr> +</table><br /> + + +<!-- =========== START OF METHOD DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Method Details</th></tr> +</table> + +<a name="__init__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">seq</span>)</span> + <br /><em class="fname">(Constructor)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__init__"><code>__builtin__.object.__init__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="getquoted"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__str__</span>(<span class="sig-arg">self</span>)</span> + <br /><em class="fname">(Informal representation operator)</em> + </h3> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="getquoted"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">getquoted</span>(<span class="sig-arg">self</span>)</span> + </h3> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:35 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/private/psycopg2.pool-module.html b/psycopg2/doc/api/private/psycopg2.pool-module.html new file mode 100644 index 00000000..64e53c1c --- /dev/null +++ b/psycopg2/doc/api/private/psycopg2.pool-module.html @@ -0,0 +1,126 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.pool</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + Module pool + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.pool-module.html">hide private</a>]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.pool-module.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF MODULE DESCRIPTION =========== --> +<h2 class="module">Module psycopg2.pool</h2> + +<p>Connection pooling for psycopg2</p> +<p>This module implements thread-safe (and not) connection pools.</p> +<hr/> + +<!-- =========== START OF CLASSES =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Classes</th></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.pool.AbstractConnectionPool-class.html"><code>AbstractConnectionPool</code></a></strong></td> + <td>Generic key-based pooling code.</td></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.pool.PersistentConnectionPool-class.html"><code>PersistentConnectionPool</code></a></strong></td> + <td>A pool that assigns persistent connections to different threads.</td></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.pool.SimpleConnectionPool-class.html"><code>SimpleConnectionPool</code></a></strong></td> + <td>A connection pool that can't be shared across different threads.</td></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.pool.ThreadedConnectionPool-class.html"><code>ThreadedConnectionPool</code></a></strong></td> + <td>A connection pool that works with the threading module.</td></tr> +</table><br /> + + +<!-- =========== START OF EXCEPTIONS =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Exceptions</th></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.pool.PoolError-class.html"><code>PoolError</code></a></strong></td> + <td> </td></tr> +</table><br /> + + +<!-- =========== START OF FUNCTION SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Function Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="dbg"></a><span class="summary-sig"><span class="summary-sig-name">dbg</span>(<span class="summary-sig-vararg">*args</span>)</span></code> +</td></tr> +</table><br /> + + +<!-- =========== START OF FUNCTION DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Function Details</th></tr> +</table> + +<a name="dbg"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">dbg</span>(<span class="sig-vararg">*args</span>)</span> + </h3> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:34 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/private/psycopg2.pool.AbstractConnectionPool-class.html b/psycopg2/doc/api/private/psycopg2.pool.AbstractConnectionPool-class.html new file mode 100644 index 00000000..be79964a --- /dev/null +++ b/psycopg2/doc/api/private/psycopg2.pool.AbstractConnectionPool-class.html @@ -0,0 +1,247 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.pool.AbstractConnectionPool</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + <a href="psycopg2.pool-module.html">Module pool</a> :: + Class AbstractConnectionPool + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.pool.AbstractConnectionPool-class.html">hide private</a>]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.pool.AbstractConnectionPool-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Type AbstractConnectionPool</h2> + +<pre class="base-tree"> +<a href="__builtin__.object-class.html"><code>object</code></a> --+ + | + <strong class="uidshort">AbstractConnectionPool</strong> +</pre><br /> + +<dl><dt>Known Subclasses:</dt> +<dd> + <a href="psycopg2.pool.PersistentConnectionPool-class.html"><code>PersistentConnectionPool</code></a>, + <a href="psycopg2.pool.SimpleConnectionPool-class.html"><code>SimpleConnectionPool</code></a>, + <a href="psycopg2.pool.ThreadedConnectionPool-class.html"><code>ThreadedConnectionPool</code></a></dd></dl> + +<hr/> + +<p>Generic key-based pooling code.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="psycopg2.pool.AbstractConnectionPool-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">minconn</span>, + <span class="summary-sig-arg">maxconn</span>, + <span class="summary-sig-vararg">*args</span>, + <span class="summary-sig-kwarg">**kwargs</span>)</span></code> +<br /> +Initialize the connection pool.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_closeall" class="summary-sig-name"><code>_closeall</code></a>(<span class="summary-sig-arg">self</span>)</span></code> +<br /> +Close all connections.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_connect" class="summary-sig-name"><code>_connect</code></a>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">key</span>)</span></code> +<br /> +Create a new connection and assign it to 'key' if not None.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_getconn" class="summary-sig-name"><code>_getconn</code></a>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">key</span>)</span></code> +<br /> +Get a free connection and assign it to 'key' if not None.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_getkey" class="summary-sig-name"><code>_getkey</code></a>(<span class="summary-sig-arg">self</span>)</span></code> +<br /> +Return a new unique key.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_putconn" class="summary-sig-name"><code>_putconn</code></a>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">conn</span>, + <span class="summary-sig-arg">key</span>, + <span class="summary-sig-arg">close</span>)</span></code> +<br /> +Put away a connection.</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from object</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__delattr__('name') <==> del x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__getattribute__('name') <==> x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return hash(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__new__" class="summary-sig-name"><code>__new__</code></a>(<span class="summary-sig-arg">T</span>, + <span class="summary-sig-arg">S</span>, + <span class="summary-sig-vararg">...</span>)</span></code> +<br /> +Return a new object with type S, a subtype of T...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return repr(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__setattr__('name', value) <==> x.name = value</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return str(x)...</td></tr> +</table><br /> + + +<!-- =========== START OF METHOD DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Method Details</th></tr> +</table> + +<a name="__init__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">minconn</span>, + <span class="sig-arg">maxconn</span>, + <span class="sig-vararg">*args</span>, + <span class="sig-kwarg">**kwargs</span>)</span> + <br /><em class="fname">(Constructor)</em> + </h3> +<p>Initialize the connection pool.</p> +<p>New 'minconn' connections are created immediately calling 'connfunc' +with given parameters. The connection pool will support a maximum of +about 'maxconn' connections.</p> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__init__"><code>__builtin__.object.__init__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="_closeall"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">_closeall</span>(<span class="sig-arg">self</span>)</span> + </h3> +<p>Close all connections.</p> +<p>Note that this can lead to some code fail badly when trying to use +an already closed connection. If you call .closeall() make sure +your code can deal with it.</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="_connect"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">_connect</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">key</span>=<span class="sig-default">None</span>)</span> + </h3> +<p>Create a new connection and assign it to 'key' if not None.</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="_getconn"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">_getconn</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">key</span>=<span class="sig-default">None</span>)</span> + </h3> +<p>Get a free connection and assign it to 'key' if not None.</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="_getkey"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">_getkey</span>(<span class="sig-arg">self</span>)</span> + </h3> +<p>Return a new unique key.</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="_putconn"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">_putconn</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">conn</span>, + <span class="sig-arg">key</span>=<span class="sig-default">None</span>, + <span class="sig-arg">close</span>=<span class="sig-default">False</span>)</span> + </h3> +<p>Put away a connection.</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:34 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/private/psycopg2.pool.PersistentConnectionPool-class.html b/psycopg2/doc/api/private/psycopg2.pool.PersistentConnectionPool-class.html new file mode 100644 index 00000000..4656713d --- /dev/null +++ b/psycopg2/doc/api/private/psycopg2.pool.PersistentConnectionPool-class.html @@ -0,0 +1,237 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.pool.PersistentConnectionPool</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + <a href="psycopg2.pool-module.html">Module pool</a> :: + Class PersistentConnectionPool + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.pool.PersistentConnectionPool-class.html">hide private</a>]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.pool.PersistentConnectionPool-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Type PersistentConnectionPool</h2> + +<pre class="base-tree"> + <a href="__builtin__.object-class.html"><code>object</code></a> --+ + | +<a href="psycopg2.pool.AbstractConnectionPool-class.html"><code>AbstractConnectionPool</code></a> --+ + | + <strong class="uidshort">PersistentConnectionPool</strong> +</pre><br /> + +<hr/> + +<p>A pool that assigns persistent connections to different threads.</p> +<p>Note that this connection pool generates by itself the required keys +using the current thread id. This means that untill a thread put away +a connection it will always get the same connection object by successive +.getconn() calls. This also means that a thread can't use more than one +single connection from the pool.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="psycopg2.pool.PersistentConnectionPool-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">minconn</span>, + <span class="summary-sig-arg">maxconn</span>, + <span class="summary-sig-vararg">*args</span>, + <span class="summary-sig-kwarg">**kwargs</span>)</span></code> +<br /> +Initialize the threading lock.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="psycopg2.pool.PersistentConnectionPool-class.html#closeall" class="summary-sig-name"><code>closeall</code></a>(<span class="summary-sig-arg">self</span>)</span></code> +<br /> +Close all connections (even the one currently in use.)</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="psycopg2.pool.PersistentConnectionPool-class.html#getconn" class="summary-sig-name"><code>getconn</code></a>(<span class="summary-sig-arg">self</span>)</span></code> +<br /> +Generate thread id and return a connection.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="psycopg2.pool.PersistentConnectionPool-class.html#putconn" class="summary-sig-name"><code>putconn</code></a>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">conn</span>, + <span class="summary-sig-arg">close</span>)</span></code> +<br /> +Put away an unused connection.</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from AbstractConnectionPool</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_closeall" class="summary-sig-name"><code>_closeall</code></a>(<span class="summary-sig-arg">self</span>)</span></code> +<br /> +Close all connections.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_connect" class="summary-sig-name"><code>_connect</code></a>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">key</span>)</span></code> +<br /> +Create a new connection and assign it to 'key' if not None.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_getconn" class="summary-sig-name"><code>_getconn</code></a>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">key</span>)</span></code> +<br /> +Get a free connection and assign it to 'key' if not None.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_getkey" class="summary-sig-name"><code>_getkey</code></a>(<span class="summary-sig-arg">self</span>)</span></code> +<br /> +Return a new unique key.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_putconn" class="summary-sig-name"><code>_putconn</code></a>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">conn</span>, + <span class="summary-sig-arg">key</span>, + <span class="summary-sig-arg">close</span>)</span></code> +<br /> +Put away a connection.</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from object</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__delattr__('name') <==> del x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__getattribute__('name') <==> x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return hash(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__new__" class="summary-sig-name"><code>__new__</code></a>(<span class="summary-sig-arg">T</span>, + <span class="summary-sig-arg">S</span>, + <span class="summary-sig-vararg">...</span>)</span></code> +<br /> +Return a new object with type S, a subtype of T...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return repr(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__setattr__('name', value) <==> x.name = value</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return str(x)...</td></tr> +</table><br /> + + +<!-- =========== START OF METHOD DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Method Details</th></tr> +</table> + +<a name="__init__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">minconn</span>, + <span class="sig-arg">maxconn</span>, + <span class="sig-vararg">*args</span>, + <span class="sig-kwarg">**kwargs</span>)</span> + <br /><em class="fname">(Constructor)</em> + </h3> +<p>Initialize the threading lock.</p> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="psycopg2.pool.AbstractConnectionPool-class.html#__init__"><code>psycopg2.pool.AbstractConnectionPool.__init__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="closeall"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">closeall</span>(<span class="sig-arg">self</span>)</span> + </h3> +<p>Close all connections (even the one currently in use.)</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="getconn"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">getconn</span>(<span class="sig-arg">self</span>)</span> + </h3> +<p>Generate thread id and return a connection.</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="putconn"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">putconn</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">conn</span>=<span class="sig-default">None</span>, + <span class="sig-arg">close</span>=<span class="sig-default">False</span>)</span> + </h3> +<p>Put away an unused connection.</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:34 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/private/psycopg2.pool.PoolError-class.html b/psycopg2/doc/api/private/psycopg2.pool.PoolError-class.html new file mode 100644 index 00000000..83a85cf6 --- /dev/null +++ b/psycopg2/doc/api/private/psycopg2.pool.PoolError-class.html @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.pool.PoolError</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + <a href="psycopg2.pool-module.html">Module pool</a> :: + Class PoolError + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.pool.PoolError-class.html">hide private</a>]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.pool.PoolError-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Class PoolError</h2> + +<pre class="base-tree"> +<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ + | +<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+ + | + <a href="psycopg2.Error-class.html"><code>Error</code></a> --+ + | + <strong class="uidshort">PoolError</strong> +</pre><br /> + +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from Exception</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +</table><br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:34 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/private/psycopg2.pool.SimpleConnectionPool-class.html b/psycopg2/doc/api/private/psycopg2.pool.SimpleConnectionPool-class.html new file mode 100644 index 00000000..06c9bb66 --- /dev/null +++ b/psycopg2/doc/api/private/psycopg2.pool.SimpleConnectionPool-class.html @@ -0,0 +1,222 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.pool.SimpleConnectionPool</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + <a href="psycopg2.pool-module.html">Module pool</a> :: + Class SimpleConnectionPool + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.pool.SimpleConnectionPool-class.html">hide private</a>]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.pool.SimpleConnectionPool-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Type SimpleConnectionPool</h2> + +<pre class="base-tree"> + <a href="__builtin__.object-class.html"><code>object</code></a> --+ + | +<a href="psycopg2.pool.AbstractConnectionPool-class.html"><code>AbstractConnectionPool</code></a> --+ + | + <strong class="uidshort">SimpleConnectionPool</strong> +</pre><br /> + +<hr/> + +<p>A connection pool that can't be shared across different threads.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.SimpleConnectionPool-class.html#_closeall" class="summary-sig-name"><code>closeall</code></a>(<span class="summary-sig-arg">self</span>)</span></code> +<br /> +Close all connections.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.SimpleConnectionPool-class.html#_getconn" class="summary-sig-name"><code>getconn</code></a>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">key</span>)</span></code> +<br /> +Get a free connection and assign it to 'key' if not None.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.SimpleConnectionPool-class.html#_putconn" class="summary-sig-name"><code>putconn</code></a>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">conn</span>, + <span class="summary-sig-arg">key</span>, + <span class="summary-sig-arg">close</span>)</span></code> +<br /> +Put away a connection.</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from AbstractConnectionPool</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="psycopg2.pool.AbstractConnectionPool-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">minconn</span>, + <span class="summary-sig-arg">maxconn</span>, + <span class="summary-sig-vararg">*args</span>, + <span class="summary-sig-kwarg">**kwargs</span>)</span></code> +<br /> +Initialize the connection pool.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_closeall" class="summary-sig-name"><code>_closeall</code></a>(<span class="summary-sig-arg">self</span>)</span></code> +<br /> +Close all connections.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_connect" class="summary-sig-name"><code>_connect</code></a>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">key</span>)</span></code> +<br /> +Create a new connection and assign it to 'key' if not None.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_getconn" class="summary-sig-name"><code>_getconn</code></a>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">key</span>)</span></code> +<br /> +Get a free connection and assign it to 'key' if not None.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_getkey" class="summary-sig-name"><code>_getkey</code></a>(<span class="summary-sig-arg">self</span>)</span></code> +<br /> +Return a new unique key.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_putconn" class="summary-sig-name"><code>_putconn</code></a>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">conn</span>, + <span class="summary-sig-arg">key</span>, + <span class="summary-sig-arg">close</span>)</span></code> +<br /> +Put away a connection.</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from object</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__delattr__('name') <==> del x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__getattribute__('name') <==> x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return hash(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__new__" class="summary-sig-name"><code>__new__</code></a>(<span class="summary-sig-arg">T</span>, + <span class="summary-sig-arg">S</span>, + <span class="summary-sig-vararg">...</span>)</span></code> +<br /> +Return a new object with type S, a subtype of T...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return repr(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__setattr__('name', value) <==> x.name = value</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return str(x)...</td></tr> +</table><br /> + + +<!-- =========== START OF METHOD DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Method Details</th></tr> +</table> + +<a name="_closeall"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">closeall</span>(<span class="sig-arg">self</span>)</span> + </h3> +<p>Close all connections.</p> +<p>Note that this can lead to some code fail badly when trying to use +an already closed connection. If you call .closeall() make sure +your code can deal with it.</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="_getconn"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">getconn</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">key</span>=<span class="sig-default">None</span>)</span> + </h3> +<p>Get a free connection and assign it to 'key' if not None.</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="_putconn"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">putconn</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">conn</span>, + <span class="sig-arg">key</span>=<span class="sig-default">None</span>, + <span class="sig-arg">close</span>=<span class="sig-default">False</span>)</span> + </h3> +<p>Put away a connection.</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:35 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/private/psycopg2.pool.ThreadedConnectionPool-class.html b/psycopg2/doc/api/private/psycopg2.pool.ThreadedConnectionPool-class.html new file mode 100644 index 00000000..1ad34cb4 --- /dev/null +++ b/psycopg2/doc/api/private/psycopg2.pool.ThreadedConnectionPool-class.html @@ -0,0 +1,236 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.pool.ThreadedConnectionPool</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + <a href="psycopg2.pool-module.html">Module pool</a> :: + Class ThreadedConnectionPool + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.pool.ThreadedConnectionPool-class.html">hide private</a>]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.pool.ThreadedConnectionPool-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Type ThreadedConnectionPool</h2> + +<pre class="base-tree"> + <a href="__builtin__.object-class.html"><code>object</code></a> --+ + | +<a href="psycopg2.pool.AbstractConnectionPool-class.html"><code>AbstractConnectionPool</code></a> --+ + | + <strong class="uidshort">ThreadedConnectionPool</strong> +</pre><br /> + +<hr/> + +<p>A connection pool that works with the threading module.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="psycopg2.pool.ThreadedConnectionPool-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">minconn</span>, + <span class="summary-sig-arg">maxconn</span>, + <span class="summary-sig-vararg">*args</span>, + <span class="summary-sig-kwarg">**kwargs</span>)</span></code> +<br /> +Initialize the threading lock.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="psycopg2.pool.ThreadedConnectionPool-class.html#closeall" class="summary-sig-name"><code>closeall</code></a>(<span class="summary-sig-arg">self</span>)</span></code> +<br /> +Close all connections (even the one currently in use.)</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="psycopg2.pool.ThreadedConnectionPool-class.html#getconn" class="summary-sig-name"><code>getconn</code></a>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">key</span>)</span></code> +<br /> +Get a free connection and assign it to 'key' if not None.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="psycopg2.pool.ThreadedConnectionPool-class.html#putconn" class="summary-sig-name"><code>putconn</code></a>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">conn</span>, + <span class="summary-sig-arg">key</span>, + <span class="summary-sig-arg">close</span>)</span></code> +<br /> +Put away an unused connection.</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from AbstractConnectionPool</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_closeall" class="summary-sig-name"><code>_closeall</code></a>(<span class="summary-sig-arg">self</span>)</span></code> +<br /> +Close all connections.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_connect" class="summary-sig-name"><code>_connect</code></a>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">key</span>)</span></code> +<br /> +Create a new connection and assign it to 'key' if not None.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_getconn" class="summary-sig-name"><code>_getconn</code></a>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">key</span>)</span></code> +<br /> +Get a free connection and assign it to 'key' if not None.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_getkey" class="summary-sig-name"><code>_getkey</code></a>(<span class="summary-sig-arg">self</span>)</span></code> +<br /> +Return a new unique key.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2.pool.AbstractConnectionPool-class.html#_putconn" class="summary-sig-name"><code>_putconn</code></a>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">conn</span>, + <span class="summary-sig-arg">key</span>, + <span class="summary-sig-arg">close</span>)</span></code> +<br /> +Put away a connection.</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from object</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__delattr__('name') <==> del x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__getattribute__('name') <==> x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return hash(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__new__" class="summary-sig-name"><code>__new__</code></a>(<span class="summary-sig-arg">T</span>, + <span class="summary-sig-arg">S</span>, + <span class="summary-sig-vararg">...</span>)</span></code> +<br /> +Return a new object with type S, a subtype of T...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return repr(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__setattr__('name', value) <==> x.name = value</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return str(x)...</td></tr> +</table><br /> + + +<!-- =========== START OF METHOD DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Method Details</th></tr> +</table> + +<a name="__init__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">minconn</span>, + <span class="sig-arg">maxconn</span>, + <span class="sig-vararg">*args</span>, + <span class="sig-kwarg">**kwargs</span>)</span> + <br /><em class="fname">(Constructor)</em> + </h3> +<p>Initialize the threading lock.</p> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="psycopg2.pool.AbstractConnectionPool-class.html#__init__"><code>psycopg2.pool.AbstractConnectionPool.__init__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="closeall"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">closeall</span>(<span class="sig-arg">self</span>)</span> + </h3> +<p>Close all connections (even the one currently in use.)</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="getconn"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">getconn</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">key</span>=<span class="sig-default">None</span>)</span> + </h3> +<p>Get a free connection and assign it to 'key' if not None.</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="putconn"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">putconn</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">conn</span>=<span class="sig-default">None</span>, + <span class="sig-arg">key</span>=<span class="sig-default">None</span>, + <span class="sig-arg">close</span>=<span class="sig-default">False</span>)</span> + </h3> +<p>Put away an unused connection.</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:35 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/private/psycopg2.psycopg1-module.html b/psycopg2/doc/api/private/psycopg2.psycopg1-module.html new file mode 100644 index 00000000..f535cb9b --- /dev/null +++ b/psycopg2/doc/api/private/psycopg2.psycopg1-module.html @@ -0,0 +1,121 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.psycopg1</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + Module psycopg1 + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.psycopg1-module.html">hide private</a>]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.psycopg1-module.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF MODULE DESCRIPTION =========== --> +<h2 class="module">Module psycopg2.psycopg1</h2> + +<p>psycopg 1.1.x compatibility module</p> +<p>This module uses the new style connection and cursor types to build a psycopg +1.1.1.x compatibility layer. It should be considered a temporary hack to run +old code while porting to psycopg 2. Import it as follows:</p> +<pre class="literal-block"> +from psycopg2 import psycopg1 as psycopg +</pre> +<hr/> + +<!-- =========== START OF CLASSES =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Classes</th></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.psycopg1.connection-class.html"><code>connection</code></a></strong></td> + <td>psycopg 1.1.x connection.</td></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.psycopg1.cursor-class.html"><code>cursor</code></a></strong></td> + <td>psycopg 1.1.x cursor.</td></tr> +</table><br /> + + +<!-- =========== START OF FUNCTION SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Function Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">new psycopg 1.1.x compatible connection object</td> + <td><code><a name="connect"></a><span class="summary-sig"><span class="summary-sig-name">connect</span>(<span class="summary-sig-arg">dsn</span>, + <span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +</table><br /> + + +<!-- =========== START OF FUNCTION DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Function Details</th></tr> +</table> + +<a name="connect"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">connect</span>(<span class="sig-arg">dsn</span>, + <span class="sig-vararg">...</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +new psycopg 1.1.x compatible connection object </dd> + </dl> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/private/psycopg2.psycopg1.connection-class.html b/psycopg2/doc/api/private/psycopg2.psycopg1.connection-class.html new file mode 100644 index 00000000..6d52ff84 --- /dev/null +++ b/psycopg2/doc/api/private/psycopg2.psycopg1.connection-class.html @@ -0,0 +1,221 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.psycopg1.connection</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + <a href="psycopg2.psycopg1-module.html">Module psycopg1</a> :: + Class connection + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.psycopg1.connection-class.html">hide private</a>]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.psycopg1.connection-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Type connection</h2> + +<pre class="base-tree"> +<a href="__builtin__.object-class.html"><code>object</code></a> --+ + | +<a href="../private/psycopg2._psycopg.connection-class.html"><code>connection</code></a> --+ + | + <strong class="uidshort">connection</strong> +</pre><br /> + +<hr/> + +<p>psycopg 1.1.x connection.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">switch autocommit on (1) or off (0)</td> + <td><code><a name="autocommit"></a><span class="summary-sig"><span class="summary-sig-name">autocommit</span>(<span class="summary-sig-arg">on_off</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">new psycopg 1.1.x compatible cursor object</td> + <td><code><a name="cursor"></a><span class="summary-sig"><span class="summary-sig-name">cursor</span>()</span></code> +</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from connection</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__init__(...) initializes x; see x.__class__.__doc__ for signature</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#__new__" class="summary-sig-name"><code>__new__</code></a>(<span class="summary-sig-arg">T</span>, + <span class="summary-sig-arg">S</span>, + <span class="summary-sig-vararg">...</span>)</span></code> +<br /> +Return a new object with type S, a subtype of T...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return repr(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return str(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#close" class="summary-sig-name"><code>close</code></a>()</span></code> +<br /> +Close the connection.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#commit" class="summary-sig-name"><code>commit</code></a>()</span></code> +<br /> +Commit all changes to database.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#rollback" class="summary-sig-name"><code>rollback</code></a>()</span></code> +<br /> +Roll back all changes done to database.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#set_client_encoding" class="summary-sig-name"><code>set_client_encoding</code></a>(<span class="summary-sig-arg">encoding</span>)</span></code> +<br /> +Set client encoding to <tt class="docutils literal docutils literal docutils literal docutils literal"><span class="pre">encoding</span></tt>.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.connection-class.html#set_isolation_level" class="summary-sig-name"><code>set_isolation_level</code></a>(<span class="summary-sig-arg">level</span>)</span></code> +<br /> +Switch isolation level to <tt class="docutils literal docutils literal docutils literal docutils literal"><span class="pre">level</span></tt>.</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from object</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__delattr__('name') <==> del x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__getattribute__('name') <==> x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return hash(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__setattr__('name', value) <==> x.name = value</td></tr> +</table><br /> + + +<!-- =========== START OF PROPERTY SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Property Summary</th></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from connection</th></tr> +<tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#closed"><code>closed</code></a></strong>: True if the connection is closed.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#DatabaseError"><code>DatabaseError</code></a></strong>: Error related to the database engine.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#DataError"><code>DataError</code></a></strong>: Error related to problems with the processed data.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#dsn"><code>dsn</code></a></strong>: The current connection string.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#encoding"><code>encoding</code></a></strong>: The current client encoding.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#Error"><code>Error</code></a></strong>: Base class for error exceptions.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#IntegrityError"><code>IntegrityError</code></a></strong>: Error related to database integrity.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#InterfaceError"><code>InterfaceError</code></a></strong>: Error related to the database interface.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#InternalError"><code>InternalError</code></a></strong>: The database encountered an internal error.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#isolation_level"><code>isolation_level</code></a></strong>: The current isolation level.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#notices"><code>notices</code></a></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#notifies"><code>notifies</code></a></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#NotSupportedError"><code>NotSupportedError</code></a></strong>: A not supported datbase API was called.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#OperationalError"><code>OperationalError</code></a></strong>: Error related to database operation (disconnect, memory allocation etc).</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#ProgrammingError"><code>ProgrammingError</code></a></strong>: Error related to database programming (SQL error, table not found etc).</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.connection-class.html#Warning"><code>Warning</code></a></strong>: A database warning.</td></tr></table><br /> + + +<!-- =========== START OF METHOD DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Method Details</th></tr> +</table> + +<a name="autocommit"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">autocommit</span>(<span class="sig-arg">on_off</span>=<span class="sig-default">1</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +switch autocommit on (1) or off (0) </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="cursor"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">cursor</span>()</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +new psycopg 1.1.x compatible cursor object </dd> + </dl> + <dl><dt>Overrides:</dt> + <dd><a href="../private/psycopg2._psycopg.connection-class.html#cursor"><code>psycopg2._psycopg.connection.cursor</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/private/psycopg2.psycopg1.cursor-class.html b/psycopg2/doc/api/private/psycopg2.psycopg1.cursor-class.html new file mode 100644 index 00000000..17d22e08 --- /dev/null +++ b/psycopg2/doc/api/private/psycopg2.psycopg1.cursor-class.html @@ -0,0 +1,308 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.psycopg1.cursor</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + <a href="psycopg2.psycopg1-module.html">Module psycopg1</a> :: + Class cursor + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.psycopg1.cursor-class.html">hide private</a>]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.psycopg1.cursor-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Type cursor</h2> + +<pre class="base-tree"> +<a href="__builtin__.object-class.html"><code>object</code></a> --+ + | + <a href="../private/psycopg2._psycopg.cursor-class.html"><code>cursor</code></a> --+ + | + <strong class="uidshort">cursor</strong> +</pre><br /> + +<hr/> + +<p>psycopg 1.1.x cursor.</p> +<p>Note that this cursor implements the exact procedure used by psycopg 1 to +build dictionaries out of result rows. The DictCursor in the +psycopg.extras modules implements a much better and faster algorithm.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="dictfetchall"></a><span class="summary-sig"><span class="summary-sig-name">dictfetchall</span>(<span class="summary-sig-arg">self</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="dictfetchmany"></a><span class="summary-sig"><span class="summary-sig-name">dictfetchmany</span>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">size</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="dictfetchone"></a><span class="summary-sig"><span class="summary-sig-name">dictfetchone</span>(<span class="summary-sig-arg">self</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__build_dict"></a><span class="summary-sig"><span class="summary-sig-name">__build_dict</span>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">row</span>)</span></code> +</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from cursor</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__init__(...) initializes x; see x.__class__.__doc__ for signature</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#__iter__" class="summary-sig-name"><code>__iter__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return iter(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#__new__" class="summary-sig-name"><code>__new__</code></a>(<span class="summary-sig-arg">T</span>, + <span class="summary-sig-arg">S</span>, + <span class="summary-sig-vararg">...</span>)</span></code> +<br /> +Return a new object with type S, a subtype of T...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return repr(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return str(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#callproc" class="summary-sig-name"><code>callproc</code></a>(<span class="summary-sig-arg">procname</span>, + <span class="summary-sig-arg">parameters</span>, + <span class="summary-sig-arg">async</span>)</span></code> +<br /> +Execute stored procedure.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#close" class="summary-sig-name"><code>close</code></a>()</span></code> +<br /> +Close the cursor.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#copy_from" class="summary-sig-name"><code>copy_from</code></a>(<span class="summary-sig-arg">file</span>, + <span class="summary-sig-arg">table</span>, + <span class="summary-sig-arg">sep</span>, + <span class="summary-sig-arg">null</span>)</span></code> +<br /> +Copy table from file.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#copy_to" class="summary-sig-name"><code>copy_to</code></a>(<span class="summary-sig-arg">file</span>, + <span class="summary-sig-arg">table</span>, + <span class="summary-sig-arg">sep</span>, + <span class="summary-sig-arg">null</span>)</span></code> +<br /> +Copy table to file.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#execute" class="summary-sig-name"><code>execute</code></a>(<span class="summary-sig-arg">query</span>, + <span class="summary-sig-arg">vars</span>, + <span class="summary-sig-arg">async</span>)</span></code> +<br /> +Execute query with bound vars.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#executemany" class="summary-sig-name"><code>executemany</code></a>(<span class="summary-sig-arg">query</span>, + <span class="summary-sig-arg">vars_list</span>, + <span class="summary-sig-arg">async</span>)</span></code> +<br /> +Execute many queries with bound vars.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">list of tuple</td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#fetchall" class="summary-sig-name"><code>fetchall</code></a>()</span></code> +<br /> +Return all the remaining rows of a query result set.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">list of tuple</td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#fetchmany" class="summary-sig-name"><code>fetchmany</code></a>(<span class="summary-sig-arg">size</span>)</span></code> +<br /> +Return the next <a href="../private/psycopg2._psycopg.cursor-class.html#fetchmany" class="link"><code>size</code></a> rows of a query result set in the form of a list +of tuples (by default) or using the sequence factory previously set in +the <a href="../private/psycopg2._psycopg.cursor-class.html#row_factory" class="link"><code>row_factory</code></a> attribute.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">tuple or None</td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#fetchone" class="summary-sig-name"><code>fetchone</code></a>()</span></code> +<br /> +Return the next row of a query result set in the form of a tuple (by +default) or using the sequence factory previously set in the +<a href="../private/psycopg2._psycopg.cursor-class.html#row_factory" class="link"><code>row_factory</code></a> attribute.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">int</td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#fileno" class="summary-sig-name"><code>fileno</code></a>()</span></code> +<br /> +Return file descriptor associated to database connection.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">bool</td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#isready" class="summary-sig-name"><code>isready</code></a>()</span></code> +<br /> +Return True if data is ready after an async query.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">str</td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#mogrify" class="summary-sig-name"><code>mogrify</code></a>(<span class="summary-sig-arg">query</span>, + <span class="summary-sig-arg">vars</span>)</span></code> +<br /> +Return query after vars binding.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#next" class="summary-sig-name"><code>next</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return the next value, or raise StopIteration...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#nextset" class="summary-sig-name"><code>nextset</code></a>()</span></code> +<br /> +Skip to next set of data.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#scroll" class="summary-sig-name"><code>scroll</code></a>(<span class="summary-sig-arg">value</span>, + <span class="summary-sig-arg">mode</span>)</span></code> +<br /> +Scroll to new position according to mode.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#setinputsizes" class="summary-sig-name"><code>setinputsizes</code></a>(<span class="summary-sig-arg">sizes</span>)</span></code> +<br /> +Set memory areas before execute.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="../private/psycopg2._psycopg.cursor-class.html#setoutputsize" class="summary-sig-name"><code>setoutputsize</code></a>(<span class="summary-sig-arg">size</span>, + <span class="summary-sig-arg">column</span>)</span></code> +<br /> +Set column buffer size.</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from object</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__delattr__('name') <==> del x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__getattribute__('name') <==> x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return hash(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__setattr__('name', value) <==> x.name = value</td></tr> +</table><br /> + + +<!-- =========== START OF PROPERTY SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Property Summary</th></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from cursor</th></tr> +<tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#arraysize"><code>arraysize</code></a></strong>: Number of records <a href="../private/psycopg2._psycopg.cursor-class.html#fetchmany" class="link"><code>fetchmany()</code></a> must fetch if not explicitely specified.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#binary_types"><code>binary_types</code></a></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#connection"><code>connection</code></a></strong>: The connection where the cursor comes from.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#description"><code>description</code></a></strong>: Cursor description as defined in DBAPI-2.0.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#lastrowid"><code>lastrowid</code></a></strong>: The <tt class="docutils literal docutils literal"><span class="pre">oid</span></tt> of the last row inserted by the cursor.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#name"><code>name</code></a></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#query"><code>query</code></a></strong>: The last query text sent to the backend.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#row_factory"><code>row_factory</code></a></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#rowcount"><code>rowcount</code></a></strong>: Number of rows read from the backend in the last command.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#rownumber"><code>rownumber</code></a></strong>: The current row position.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#statusmessage"><code>statusmessage</code></a></strong>: The return message of the last command.</td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#string_types"><code>string_types</code></a></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#typecaster"><code>typecaster</code></a></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><strong><a href="../private/psycopg2._psycopg.cursor-class.html#tzinfo_factory"><code>tzinfo_factory</code></a></strong></td></tr></table><br /> + + +<!-- =========== START OF METHOD DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Method Details</th></tr> +</table> + +<a name="dictfetchall"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">dictfetchall</span>(<span class="sig-arg">self</span>)</span> + </h3> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="dictfetchmany"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">dictfetchmany</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">size</span>)</span> + </h3> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="dictfetchone"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">dictfetchone</span>(<span class="sig-arg">self</span>)</span> + </h3> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="__build_dict"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__build_dict</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">row</span>)</span> + </h3> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:33 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/private/psycopg2.tz-module.html b/psycopg2/doc/api/private/psycopg2.tz-module.html new file mode 100644 index 00000000..9b8244a4 --- /dev/null +++ b/psycopg2/doc/api/private/psycopg2.tz-module.html @@ -0,0 +1,193 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.tz</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + Module tz + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.tz-module.html">hide private</a>]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.tz-module.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF MODULE DESCRIPTION =========== --> +<h2 class="module">Module psycopg2.tz</h2> + +<p>tzinfo implementations for psycopg2</p> +<p>This module holds two different tzinfo implementations that can be used as +the 'tzinfo' argument to datetime constructors, directly passed to psycopg +functions or used to set the .tzinfo_factory attribute in cursors.</p> +<hr/> + +<!-- =========== START OF CLASSES =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Classes</th></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.tz.FixedOffsetTimezone-class.html"><code>FixedOffsetTimezone</code></a></strong></td> + <td>Fixed offset in minutes east from UTC.</td></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.tz.LocalTimezone-class.html"><code>LocalTimezone</code></a></strong></td> + <td>Platform idea of local timezone.</td></tr> +</table><br /> + + +<!-- =========== START OF VARIABLE SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Variable Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>timedelta</code></td> +<td><strong><a href="psycopg2.tz-module.html#DSTDIFF"><code>DSTDIFF</code></a></strong> = <span title="datetime.timedelta(0, 3600)"><code>datetime.timedelta(0, 3600) </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>LocalTimezone</code></td> +<td><strong><a href="psycopg2.tz-module.html#LOCAL"><code>LOCAL</code></a></strong> = <span title="<psycopg2.tz.LocalTimezone object at 0x00847090>"><code><psycopg2.tz.LocalTimezone object at 0x00847090> </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>timedelta</code></td> +<td><strong><a href="psycopg2.tz-module.html#STDOFFSET"><code>STDOFFSET</code></a></strong> = <span title="datetime.timedelta(0, 3600)"><code>datetime.timedelta(0, 3600) </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>timedelta</code></td> +<td><strong><a href="psycopg2.tz-module.html#ZERO"><code>ZERO</code></a></strong> = <span title="datetime.timedelta(0)"><code>datetime.timedelta(0) </code> +</span></td></tr> +</table><br /> + + +<!-- =========== START OF VARIABLE DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Variable Details</th></tr> +</table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="DSTDIFF"></a> +<h3>DSTDIFF</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>timedelta</code> + + </dd> + <dt title="datetime.timedelta(0, 3600)">Value:</dt> + <dd title="datetime.timedelta(0, 3600)"><table><tr><td> +<pre class="variable"> +datetime.timedelta(0, 3600) </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="LOCAL"></a> +<h3>LOCAL</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>LocalTimezone</code> + + </dd> + <dt title="<psycopg2.tz.LocalTimezone object at 0x00847090>">Value:</dt> + <dd title="<psycopg2.tz.LocalTimezone object at 0x00847090>"><table><tr><td> +<pre class="variable"> +<psycopg2.tz.LocalTimezone object at 0x00847090> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="STDOFFSET"></a> +<h3>STDOFFSET</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>timedelta</code> + + </dd> + <dt title="datetime.timedelta(0, 3600)">Value:</dt> + <dd title="datetime.timedelta(0, 3600)"><table><tr><td> +<pre class="variable"> +datetime.timedelta(0, 3600) </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="ZERO"></a> +<h3>ZERO</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>timedelta</code> + + </dd> + <dt title="datetime.timedelta(0)">Value:</dt> + <dd title="datetime.timedelta(0)"><table><tr><td> +<pre class="variable"> +datetime.timedelta(0) </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:37 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/private/psycopg2.tz.FixedOffsetTimezone-class.html b/psycopg2/doc/api/private/psycopg2.tz.FixedOffsetTimezone-class.html new file mode 100644 index 00000000..4e6d6586 --- /dev/null +++ b/psycopg2/doc/api/private/psycopg2.tz.FixedOffsetTimezone-class.html @@ -0,0 +1,273 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.tz.FixedOffsetTimezone</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + <a href="psycopg2.tz-module.html">Module tz</a> :: + Class FixedOffsetTimezone + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.tz.FixedOffsetTimezone-class.html">hide private</a>]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.tz.FixedOffsetTimezone-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Type FixedOffsetTimezone</h2> + +<pre class="base-tree"> +<a href="__builtin__.object-class.html"><code>object</code></a> --+ + | + <a href="datetime.tzinfo-class.html"><code>tzinfo</code></a> --+ + | + <strong class="uidshort">FixedOffsetTimezone</strong> +</pre><br /> + +<hr/> + +<p>Fixed offset in minutes east from UTC.</p> +<p>This is exactly the implementation found in Python 2.3.x documentation, +with a small change to the __init__ method to allow for pickling and a +default name in the form 'sHH:MM' ('s' is the sign.)</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__init__"></a><span class="summary-sig"><span class="summary-sig-name">__init__</span>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">offset</span>, + <span class="summary-sig-arg">name</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="dst"></a><span class="summary-sig"><span class="summary-sig-name">dst</span>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">dt</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="tzname"></a><span class="summary-sig"><span class="summary-sig-name">tzname</span>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">dt</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="utcoffset"></a><span class="summary-sig"><span class="summary-sig-name">utcoffset</span>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">dt</span>)</span></code> +</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from tzinfo</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__getattribute__('name') <==> x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#__new__" class="summary-sig-name"><code>__new__</code></a>(<span class="summary-sig-arg">T</span>, + <span class="summary-sig-arg">S</span>, + <span class="summary-sig-vararg">...</span>)</span></code> +<br /> +Return a new object with type S, a subtype of T...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +-> (cls, state)</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#fromutc" class="summary-sig-name"><code>fromutc</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +datetime in UTC -> datetime in local time.</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from object</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__delattr__('name') <==> del x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return hash(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return repr(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__setattr__('name', value) <==> x.name = value</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return str(x)...</td></tr> +</table><br /> + + +<!-- =========== START OF CLASS VARIABLE SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Class Variable Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>NoneType</code></td> +<td><strong><a href="../private/psycopg2.tz.FixedOffsetTimezone-class.html#_name"><code>_name</code></a></strong> = <span title="None">None </span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>timedelta</code></td> +<td><strong><a href="../private/psycopg2.tz.FixedOffsetTimezone-class.html#_offset"><code>_offset</code></a></strong> = <span title="datetime.timedelta(0)"><code>datetime.timedelta(0) </code> +</span></td></tr> +</table><br /> + + +<!-- =========== START OF METHOD DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Method Details</th></tr> +</table> + +<a name="__init__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">offset</span>=<span class="sig-default">None</span>, + <span class="sig-arg">name</span>=<span class="sig-default">None</span>)</span> + <br /><em class="fname">(Constructor)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__init__"><code>__builtin__.object.__init__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="dst"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">dst</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">dt</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="datetime.tzinfo-class.html#dst"><code>datetime.tzinfo.dst</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="tzname"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">tzname</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">dt</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="datetime.tzinfo-class.html#tzname"><code>datetime.tzinfo.tzname</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="utcoffset"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">utcoffset</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">dt</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="datetime.tzinfo-class.html#utcoffset"><code>datetime.tzinfo.utcoffset</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF CLASS VARIABLE DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Class Variable Details</th></tr> +</table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="_name"></a> +<h3>_name</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>NoneType</code> + + </dd> + <dt title="None">Value:</dt> + <dd title="None"><table><tr><td> +<pre class="variable"> +None </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="_offset"></a> +<h3>_offset</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>timedelta</code> + + </dd> + <dt title="datetime.timedelta(0)">Value:</dt> + <dd title="datetime.timedelta(0)"><table><tr><td> +<pre class="variable"> +datetime.timedelta(0) </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/private/psycopg2.tz.LocalTimezone-class.html b/psycopg2/doc/api/private/psycopg2.tz.LocalTimezone-class.html new file mode 100644 index 00000000..09545493 --- /dev/null +++ b/psycopg2/doc/api/private/psycopg2.tz.LocalTimezone-class.html @@ -0,0 +1,209 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.tz.LocalTimezone</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + <a href="psycopg2.tz-module.html">Module tz</a> :: + Class LocalTimezone + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[show private | <a href="../public/psycopg2.tz.LocalTimezone-class.html">hide private</a>]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.tz.LocalTimezone-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Type LocalTimezone</h2> + +<pre class="base-tree"> +<a href="__builtin__.object-class.html"><code>object</code></a> --+ + | + <a href="datetime.tzinfo-class.html"><code>tzinfo</code></a> --+ + | + <strong class="uidshort">LocalTimezone</strong> +</pre><br /> + +<hr/> + +<p>Platform idea of local timezone.</p> +<p>This is the exact implementation from the Pyhton 2.3 documentation.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="dst"></a><span class="summary-sig"><span class="summary-sig-name">dst</span>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">dt</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="tzname"></a><span class="summary-sig"><span class="summary-sig-name">tzname</span>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">dt</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="utcoffset"></a><span class="summary-sig"><span class="summary-sig-name">utcoffset</span>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">dt</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="_isdst"></a><span class="summary-sig"><span class="summary-sig-name">_isdst</span>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">dt</span>)</span></code> +</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from tzinfo</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__getattribute__('name') <==> x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#__new__" class="summary-sig-name"><code>__new__</code></a>(<span class="summary-sig-arg">T</span>, + <span class="summary-sig-arg">S</span>, + <span class="summary-sig-vararg">...</span>)</span></code> +<br /> +Return a new object with type S, a subtype of T...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +-> (cls, state)</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#fromutc" class="summary-sig-name"><code>fromutc</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +datetime in UTC -> datetime in local time.</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from object</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__init__(...) initializes x; see x.__class__.__doc__ for signature</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__delattr__('name') <==> del x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return hash(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return repr(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__setattr__('name', value) <==> x.name = value</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return str(x)...</td></tr> +</table><br /> + + +<!-- =========== START OF METHOD DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Method Details</th></tr> +</table> + +<a name="dst"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">dst</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">dt</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="datetime.tzinfo-class.html#dst"><code>datetime.tzinfo.dst</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="tzname"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">tzname</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">dt</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="datetime.tzinfo-class.html#tzname"><code>datetime.tzinfo.tzname</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="utcoffset"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">utcoffset</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">dt</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="datetime.tzinfo-class.html#utcoffset"><code>datetime.tzinfo.utcoffset</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="_isdst"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">_isdst</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">dt</span>)</span> + </h3> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:34 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/private/toc-everything.html b/psycopg2/doc/api/private/toc-everything.html new file mode 100644 index 00000000..2b60e36f --- /dev/null +++ b/psycopg2/doc/api/private/toc-everything.html @@ -0,0 +1,134 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>Everything</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> +<h1 class="tocheading">Everything</h1> +<hr /> + +<!-- =========== START OF ALL CLASSES =========== --> +<h2 class="tocheading">All Classes</h2> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg.connection-class.html">psycopg2._psycopg.connection</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg.cursor-class.html">psycopg2._psycopg.cursor</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg.ISQLQuote-class.html">psycopg2._psycopg.ISQLQuote</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extras.DictConnection-class.html">psycopg2.extras.DictConnection</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extras.DictCursor-class.html">psycopg2.extras.DictCursor</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extras.DictRow-class.html">psycopg2.extras.DictRow</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extras.SQL_IN-class.html">psycopg2.extras.SQL_IN</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.pool.AbstractConnectionPool-class.html">psycopg2.pool.AbstractConnectionPool</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.pool.PersistentConnectionPool-class.html">psycopg2.pool.PersistentConnectionPool</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.pool.SimpleConnectionPool-class.html">psycopg2.pool.SimpleConnectionPool</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.pool.ThreadedConnectionPool-class.html">psycopg2.pool.ThreadedConnectionPool</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.psycopg1.connection-class.html">psycopg2.psycopg1.connection</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.psycopg1.cursor-class.html">psycopg2.psycopg1.cursor</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.tz.FixedOffsetTimezone-class.html">psycopg2.tz.FixedOffsetTimezone</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.tz.LocalTimezone-class.html">psycopg2.tz.LocalTimezone</a></p> + +<!-- =========== START OF ALL EXCEPTIONS =========== --> +<h2 class="tocheading">All Exceptions</h2> +<p class="toc"><a target="mainFrame" href="psycopg2.DatabaseError-class.html">psycopg2.DatabaseError</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.DataError-class.html">psycopg2.DataError</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.Error-class.html">psycopg2.Error</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.IntegrityError-class.html">psycopg2.IntegrityError</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.InterfaceError-class.html">psycopg2.InterfaceError</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.InternalError-class.html">psycopg2.InternalError</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.NotSupportedError-class.html">psycopg2.NotSupportedError</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.OperationalError-class.html">psycopg2.OperationalError</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.pool.PoolError-class.html">psycopg2.pool.PoolError</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.ProgrammingError-class.html">psycopg2.ProgrammingError</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.Warning-class.html">psycopg2.Warning</a></p> + +<!-- =========== START OF ALL FUNCTIONS =========== --> +<h2 class="tocheading">All Functions</h2> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#adapt">adapt</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#AsIs">AsIs</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2-module.html#Binary">Binary</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#Boolean">Boolean</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2-module.html#connect">connect</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.psycopg1-module.html#connect">connect</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2-module.html#Date">Date</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#DateFromPy">DateFromPy</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2-module.html#DateFromTicks">DateFromTicks</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.pool-module.html#dbg">dbg</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#IntervalFromPy">IntervalFromPy</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#List">List</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#new_type">new_type</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#QuotedString">QuotedString</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#register_adapter">register_adapter</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#register_type">register_type</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2-module.html#Time">Time</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#TimeFromPy">TimeFromPy</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2-module.html#TimeFromTicks">TimeFromTicks</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2-module.html#Timestamp">Timestamp</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#TimestampFromPy">TimestampFromPy</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2-module.html#TimestampFromTicks">TimestampFromTicks</a></p> + +<!-- =========== START OF ALL VARIABLES =========== --> +<h2 class="tocheading">All Variables</h2> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#__version__">__version__</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#_C_API">_C_API</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#adapters">adapters</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#apilevel">apilevel</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#BINARY">BINARY</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#binary_types">binary_types</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#BINARYARRAY">BINARYARRAY</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#BOOLEAN">BOOLEAN</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#BOOLEANARRAY">BOOLEANARRAY</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#DATE">DATE</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#DATEARRAY">DATEARRAY</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#DATETIME">DATETIME</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#DATETIMEARRAY">DATETIMEARRAY</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#DECIMAL">DECIMAL</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#DECIMALARRAY">DECIMALARRAY</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.tz-module.html#DSTDIFF">DSTDIFF</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#encodings">encodings</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#FLOAT">FLOAT</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#FLOATARRAY">FLOATARRAY</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#INTEGER">INTEGER</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#INTEGERARRAY">INTEGERARRAY</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#INTERVAL">INTERVAL</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#INTERVALARRAY">INTERVALARRAY</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#ISOLATION_LEVEL_AUTOCOMMIT">ISOLATION_LEVEL_AUTOCOMMIT</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#ISOLATION_LEVEL_READ_COMMITTED">ISOLATION_LEVEL_READ_COMMITTED</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#ISOLATION_LEVEL_READ_UNCOMMITTED">ISOLATION_LEVEL_READ_UNCOMMITTED</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#ISOLATION_LEVEL_REPEATABLE_READ">ISOLATION_LEVEL_REPEATABLE_READ</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#ISOLATION_LEVEL_SERIALIZABLE">ISOLATION_LEVEL_SERIALIZABLE</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.tz-module.html#LOCAL">LOCAL</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#LONGINTEGER">LONGINTEGER</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#LONGINTEGERARRAY">LONGINTEGERARRAY</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#NUMBER">NUMBER</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#paramstyle">paramstyle</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#PYDATE">PYDATE</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#PYDATETIME">PYDATETIME</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#PYINTERVAL">PYINTERVAL</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#PYTIME">PYTIME</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#ROWID">ROWID</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#ROWIDARRAY">ROWIDARRAY</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.tz-module.html#STDOFFSET">STDOFFSET</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#STRING">STRING</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#string_types">string_types</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#STRINGARRAY">STRINGARRAY</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#threadsafety">threadsafety</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#TIME">TIME</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#TIMEARRAY">TIMEARRAY</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#UNICODE">UNICODE</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#UNICODEARRAY">UNICODEARRAY</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.tz-module.html#ZERO">ZERO</a></p> + +<hr /> +<span class="options">[show private | <a href="../public/toc-everything.html">hide private</a>]</span> +</body> +</html> diff --git a/psycopg2/doc/api/private/toc-psycopg2-module.html b/psycopg2/doc/api/private/toc-psycopg2-module.html new file mode 100644 index 00000000..e07c73c1 --- /dev/null +++ b/psycopg2/doc/api/private/toc-psycopg2-module.html @@ -0,0 +1,58 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> +<h1 class="tocheading"><a target="mainFrame" href="psycopg2-module.html">psycopg2</a></h1> +<hr /> + +<!-- =========== START OF MODULES =========== --> +<h2 class="tocheading">Modules</h2> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html">_psycopg</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html">extensions</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extras-module.html">extras</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.pool-module.html">pool</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.psycopg1-module.html">psycopg1</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.tz-module.html">tz</a></p> + +<!-- =========== START OF EXCEPTIONS =========== --> +<h2 class="tocheading">Exceptions</h2> +<p class="toc"><a target="mainFrame" href="psycopg2.DatabaseError-class.html">DatabaseError</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.DataError-class.html">DataError</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.Error-class.html">Error</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.IntegrityError-class.html">IntegrityError</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.InterfaceError-class.html">InterfaceError</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.InternalError-class.html">InternalError</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.NotSupportedError-class.html">NotSupportedError</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.OperationalError-class.html">OperationalError</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.ProgrammingError-class.html">ProgrammingError</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.Warning-class.html">Warning</a></p> + +<!-- =========== START OF FUNCTIONS =========== --> +<h2 class="tocheading">Functions</h2> +<p class="toc"><a target="mainFrame" href="psycopg2-module.html#Binary">Binary</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2-module.html#connect">connect</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2-module.html#Date">Date</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2-module.html#DateFromTicks">DateFromTicks</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2-module.html#Time">Time</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2-module.html#TimeFromTicks">TimeFromTicks</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2-module.html#Timestamp">Timestamp</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2-module.html#TimestampFromTicks">TimestampFromTicks</a></p> + +<hr /> +<span class="options">[show private | <a href="../public/toc-psycopg2-module.html">hide private</a>]</span> +</body> +</html> diff --git a/psycopg2/doc/api/private/toc-psycopg2._psycopg-module.html b/psycopg2/doc/api/private/toc-psycopg2._psycopg-module.html new file mode 100644 index 00000000..49975f5a --- /dev/null +++ b/psycopg2/doc/api/private/toc-psycopg2._psycopg-module.html @@ -0,0 +1,78 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2._psycopg</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> +<h1 class="tocheading"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html">_psycopg</a></h1> +<hr /> + +<!-- =========== START OF CLASSES =========== --> +<h2 class="tocheading">Classes</h2> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg.connection-class.html">connection</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg.cursor-class.html">cursor</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg.ISQLQuote-class.html">ISQLQuote</a></p> + +<!-- =========== START OF FUNCTIONS =========== --> +<h2 class="tocheading">Functions</h2> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#List">List</a></p> + +<!-- =========== START OF VARIABLES =========== --> +<h2 class="tocheading">Variables</h2> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#__version__">__version__</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#_C_API">_C_API</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#adapters">adapters</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#apilevel">apilevel</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#BINARY">BINARY</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#binary_types">binary_types</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#BINARYARRAY">BINARYARRAY</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#BOOLEAN">BOOLEAN</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#BOOLEANARRAY">BOOLEANARRAY</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#DATE">DATE</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#DATEARRAY">DATEARRAY</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#DATETIME">DATETIME</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#DATETIMEARRAY">DATETIMEARRAY</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#DECIMAL">DECIMAL</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#DECIMALARRAY">DECIMALARRAY</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#encodings">encodings</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#FLOAT">FLOAT</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#FLOATARRAY">FLOATARRAY</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#INTEGER">INTEGER</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#INTEGERARRAY">INTEGERARRAY</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#INTERVAL">INTERVAL</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#INTERVALARRAY">INTERVALARRAY</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#LONGINTEGER">LONGINTEGER</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#LONGINTEGERARRAY">LONGINTEGERARRAY</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#NUMBER">NUMBER</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#paramstyle">paramstyle</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#PYDATE">PYDATE</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#PYDATETIME">PYDATETIME</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#PYINTERVAL">PYINTERVAL</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#PYTIME">PYTIME</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#ROWID">ROWID</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#ROWIDARRAY">ROWIDARRAY</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#STRING">STRING</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#string_types">string_types</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#STRINGARRAY">STRINGARRAY</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#threadsafety">threadsafety</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#TIME">TIME</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#TIMEARRAY">TIMEARRAY</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#UNICODE">UNICODE</a></p> +<p class="toc"><a target="mainFrame" href="../private/psycopg2._psycopg-module.html#UNICODEARRAY">UNICODEARRAY</a></p> + +<hr /> +<span class="options">[<strong>show private</strong> | hide private]</span> +</body> +</html> diff --git a/psycopg2/doc/api/private/toc-psycopg2.extensions-module.html b/psycopg2/doc/api/private/toc-psycopg2.extensions-module.html new file mode 100644 index 00000000..2e7c9836 --- /dev/null +++ b/psycopg2/doc/api/private/toc-psycopg2.extensions-module.html @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.extensions</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> +<h1 class="tocheading"><a target="mainFrame" href="psycopg2.extensions-module.html">extensions</a></h1> +<hr /> + +<!-- =========== START OF FUNCTIONS =========== --> +<h2 class="tocheading">Functions</h2> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#adapt">adapt</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#AsIs">AsIs</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#Boolean">Boolean</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#DateFromPy">DateFromPy</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#IntervalFromPy">IntervalFromPy</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#new_type">new_type</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#QuotedString">QuotedString</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#register_adapter">register_adapter</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#register_type">register_type</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#TimeFromPy">TimeFromPy</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#TimestampFromPy">TimestampFromPy</a></p> + +<!-- =========== START OF VARIABLES =========== --> +<h2 class="tocheading">Variables</h2> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#ISOLATION_LEVEL_AUTOCOMMIT">ISOLATION_LEVEL_AUTOCOMMIT</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#ISOLATION_LEVEL_READ_COMMITTED">ISOLATION_LEVEL_READ_COMMITTED</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#ISOLATION_LEVEL_READ_UNCOMMITTED">ISOLATION_LEVEL_READ_UNCOMMITTED</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#ISOLATION_LEVEL_REPEATABLE_READ">ISOLATION_LEVEL_REPEATABLE_READ</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#ISOLATION_LEVEL_SERIALIZABLE">ISOLATION_LEVEL_SERIALIZABLE</a></p> + +<hr /> +<span class="options">[show private | <a href="../public/toc-psycopg2.extensions-module.html">hide private</a>]</span> +</body> +</html> diff --git a/psycopg2/doc/api/private/toc-psycopg2.extras-module.html b/psycopg2/doc/api/private/toc-psycopg2.extras-module.html new file mode 100644 index 00000000..505d1d8c --- /dev/null +++ b/psycopg2/doc/api/private/toc-psycopg2.extras-module.html @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.extras</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> +<h1 class="tocheading"><a target="mainFrame" href="psycopg2.extras-module.html">extras</a></h1> +<hr /> + +<!-- =========== START OF CLASSES =========== --> +<h2 class="tocheading">Classes</h2> +<p class="toc"><a target="mainFrame" href="psycopg2.extras.DictConnection-class.html">DictConnection</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extras.DictCursor-class.html">DictCursor</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extras.DictRow-class.html">DictRow</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extras.SQL_IN-class.html">SQL_IN</a></p> + +<hr /> +<span class="options">[show private | <a href="../public/toc-psycopg2.extras-module.html">hide private</a>]</span> +</body> +</html> diff --git a/psycopg2/doc/api/private/toc-psycopg2.pool-module.html b/psycopg2/doc/api/private/toc-psycopg2.pool-module.html new file mode 100644 index 00000000..2b2a8cc8 --- /dev/null +++ b/psycopg2/doc/api/private/toc-psycopg2.pool-module.html @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.pool</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> +<h1 class="tocheading"><a target="mainFrame" href="psycopg2.pool-module.html">pool</a></h1> +<hr /> + +<!-- =========== START OF CLASSES =========== --> +<h2 class="tocheading">Classes</h2> +<p class="toc"><a target="mainFrame" href="psycopg2.pool.AbstractConnectionPool-class.html">AbstractConnectionPool</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.pool.PersistentConnectionPool-class.html">PersistentConnectionPool</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.pool.SimpleConnectionPool-class.html">SimpleConnectionPool</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.pool.ThreadedConnectionPool-class.html">ThreadedConnectionPool</a></p> + +<!-- =========== START OF EXCEPTIONS =========== --> +<h2 class="tocheading">Exceptions</h2> +<p class="toc"><a target="mainFrame" href="psycopg2.pool.PoolError-class.html">PoolError</a></p> + +<!-- =========== START OF FUNCTIONS =========== --> +<h2 class="tocheading">Functions</h2> +<p class="toc"><a target="mainFrame" href="psycopg2.pool-module.html#dbg">dbg</a></p> + +<hr /> +<span class="options">[show private | <a href="../public/toc-psycopg2.pool-module.html">hide private</a>]</span> +</body> +</html> diff --git a/psycopg2/doc/api/private/toc-psycopg2.psycopg1-module.html b/psycopg2/doc/api/private/toc-psycopg2.psycopg1-module.html new file mode 100644 index 00000000..20971b2e --- /dev/null +++ b/psycopg2/doc/api/private/toc-psycopg2.psycopg1-module.html @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.psycopg1</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> +<h1 class="tocheading"><a target="mainFrame" href="psycopg2.psycopg1-module.html">psycopg1</a></h1> +<hr /> + +<!-- =========== START OF CLASSES =========== --> +<h2 class="tocheading">Classes</h2> +<p class="toc"><a target="mainFrame" href="psycopg2.psycopg1.connection-class.html">connection</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.psycopg1.cursor-class.html">cursor</a></p> + +<!-- =========== START OF FUNCTIONS =========== --> +<h2 class="tocheading">Functions</h2> +<p class="toc"><a target="mainFrame" href="psycopg2.psycopg1-module.html#connect">connect</a></p> + +<hr /> +<span class="options">[show private | <a href="../public/toc-psycopg2.psycopg1-module.html">hide private</a>]</span> +</body> +</html> diff --git a/psycopg2/doc/api/private/toc-psycopg2.tz-module.html b/psycopg2/doc/api/private/toc-psycopg2.tz-module.html new file mode 100644 index 00000000..fce1191c --- /dev/null +++ b/psycopg2/doc/api/private/toc-psycopg2.tz-module.html @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.tz</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> +<h1 class="tocheading"><a target="mainFrame" href="psycopg2.tz-module.html">tz</a></h1> +<hr /> + +<!-- =========== START OF CLASSES =========== --> +<h2 class="tocheading">Classes</h2> +<p class="toc"><a target="mainFrame" href="psycopg2.tz.FixedOffsetTimezone-class.html">FixedOffsetTimezone</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.tz.LocalTimezone-class.html">LocalTimezone</a></p> + +<!-- =========== START OF VARIABLES =========== --> +<h2 class="tocheading">Variables</h2> +<p class="toc"><a target="mainFrame" href="psycopg2.tz-module.html#DSTDIFF">DSTDIFF</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.tz-module.html#LOCAL">LOCAL</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.tz-module.html#STDOFFSET">STDOFFSET</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.tz-module.html#ZERO">ZERO</a></p> + +<hr /> +<span class="options">[show private | <a href="../public/toc-psycopg2.tz-module.html">hide private</a>]</span> +</body> +</html> diff --git a/psycopg2/doc/api/private/toc.html b/psycopg2/doc/api/private/toc.html new file mode 100644 index 00000000..1e31df53 --- /dev/null +++ b/psycopg2/doc/api/private/toc.html @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>Table of Contents</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> +<h1 class="tocheading">Table of Contents</h1> +<hr /> +<p class="toc"><a target="moduleFrame" href="toc-everything.html">Everything</a></p> + +<!-- =========== START OF PACKAGES =========== --> +<h2 class="tocheading">Packages</h2> +<p class="toc"><a target="moduleFrame" href="toc-psycopg2-module.html" onclick="setFrame('toc-psycopg2-module.html', 'psycopg2-module.html');">psycopg2</a></p> + +<!-- =========== START OF MODULES =========== --> +<h2 class="tocheading">Modules</h2> +<p class="toc"><a target="moduleFrame" href="toc-psycopg2._psycopg-module.html" onclick="setFrame('toc-psycopg2._psycopg-module.html', 'psycopg2._psycopg-module.html');">psycopg2._psycopg</a></p> +<p class="toc"><a target="moduleFrame" href="toc-psycopg2.extensions-module.html" onclick="setFrame('toc-psycopg2.extensions-module.html', 'psycopg2.extensions-module.html');">psycopg2.extensions</a></p> +<p class="toc"><a target="moduleFrame" href="toc-psycopg2.extras-module.html" onclick="setFrame('toc-psycopg2.extras-module.html', 'psycopg2.extras-module.html');">psycopg2.extras</a></p> +<p class="toc"><a target="moduleFrame" href="toc-psycopg2.pool-module.html" onclick="setFrame('toc-psycopg2.pool-module.html', 'psycopg2.pool-module.html');">psycopg2.pool</a></p> +<p class="toc"><a target="moduleFrame" href="toc-psycopg2.psycopg1-module.html" onclick="setFrame('toc-psycopg2.psycopg1-module.html', 'psycopg2.psycopg1-module.html');">psycopg2.psycopg1</a></p> +<p class="toc"><a target="moduleFrame" href="toc-psycopg2.tz-module.html" onclick="setFrame('toc-psycopg2.tz-module.html', 'psycopg2.tz-module.html');">psycopg2.tz</a></p> + +<hr /> +<span class="options">[show private | <a href="../public/toc.html">hide private</a>]</span> +</body> +</html> diff --git a/psycopg2/doc/api/private/trees.html b/psycopg2/doc/api/private/trees.html new file mode 100644 index 00000000..5907cfaa --- /dev/null +++ b/psycopg2/doc/api/private/trees.html @@ -0,0 +1,196 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>Module and Class Hierarchies</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th bgcolor="#70b0f0" class="navselect"> Trees </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[show private | <a href="../public/trees.html">hide private</a>]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="trees.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF MODULE HIERARCHY =========== --> +<h2>Module Hierarchy</h2> +<ul> +<li> <strong class="uidlink"><a href="psycopg2-module.html"><code>psycopg2</code></a></strong>: <em class="summary">A Python driver for PostgreSQL</em> <ul> + <li> <strong class="uidlink"><a href="../private/psycopg2._psycopg-module.html"><code>_psycopg</code></a></strong>: <em class="summary">psycopg PostgreSQL driver</em></li> + <li> <strong class="uidlink"><a href="psycopg2.extensions-module.html"><code>extensions</code></a></strong>: <em class="summary">psycopg extensions to the DBAPI-2.0</em></li> + <li> <strong class="uidlink"><a href="psycopg2.extras-module.html"><code>extras</code></a></strong>: <em class="summary">Miscellaneous goodies for psycopg2</em></li> + <li> <strong class="uidlink"><a href="psycopg2.pool-module.html"><code>pool</code></a></strong>: <em class="summary">Connection pooling for psycopg2</em></li> + <li> <strong class="uidlink"><a href="psycopg2.psycopg1-module.html"><code>psycopg1</code></a></strong>: <em class="summary">psycopg 1.1.x compatibility module</em></li> + <li> <strong class="uidlink"><a href="psycopg2.tz-module.html"><code>tz</code></a></strong>: <em class="summary">tzinfo implementations for psycopg2</em></li> + </ul> +</li> +</ul> + +<!-- =========== START OF CLASS HIERARCHY =========== --> +<h2>Class Hierarchy</h2> +<ul> + <li> <strong class="uidlink"><a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></strong>: <em class="summary"> +The most base type</em> + <ul> + <li> <strong class="uidlink"><a href="psycopg2.pool.AbstractConnectionPool-class.html"><code>psycopg2.pool.AbstractConnectionPool</code></a></strong>: <em class="summary"> +Generic key-based pooling code.</em> + <ul> + <li> <strong class="uidlink"><a href="psycopg2.pool.PersistentConnectionPool-class.html"><code>psycopg2.pool.PersistentConnectionPool</code></a></strong>: <em class="summary"> +A pool that assigns persistent connections to different threads.</em> + </li> + <li> <strong class="uidlink"><a href="psycopg2.pool.SimpleConnectionPool-class.html"><code>psycopg2.pool.SimpleConnectionPool</code></a></strong>: <em class="summary"> +A connection pool that can't be shared across different threads.</em> + </li> + <li> <strong class="uidlink"><a href="psycopg2.pool.ThreadedConnectionPool-class.html"><code>psycopg2.pool.ThreadedConnectionPool</code></a></strong>: <em class="summary"> +A connection pool that works with the threading module.</em> + </li> + </ul> + </li> + <li> <strong class="uidlink"><a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></strong>: <em class="summary"> +list() -> new list +list(sequence) -> new list initialized from sequence's items</em> + <ul> + <li> <strong class="uidlink"><a href="psycopg2.extras.DictRow-class.html"><code>psycopg2.extras.DictRow</code></a></strong>: <em class="summary"> +A row object that allow by-colun-name access to data.</em> + </li> + </ul> + </li> + <li> <strong class="uidlink"><a href="psycopg2.extras.SQL_IN-class.html"><code>psycopg2.extras.SQL_IN</code></a></strong>: <em class="summary"> +Adapt any iterable to an SQL quotable object.</em> + </li> + <li> <strong class="uidlink"><a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></strong>: <em class="summary"> +type(object) -> the object's type +type(name, bases, dict) -> a new type</em> + </li> + <li> <strong class="uidlink"><a href="datetime.tzinfo-class.html"><code>datetime.tzinfo</code></a></strong>: <em class="summary"> +Abstract base class for time zone info objects.</em> + <ul> + <li> <strong class="uidlink"><a href="psycopg2.tz.FixedOffsetTimezone-class.html"><code>psycopg2.tz.FixedOffsetTimezone</code></a></strong>: <em class="summary"> +Fixed offset in minutes east from UTC.</em> + </li> + <li> <strong class="uidlink"><a href="psycopg2.tz.LocalTimezone-class.html"><code>psycopg2.tz.LocalTimezone</code></a></strong>: <em class="summary"> +Platform idea of local timezone.</em> + </li> + </ul> + </li> + <li> <strong class="uidlink"><a href="../private/psycopg2._psycopg.connection-class.html"><code>psycopg2._psycopg.connection</code></a></strong>: <em class="summary"> +connection(dsn, ...) -> new connection object</em> + <ul> + <li> <strong class="uidlink"><a href="psycopg2.psycopg1.connection-class.html"><code>psycopg2.psycopg1.connection</code></a></strong>: <em class="summary"> +psycopg 1.1.x connection.</em> + </li> + <li> <strong class="uidlink"><a href="psycopg2.extras.DictConnection-class.html"><code>psycopg2.extras.DictConnection</code></a></strong>: <em class="summary"> +A connection that uses DictCursor automatically.</em> + </li> + </ul> + </li> + <li> <strong class="uidlink"><a href="../private/psycopg2._psycopg.cursor-class.html"><code>psycopg2._psycopg.cursor</code></a></strong>: <em class="summary"> +A database cursor.</em> + <ul> + <li> <strong class="uidlink"><a href="psycopg2.psycopg1.cursor-class.html"><code>psycopg2.psycopg1.cursor</code></a></strong>: <em class="summary"> +psycopg 1.1.x cursor.</em> + </li> + <li> <strong class="uidlink"><a href="psycopg2.extras.DictCursor-class.html"><code>psycopg2.extras.DictCursor</code></a></strong>: <em class="summary"> +A cursor that keeps a list of column name -> index mappings.</em> + </li> + </ul> + </li> + <li> <strong class="uidlink"><a href="../private/psycopg2._psycopg.ISQLQuote-class.html"><code>psycopg2._psycopg.ISQLQuote</code></a></strong>: <em class="summary"> +Abstract ISQLQuote protocol</em> + </li> + </ul> + </li> + <li> <strong class="uidlink"><a href="exceptions.Exception-class.html"><code>exceptions.Exception</code></a></strong>: <em class="summary"> +Common base class for all exceptions.</em> + <ul> + <li> <strong class="uidlink"><a href="exceptions.StandardError-class.html"><code>exceptions.StandardError</code></a></strong>: <em class="summary"> +Base class for all standard Python exceptions.</em> + <ul> + <li> <strong class="uidlink"><a href="psycopg2.Error-class.html"><code>psycopg2.Error</code></a></strong>: <em class="summary"> +Base class for error exceptions.</em> + <ul> + <li> <strong class="uidlink"><a href="psycopg2.DatabaseError-class.html"><code>psycopg2.DatabaseError</code></a></strong>: <em class="summary"> +Error related to the database engine.</em> + <ul> + <li> <strong class="uidlink"><a href="psycopg2.DataError-class.html"><code>psycopg2.DataError</code></a></strong>: <em class="summary"> +Error related to problems with the processed data.</em> + </li> + <li> <strong class="uidlink"><a href="psycopg2.IntegrityError-class.html"><code>psycopg2.IntegrityError</code></a></strong>: <em class="summary"> +Error related to database integrity.</em> + </li> + <li> <strong class="uidlink"><a href="psycopg2.InternalError-class.html"><code>psycopg2.InternalError</code></a></strong>: <em class="summary"> +The database encountered an internal error.</em> + </li> + <li> <strong class="uidlink"><a href="psycopg2.NotSupportedError-class.html"><code>psycopg2.NotSupportedError</code></a></strong>: <em class="summary"> +A not supported datbase API was called.</em> + </li> + <li> <strong class="uidlink"><a href="psycopg2.OperationalError-class.html"><code>psycopg2.OperationalError</code></a></strong>: <em class="summary"> +Error related to database operation (disconnect, memory allocation etc).</em> + </li> + <li> <strong class="uidlink"><a href="psycopg2.ProgrammingError-class.html"><code>psycopg2.ProgrammingError</code></a></strong>: <em class="summary"> +Error related to database programming (SQL error, table not found etc).</em> + </li> + </ul> + </li> + <li> <strong class="uidlink"><a href="psycopg2.InterfaceError-class.html"><code>psycopg2.InterfaceError</code></a></strong>: <em class="summary"> +Error related to the database interface.</em> + </li> + <li> <strong class="uidlink"><a href="psycopg2.pool.PoolError-class.html"><code>psycopg2.pool.PoolError</code></a></strong> + </li> + </ul> + </li> + <li> <strong class="uidlink"><a href="psycopg2.Warning-class.html"><code>psycopg2.Warning</code></a></strong>: <em class="summary"> +A database warning.</em> + </li> + </ul> + </li> + </ul> + </li> +</ul> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:37 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/public/__builtin__.list-class.html b/psycopg2/doc/api/public/__builtin__.list-class.html new file mode 100644 index 00000000..4ede43ec --- /dev/null +++ b/psycopg2/doc/api/public/__builtin__.list-class.html @@ -0,0 +1,817 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>__builtin__.list</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + Module __builtin__ :: + Class list + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<a href="../private/__builtin__.list-class.html">show private</a> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="__builtin__.list-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Type list</h2> + +<pre class="base-tree"> +<a href="__builtin__.object-class.html"><code>object</code></a> --+ + | + <strong class="uidshort">list</strong> +</pre><br /> + +<dl><dt>Known Subclasses:</dt> +<dd> + <a href="psycopg2.extras.DictRow-class.html"><code>DictRow</code></a></dd></dl> + +<hr/> + +<p>list() -> new list +list(sequence) -> new list initialized from sequence's items</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__init__(...) initializes x; see x.__class__.__doc__ for signature</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__add__"></a><span class="summary-sig"><span class="summary-sig-name">__add__</span>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return x+y...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__contains__"></a><span class="summary-sig"><span class="summary-sig-name">__contains__</span>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return y in x...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__delitem__"></a><span class="summary-sig"><span class="summary-sig-name">__delitem__</span>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return del x[y]...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__delslice__" class="summary-sig-name"><code>__delslice__</code></a>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">i</span>, + <span class="summary-sig-arg">j</span>)</span></code> +<br /> +Use of negative indices is not supported.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__eq__"></a><span class="summary-sig"><span class="summary-sig-name">__eq__</span>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return x==y...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__ge__"></a><span class="summary-sig"><span class="summary-sig-name">__ge__</span>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return x>=y...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__getattribute__('name') <==> x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__getitem__"></a><span class="summary-sig"><span class="summary-sig-name">__getitem__</span>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return x[y]...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__getslice__" class="summary-sig-name"><code>__getslice__</code></a>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">i</span>, + <span class="summary-sig-arg">j</span>)</span></code> +<br /> +Use of negative indices is not supported.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__gt__"></a><span class="summary-sig"><span class="summary-sig-name">__gt__</span>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return x>y...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__hash__"></a><span class="summary-sig"><span class="summary-sig-name">__hash__</span>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return hash(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__iadd__"></a><span class="summary-sig"><span class="summary-sig-name">__iadd__</span>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return x+=y...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__imul__"></a><span class="summary-sig"><span class="summary-sig-name">__imul__</span>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return x*=y...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__iter__"></a><span class="summary-sig"><span class="summary-sig-name">__iter__</span>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return iter(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__le__"></a><span class="summary-sig"><span class="summary-sig-name">__le__</span>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return x<=y...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__len__"></a><span class="summary-sig"><span class="summary-sig-name">__len__</span>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return len(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__lt__"></a><span class="summary-sig"><span class="summary-sig-name">__lt__</span>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return x<y...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__mul__"></a><span class="summary-sig"><span class="summary-sig-name">__mul__</span>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">n</span>)</span></code> +<br /> +Return x*n...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__ne__"></a><span class="summary-sig"><span class="summary-sig-name">__ne__</span>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return x!=y...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__new__"></a><span class="summary-sig"><span class="summary-sig-name">__new__</span>(<span class="summary-sig-arg">T</span>, + <span class="summary-sig-arg">S</span>, + <span class="summary-sig-vararg">...</span>)</span></code> +<br /> +Return a new object with type S, a subtype of T...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__repr__"></a><span class="summary-sig"><span class="summary-sig-name">__repr__</span>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return repr(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__rmul__"></a><span class="summary-sig"><span class="summary-sig-name">__rmul__</span>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">n</span>)</span></code> +<br /> +Return n*x...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__setitem__"></a><span class="summary-sig"><span class="summary-sig-name">__setitem__</span>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">i</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return x[i]=y...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__setslice__" class="summary-sig-name"><code>__setslice__</code></a>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">i</span>, + <span class="summary-sig-arg">j</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Use of negative indices is not supported.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#append" class="summary-sig-name"><code>append</code></a>(<span class="summary-sig-arg">L</span>, + <span class="summary-sig-arg">object</span>)</span></code> +<br /> +append object to end</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#count" class="summary-sig-name"><code>count</code></a>(<span class="summary-sig-arg">L</span>, + <span class="summary-sig-arg">value</span>)</span></code> +<br /> +return number of occurrences of value</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#extend" class="summary-sig-name"><code>extend</code></a>(<span class="summary-sig-arg">L</span>, + <span class="summary-sig-arg">iterable</span>)</span></code> +<br /> +extend list by appending elements from the iterable</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#index" class="summary-sig-name"><code>index</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +L.index(value, [start, [stop]]) -> integer -- return first index of value</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#insert" class="summary-sig-name"><code>insert</code></a>(<span class="summary-sig-arg">L</span>, + <span class="summary-sig-arg">index</span>, + <span class="summary-sig-arg">object</span>)</span></code> +<br /> +insert object before index</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#pop" class="summary-sig-name"><code>pop</code></a>(<span class="summary-sig-arg">L</span>, + <span class="summary-sig-arg">index</span>)</span></code> +<br /> +remove and return item at index (default last)</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#remove" class="summary-sig-name"><code>remove</code></a>(<span class="summary-sig-arg">L</span>, + <span class="summary-sig-arg">value</span>)</span></code> +<br /> +remove first occurrence of value</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#reverse" class="summary-sig-name"><code>reverse</code></a>(<span class="summary-sig-arg">L</span>)</span></code> +<br /> +reverse <em>IN PLACE</em></td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#sort" class="summary-sig-name"><code>sort</code></a>(<span class="summary-sig-arg">L</span>, + <span class="summary-sig-arg">cmpfunc</span>)</span></code> +<br /> +stable sort <em>IN PLACE</em>; cmpfunc(x, y) -> -1, 0, 1</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from object</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__delattr__('name') <==> del x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__setattr__('name', value) <==> x.name = value</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return str(x)...</td></tr> +</table><br /> + + +<!-- =========== START OF METHOD DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Method Details</th></tr> +</table> + +<a name="__init__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-vararg">...</span>)</span> + <br /><em class="fname">(Constructor)</em> + </h3> +<p>x.__init__(...) initializes x; see x.__class__.__doc__ for signature</p> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__init__"><code>__builtin__.object.__init__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__add__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__add__</span>(<span class="sig-arg">x</span>, + <span class="sig-arg">y</span>)</span> + <br /><em class="fname">(Addition operator)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +x+y +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__contains__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__contains__</span>(<span class="sig-arg">x</span>, + <span class="sig-arg">y</span>)</span> + <br /><em class="fname">(In operator)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +y in x +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__delitem__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__delitem__</span>(<span class="sig-arg">x</span>, + <span class="sig-arg">y</span>)</span> + <br /><em class="fname">(Index deletion operator)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +del x[y] +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__delslice__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__delslice__</span>(<span class="sig-arg">x</span>, + <span class="sig-arg">i</span>, + <span class="sig-arg">j</span>)</span> + <br /><em class="fname">(Slice deletion operator)</em> + </h3> +<p>Use of negative indices is not supported.</p> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +del x[i:j] +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__eq__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__eq__</span>(<span class="sig-arg">x</span>, + <span class="sig-arg">y</span>)</span> + <br /><em class="fname">(Equality operator)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +x==y +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__ge__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__ge__</span>(<span class="sig-arg">x</span>, + <span class="sig-arg">y</span>)</span> + <br /><em class="fname">(Greater-than-or-equals operator)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +x>=y +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__getattribute__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__getattribute__</span>(<span class="sig-vararg">...</span>)</span> + </h3> +<p>x.__getattribute__('name') <==> x.name</p> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__getattribute__"><code>__builtin__.object.__getattribute__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__getitem__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__getitem__</span>(<span class="sig-arg">x</span>, + <span class="sig-arg">y</span>)</span> + <br /><em class="fname">(Indexing operator)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +x[y] +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__getslice__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__getslice__</span>(<span class="sig-arg">x</span>, + <span class="sig-arg">i</span>, + <span class="sig-arg">j</span>)</span> + <br /><em class="fname">(Slicling operator)</em> + </h3> +<p>Use of negative indices is not supported.</p> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +x[i:j] +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__gt__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__gt__</span>(<span class="sig-arg">x</span>, + <span class="sig-arg">y</span>)</span> + <br /><em class="fname">(Greater-than operator)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +x>y +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__hash__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__hash__</span>(<span class="sig-arg">x</span>)</span> + <br /><em class="fname">(Hashing function)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +hash(x) +</pre> + </dd> + </dl> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__hash__"><code>__builtin__.object.__hash__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__iadd__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__iadd__</span>(<span class="sig-arg">x</span>, + <span class="sig-arg">y</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +x+=y +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__imul__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__imul__</span>(<span class="sig-arg">x</span>, + <span class="sig-arg">y</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +x*=y +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__iter__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__iter__</span>(<span class="sig-arg">x</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +iter(x) +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__le__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__le__</span>(<span class="sig-arg">x</span>, + <span class="sig-arg">y</span>)</span> + <br /><em class="fname">(Less-than-or-equals operator)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +x<=y +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__len__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__len__</span>(<span class="sig-arg">x</span>)</span> + <br /><em class="fname">(Length operator)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +len(x) +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__lt__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__lt__</span>(<span class="sig-arg">x</span>, + <span class="sig-arg">y</span>)</span> + <br /><em class="fname">(Less-than operator)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +x<y +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__mul__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__mul__</span>(<span class="sig-arg">x</span>, + <span class="sig-arg">n</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +x*n +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__ne__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__ne__</span>(<span class="sig-arg">x</span>, + <span class="sig-arg">y</span>)</span> + <br /><em class="fname">(Inequality operator)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +x!=y +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__new__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__new__</span>(<span class="sig-arg">T</span>, + <span class="sig-arg">S</span>, + <span class="sig-vararg">...</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +a new object with type S, a subtype of T +</pre> + </dd> + </dl> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__new__"><code>__builtin__.object.__new__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__repr__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__repr__</span>(<span class="sig-arg">x</span>)</span> + <br /><em class="fname">(Representation operator)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +repr(x) +</pre> + </dd> + </dl> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__repr__"><code>__builtin__.object.__repr__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__rmul__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__rmul__</span>(<span class="sig-arg">x</span>, + <span class="sig-arg">n</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +n*x +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__setitem__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__setitem__</span>(<span class="sig-arg">x</span>, + <span class="sig-arg">i</span>, + <span class="sig-arg">y</span>)</span> + <br /><em class="fname">(Index assignment operator)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +x[i]=y +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__setslice__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__setslice__</span>(<span class="sig-arg">x</span>, + <span class="sig-arg">i</span>, + <span class="sig-arg">j</span>, + <span class="sig-arg">y</span>)</span> + <br /><em class="fname">(Slice assignment operator)</em> + </h3> +<p>Use of negative indices is not supported.</p> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +x[i:j]=y +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="append"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">append</span>(<span class="sig-arg">L</span>, + <span class="sig-arg">object</span>)</span> + </h3> +<p>append object to end</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="count"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">count</span>(<span class="sig-arg">L</span>, + <span class="sig-arg">value</span>)</span> + </h3> +<p>return number of occurrences of value</p> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +integer +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="extend"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">extend</span>(<span class="sig-arg">L</span>, + <span class="sig-arg">iterable</span>)</span> + </h3> +<p>extend list by appending elements from the iterable</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="index"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">index</span>(<span class="sig-vararg">...</span>)</span> + </h3> +<p>L.index(value, [start, [stop]]) -> integer -- return first index of value</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="insert"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">insert</span>(<span class="sig-arg">L</span>, + <span class="sig-arg">index</span>, + <span class="sig-arg">object</span>)</span> + </h3> +<p>insert object before index</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="pop"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">pop</span>(<span class="sig-arg">L</span>, + <span class="sig-arg">index</span>=<span class="sig-default">...</span>)</span> + </h3> +<p>remove and return item at index (default last)</p> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +item +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="remove"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">remove</span>(<span class="sig-arg">L</span>, + <span class="sig-arg">value</span>)</span> + </h3> +<p>remove first occurrence of value</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="reverse"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">reverse</span>(<span class="sig-arg">L</span>)</span> + </h3> +<p>reverse <em>IN PLACE</em></p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="sort"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">sort</span>(<span class="sig-arg">L</span>, + <span class="sig-arg">cmpfunc</span>=<span class="sig-default">None</span>)</span> + </h3> +<p>stable sort <em>IN PLACE</em>; cmpfunc(x, y) -> -1, 0, 1</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:32 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/public/__builtin__.object-class.html b/psycopg2/doc/api/public/__builtin__.object-class.html new file mode 100644 index 00000000..e9638da5 --- /dev/null +++ b/psycopg2/doc/api/public/__builtin__.object-class.html @@ -0,0 +1,267 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>__builtin__.object</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + Module __builtin__ :: + Class object + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<a href="../private/__builtin__.object-class.html">show private</a> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="__builtin__.object-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Type object</h2> + +<dl><dt>Known Subclasses:</dt> +<dd> + <a href="psycopg2.pool.AbstractConnectionPool-class.html"><code>AbstractConnectionPool</code></a>, + <a href="__builtin__.list-class.html"><code>list</code></a>, + <a href="psycopg2.extras.SQL_IN-class.html"><code>SQL_IN</code></a>, + <a href="__builtin__.type-class.html"><code>type</code></a>, + <a href="datetime.tzinfo-class.html"><code>tzinfo</code></a></dd></dl> + +<hr/> + +<p>The most base type</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__init__(...) initializes x; see x.__class__.__doc__ for signature</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__delattr__('name') <==> del x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__getattribute__('name') <==> x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__hash__"></a><span class="summary-sig"><span class="summary-sig-name">__hash__</span>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return hash(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__new__"></a><span class="summary-sig"><span class="summary-sig-name">__new__</span>(<span class="summary-sig-arg">T</span>, + <span class="summary-sig-arg">S</span>, + <span class="summary-sig-vararg">...</span>)</span></code> +<br /> +Return a new object with type S, a subtype of T...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__repr__"></a><span class="summary-sig"><span class="summary-sig-name">__repr__</span>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return repr(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__setattr__('name', value) <==> x.name = value</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__str__"></a><span class="summary-sig"><span class="summary-sig-name">__str__</span>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return str(x)...</td></tr> +</table><br /> + + +<!-- =========== START OF CLASS VARIABLE SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Class Variable Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> + <td><a name="__class__"></a><strong><code class="vname">__class__</code></strong> = <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr> +</table><br /> + + +<!-- =========== START OF METHOD DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Method Details</th></tr> +</table> + +<a name="__init__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-vararg">...</span>)</span> + <br /><em class="fname">(Constructor)</em> + </h3> +<p>x.__init__(...) initializes x; see x.__class__.__doc__ for signature</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="__delattr__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__delattr__</span>(<span class="sig-vararg">...</span>)</span> + </h3> +<p>x.__delattr__('name') <==> del x.name</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="__getattribute__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__getattribute__</span>(<span class="sig-vararg">...</span>)</span> + </h3> +<p>x.__getattribute__('name') <==> x.name</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="__hash__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__hash__</span>(<span class="sig-arg">x</span>)</span> + <br /><em class="fname">(Hashing function)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +hash(x) +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__new__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__new__</span>(<span class="sig-arg">T</span>, + <span class="sig-arg">S</span>, + <span class="sig-vararg">...</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +a new object with type S, a subtype of T +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__reduce__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__reduce__</span>(<span class="sig-vararg">...</span>)</span> + </h3> +<p>helper for pickle</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="__reduce_ex__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__reduce_ex__</span>(<span class="sig-vararg">...</span>)</span> + </h3> +<p>helper for pickle</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="__repr__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__repr__</span>(<span class="sig-arg">x</span>)</span> + <br /><em class="fname">(Representation operator)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +repr(x) +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__setattr__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__setattr__</span>(<span class="sig-vararg">...</span>)</span> + </h3> +<p>x.__setattr__('name', value) <==> x.name = value</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="__str__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__str__</span>(<span class="sig-arg">x</span>)</span> + <br /><em class="fname">(Informal representation operator)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +str(x) +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/public/__builtin__.type-class.html b/psycopg2/doc/api/public/__builtin__.type-class.html new file mode 100644 index 00000000..7af340f2 --- /dev/null +++ b/psycopg2/doc/api/public/__builtin__.type-class.html @@ -0,0 +1,384 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>__builtin__.type</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + Module __builtin__ :: + Class type + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<a href="../private/__builtin__.type-class.html">show private</a> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="__builtin__.type-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Type type</h2> + +<pre class="base-tree"> +<a href="__builtin__.object-class.html"><code>object</code></a> --+ + | + <strong class="uidshort">type</strong> +</pre><br /> + +<hr/> + +<p>type(object) -> the object's type +type(name, bases, dict) -> a new type</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__call__"></a><span class="summary-sig"><span class="summary-sig-name">__call__</span>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-vararg">...</span>)</span></code> +<br /> +Return x(...)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__cmp__"></a><span class="summary-sig"><span class="summary-sig-name">__cmp__</span>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return cmp(x,y)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.type-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__delattr__('name') <==> del x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.type-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__getattribute__('name') <==> x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__hash__"></a><span class="summary-sig"><span class="summary-sig-name">__hash__</span>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return hash(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__new__"></a><span class="summary-sig"><span class="summary-sig-name">__new__</span>(<span class="summary-sig-arg">T</span>, + <span class="summary-sig-arg">S</span>, + <span class="summary-sig-vararg">...</span>)</span></code> +<br /> +Return a new object with type S, a subtype of T...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__repr__"></a><span class="summary-sig"><span class="summary-sig-name">__repr__</span>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return repr(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.type-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__setattr__('name', value) <==> x.name = value</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">list of immediate subclasses</td> + <td><code><a name="__subclasses__"></a><span class="summary-sig"><span class="summary-sig-name">__subclasses__</span>()</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">list</td> + <td><code><span class="summary-sig"><a href="__builtin__.type-class.html#mro" class="summary-sig-name"><code>mro</code></a>()</span></code> +<br /> +return a type's method resolution order</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from object</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__init__(...) initializes x; see x.__class__.__doc__ for signature</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return str(x)...</td></tr> +</table><br /> + + +<!-- =========== START OF PROPERTY SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Property Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><a name="__base__"></a><strong><code>__base__</code></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><a name="__basicsize__"></a><strong><code>__basicsize__</code></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><a name="__dictoffset__"></a><strong><code>__dictoffset__</code></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><a name="__flags__"></a><strong><code>__flags__</code></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><a name="__itemsize__"></a><strong><code>__itemsize__</code></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><a name="__mro__"></a><strong><code>__mro__</code></strong></td></tr><tr><td align="right" valign="top" width="15%" class="ptype"> </td> + <td><a name="__weakrefoffset__"></a><strong><code>__weakrefoffset__</code></strong></td></tr></table><br /> + + +<!-- =========== START OF CLASS VARIABLE SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Class Variable Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>tuple</code></td> +<td><strong><a href="__builtin__.type-class.html#__bases__"><code>__bases__</code></a></strong> = <span title="(<type 'object'>,)"><code>(<type 'object'>,) </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>str</code></td> +<td><strong><a href="__builtin__.type-class.html#__name__"><code>__name__</code></a></strong> = <span title="'type'"><code><span class="variable-quote">'</span>type<span class="variable-quote">'</span> </code> +</span></td></tr> +</table><br /> + + +<!-- =========== START OF METHOD DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Method Details</th></tr> +</table> + +<a name="__call__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__call__</span>(<span class="sig-arg">x</span>, + <span class="sig-vararg">...</span>)</span> + <br /><em class="fname">(Call operator)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +x(...) +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__cmp__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__cmp__</span>(<span class="sig-arg">x</span>, + <span class="sig-arg">y</span>)</span> + <br /><em class="fname">(Comparison operator)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +cmp(x,y) +</pre> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__delattr__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__delattr__</span>(<span class="sig-vararg">...</span>)</span> + </h3> +<p>x.__delattr__('name') <==> del x.name</p> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__delattr__"><code>__builtin__.object.__delattr__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__getattribute__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__getattribute__</span>(<span class="sig-vararg">...</span>)</span> + </h3> +<p>x.__getattribute__('name') <==> x.name</p> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__getattribute__"><code>__builtin__.object.__getattribute__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__hash__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__hash__</span>(<span class="sig-arg">x</span>)</span> + <br /><em class="fname">(Hashing function)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +hash(x) +</pre> + </dd> + </dl> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__hash__"><code>__builtin__.object.__hash__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__new__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__new__</span>(<span class="sig-arg">T</span>, + <span class="sig-arg">S</span>, + <span class="sig-vararg">...</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +a new object with type S, a subtype of T +</pre> + </dd> + </dl> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__new__"><code>__builtin__.object.__new__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__repr__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__repr__</span>(<span class="sig-arg">x</span>)</span> + <br /><em class="fname">(Representation operator)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +repr(x) +</pre> + </dd> + </dl> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__repr__"><code>__builtin__.object.__repr__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__setattr__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__setattr__</span>(<span class="sig-vararg">...</span>)</span> + </h3> +<p>x.__setattr__('name', value) <==> x.name = value</p> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__setattr__"><code>__builtin__.object.__setattr__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__subclasses__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__subclasses__</span>()</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +list of immediate subclasses </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="mro"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">mro</span>()</span> + </h3> +<p>return a type's method resolution order</p> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +list </dd> + </dl> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF CLASS VARIABLE DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Class Variable Details</th></tr> +</table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="__bases__"></a> +<h3>__bases__</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>tuple</code> + + </dd> + <dt title="(<type 'object'>,)">Value:</dt> + <dd title="(<type 'object'>,)"><table><tr><td> +<pre class="variable"> +(<type 'object'>,) </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="__name__"></a> +<h3>__name__</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>str</code> + + </dd> + <dt title="'type'">Value:</dt> + <dd title="'type'"><table><tr><td> +<pre class="variable"> +<span class="variable-quote">'</span>type<span class="variable-quote">'</span> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:34 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/public/datetime.tzinfo-class.html b/psycopg2/doc/api/public/datetime.tzinfo-class.html new file mode 100644 index 00000000..080afa2e --- /dev/null +++ b/psycopg2/doc/api/public/datetime.tzinfo-class.html @@ -0,0 +1,239 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>datetime.tzinfo</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + Module datetime :: + Class tzinfo + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<a href="../private/datetime.tzinfo-class.html">show private</a> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="datetime.tzinfo-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Type tzinfo</h2> + +<pre class="base-tree"> +<a href="__builtin__.object-class.html"><code>object</code></a> --+ + | + <strong class="uidshort">tzinfo</strong> +</pre><br /> + +<dl><dt>Known Subclasses:</dt> +<dd> + <a href="psycopg2.tz.FixedOffsetTimezone-class.html"><code>FixedOffsetTimezone</code></a>, + <a href="psycopg2.tz.LocalTimezone-class.html"><code>LocalTimezone</code></a></dd></dl> + +<hr/> + +<p>Abstract base class for time zone info objects.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__getattribute__('name') <==> x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__new__"></a><span class="summary-sig"><span class="summary-sig-name">__new__</span>(<span class="summary-sig-arg">T</span>, + <span class="summary-sig-arg">S</span>, + <span class="summary-sig-vararg">...</span>)</span></code> +<br /> +Return a new object with type S, a subtype of T...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +-> (cls, state)</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#dst" class="summary-sig-name"><code>dst</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +datetime -> DST offset in minutes east of UTC.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#fromutc" class="summary-sig-name"><code>fromutc</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +datetime in UTC -> datetime in local time.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#tzname" class="summary-sig-name"><code>tzname</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +datetime -> string name of time zone.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#utcoffset" class="summary-sig-name"><code>utcoffset</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +datetime -> minutes east of UTC (negative for west of UTC).</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from object</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__init__(...) initializes x; see x.__class__.__doc__ for signature</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__delattr__('name') <==> del x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return hash(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return repr(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__setattr__('name', value) <==> x.name = value</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return str(x)...</td></tr> +</table><br /> + + +<!-- =========== START OF METHOD DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Method Details</th></tr> +</table> + +<a name="__getattribute__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__getattribute__</span>(<span class="sig-vararg">...</span>)</span> + </h3> +<p>x.__getattribute__('name') <==> x.name</p> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__getattribute__"><code>__builtin__.object.__getattribute__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__new__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__new__</span>(<span class="sig-arg">T</span>, + <span class="sig-arg">S</span>, + <span class="sig-vararg">...</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +<pre class="literalblock"> +a new object with type S, a subtype of T +</pre> + </dd> + </dl> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__new__"><code>__builtin__.object.__new__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__reduce__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__reduce__</span>(<span class="sig-vararg">...</span>)</span> + </h3> +<p>-> (cls, state)</p> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__reduce__"><code>__builtin__.object.__reduce__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="dst"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">dst</span>(<span class="sig-vararg">...</span>)</span> + </h3> +<p>datetime -> DST offset in minutes east of UTC.</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="fromutc"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">fromutc</span>(<span class="sig-vararg">...</span>)</span> + </h3> +<p>datetime in UTC -> datetime in local time.</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="tzname"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">tzname</span>(<span class="sig-vararg">...</span>)</span> + </h3> +<p>datetime -> string name of time zone.</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="utcoffset"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">utcoffset</span>(<span class="sig-vararg">...</span>)</span> + </h3> +<p>datetime -> minutes east of UTC (negative for west of UTC).</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/public/epydoc.css b/psycopg2/doc/api/public/epydoc.css new file mode 100644 index 00000000..22e8f7ed --- /dev/null +++ b/psycopg2/doc/api/public/epydoc.css @@ -0,0 +1,138 @@ +/* Based on the Epydoc "default.css" +** with some missing reST-related classes +** and Python syntax support (from SilverCity) +*/ + +/* Body color */ +body { background: #ffffff; color: #000000; } + +/* Tables */ +table.summary, table.details, table.index + { background: #e8f0f8; color: #000000; } +tr.summary, tr.details, tr.index + { background: #70b0f0; color: #000000; + text-align: left; font-size: 120%; } +tr.group { background: #c0e0f8; color: #000000; + text-align: left; font-size: 120%; + font-style: italic; } + +/* Documentation page titles */ +h2.module { margin-top: 0.2em; } +h2.class { margin-top: 0.2em; } + +/* Headings */ +h1.heading { font-size: +140%; font-style: italic; + font-weight: bold; } +h2.heading { font-size: +125%; font-style: italic; + font-weight: bold; } +h3.heading { font-size: +110%; font-style: italic; + font-weight: normal; } + +/* Base tree */ +pre.base-tree { font-size: 80%; margin: 0; } + +/* TOC */ +p.toc { margin: 0; } + +/* Details Sections */ +table.func-details { background: #e8f0f8; color: #000000; + border: 2px groove #c0d0d0; + padding: 0 1em 0 1em; margin: 0.4em 0 0 0; } +h3.func-detail { background: transparent; color: #000000; + margin: 0 0 1em 0; } + +table.var-details { background: #e8f0f8; color: #000000; + border: 2px groove #c0d0d0; + padding: 0 1em 0 1em; margin: 0.4em 0 0 0; } +h3.var-details { background: transparent; color: #000000; + margin: 0 0 1em 0; } + +/* Function signatures */ +.sig { background: transparent; color: #000000; + font-weight: bold; } +.sig-name { background: transparent; color: #006080; } +.sig-arg, .sig-kwarg, .sig-vararg + { background: transparent; color: #008060; } +.sig-default { background: transparent; color: #602000; } +.summary-sig { background: transparent; color: #000000; } +.summary-sig-name { background: transparent; color: #204080; } +.summary-sig-arg, .summary-sig-kwarg, .summary-sig-vararg + { background: transparent; color: #008060; } + +/* Doctest blocks */ +.py-src { background: transparent; color: #000000; } +.py-prompt { background: transparent; color: #005050; + font-weight: bold;} +.py-string { background: transparent; color: #006030; } +.py-comment { background: transparent; color: #003060; } +.py-keyword { background: transparent; color: #600000; } +.py-output { background: transparent; color: #404040; } +div.code-block, +pre.literal-block, +pre.doctestblock { background: #f4faff; color: #000000; + padding: .5em; margin: 1em; + border: 1px solid #708890; } +table pre.doctestblock + { background: #dce4ec; color: #000000; + padding: .5em; margin: 1em; + border: 1px solid #708890; } +div.code-block { font-family: monospace; } + +/* Variable values */ +pre.variable { background: #dce4ec; color: #000000; + padding: .5em; margin: 0; + border: 1px solid #708890; } +.variable-linewrap { background: transparent; color: #604000; } +.variable-ellipsis { background: transparent; color: #604000; } +.variable-quote { background: transparent; color: #604000; } +.re { background: transparent; color: #000000; } +.re-char { background: transparent; color: #006030; } +.re-op { background: transparent; color: #600000; } +.re-group { background: transparent; color: #003060; } +.re-ref { background: transparent; color: #404040; } + +/* Navigation bar */ +table.navbar { background: #a0c0ff; color: #0000ff; + border: 2px groove #c0d0d0; } +th.navbar { background: #a0c0ff; color: #0000ff; } +th.navselect { background: #70b0ff; color: #000000; } +.nomargin { margin: 0; } + +/* Links */ +a:link { background: transparent; color: #0000ff; } +a:visited { background: transparent; color: #204080; } +a.navbar:link { background: transparent; color: #0000ff; + text-decoration: none; } +a.navbar:visited { background: transparent; color: #204080; + text-decoration: none; } + +/* Admonitions */ +div.warning, +div.note { background-color: #c0e0f8; + border: thin solid black; + padding: 1em; + margin-left: 1em; + margin-right: 1em; } +div.warning .first, +div.note .first { font-family: sans-serif; + font-size: 110%; + margin-right: 0.5em; } + +/* Lists */ +ul { margin-top: 0; } + +/* Python syntax */ +.p_character { color: olive; } +.p_classname { color: blue; font-weight: bold; } +.p_commentblock {color: gray; font-style: italic; } +.p_commentline { color: green; font-style: italic; } +.p_default {} +.p_defname { color: #009999; font-weight: bold; } +.p_identifier { color: black; } +.p_number { color: #009999; } +.p_operator { color: black; } +.p_string { color: #7F007F; } +.p_stringeol { color: #7F007F; } +.p_triple { color: #7F0000; } +.p_tripledouble { color: #7F0000; } +.p_word { color: navy; font-weight: bold; } diff --git a/psycopg2/doc/api/public/exceptions.Exception-class.html b/psycopg2/doc/api/public/exceptions.Exception-class.html new file mode 100644 index 00000000..d7e7ba4b --- /dev/null +++ b/psycopg2/doc/api/public/exceptions.Exception-class.html @@ -0,0 +1,128 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>exceptions.Exception</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + Module exceptions :: + Class Exception + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<a href="../private/exceptions.Exception-class.html">show private</a> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="exceptions.Exception-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Class Exception</h2> + +<dl><dt>Known Subclasses:</dt> +<dd> + <a href="exceptions.StandardError-class.html"><code>StandardError</code></a></dd></dl> + +<hr/> + +<p>Common base class for all exceptions.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__init__"></a><span class="summary-sig"><span class="summary-sig-name">__init__</span>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__getitem__"></a><span class="summary-sig"><span class="summary-sig-name">__getitem__</span>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__str__"></a><span class="summary-sig"><span class="summary-sig-name">__str__</span>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +</table><br /> + + +<!-- =========== START OF METHOD DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Method Details</th></tr> +</table> + +<a name="__init__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-vararg">...</span>)</span> + <br /><em class="fname">(Constructor)</em> + </h3> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="__getitem__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__getitem__</span>(<span class="sig-vararg">...</span>)</span> + <br /><em class="fname">(Indexing operator)</em> + </h3> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="__str__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__str__</span>(<span class="sig-vararg">...</span>)</span> + <br /><em class="fname">(Informal representation operator)</em> + </h3> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:35 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/public/exceptions.StandardError-class.html b/psycopg2/doc/api/public/exceptions.StandardError-class.html new file mode 100644 index 00000000..ab0a1c36 --- /dev/null +++ b/psycopg2/doc/api/public/exceptions.StandardError-class.html @@ -0,0 +1,102 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>exceptions.StandardError</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + Module exceptions :: + Class StandardError + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<a href="../private/exceptions.StandardError-class.html">show private</a> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="exceptions.StandardError-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Class StandardError</h2> + +<pre class="base-tree"> +<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ + | + <strong class="uidshort">StandardError</strong> +</pre><br /> + +<dl><dt>Known Subclasses:</dt> +<dd> + <a href="psycopg2.Error-class.html"><code>Error</code></a>, + <a href="psycopg2.Warning-class.html"><code>Warning</code></a></dd></dl> + +<hr/> + +<p>Base class for all standard Python exceptions.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from Exception</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +</table><br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/public/frames.html b/psycopg2/doc/api/public/frames.html new file mode 100644 index 00000000..ffd65360 --- /dev/null +++ b/psycopg2/doc/api/public/frames.html @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" + "DTD/xhtml1-frameset.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title> API Documentation </title> +</head> +<frameset cols="20%,80%"> + <frameset rows="30%,70%"> + <frame src="toc.html" name="moduleListFrame" id="moduleListFrame" /> + <frame src="toc-everything.html" name="moduleFrame" id="moduleFrame" /> + </frameset> + <frame src="psycopg2-module.html" name="mainFrame" id="mainFrame" /> +</frameset> +</html> diff --git a/psycopg2/doc/api/public/help.html b/psycopg2/doc/api/public/help.html new file mode 100644 index 00000000..0e9a1cf5 --- /dev/null +++ b/psycopg2/doc/api/public/help.html @@ -0,0 +1,231 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>Help</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th bgcolor="#70b0f0" class="navselect"> Help </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<a href="../private/help.html">show private</a> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="help.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<h1 class="help"> API Documentation </h1> + +<p> This document contains the API (Application Programming Interface) +documentation for this project. Documentation for the Python +objects defined by the project is divided into separate pages for each +package, module, and class. The API documentation also includes two +pages containing information about the project as a whole: a trees +page, and an index page. </p> + +<h2> Object Documentation </h2> + + <p>Each <strong>Package Documentation</strong> page contains: </p> + <ul> + <li> A description of the package. </li> + <li> A list of the modules and sub-packages contained by the + package. </li> + <li> A summary of the classes defined by the package. </li> + <li> A summary of the functions defined by the package. </li> + <li> A summary of the variables defined by the package. </li> + <li> A detailed description of each function defined by the + package. </li> + <li> A detailed description of each variable defined by the + package. </li> + </ul> + + <p>Each <strong>Module Documentation</strong> page contains:</p> + <ul> + <li> A description of the module. </li> + <li> A summary of the classes defined by the module. </li> + <li> A summary of the functions defined by the module. </li> + <li> A summary of the variables defined by the module. </li> + <li> A detailed description of each function defined by the + module. </li> + <li> A detailed description of each variable defined by the + module. </li> + </ul> + + <p>Each <strong>Class Documentation</strong> page contains: </p> + <ul> + <li> A class inheritance diagram. </li> + <li> A list of known subclasses. </li> + <li> A description of the class. </li> + <li> A summary of the methods defined by the class. </li> + <li> A summary of the instance variables defined by the class. </li> + <li> A summary of the class (static) variables defined by the + class. </li> + <li> A detailed description of each method defined by the + class. </li> + <li> A detailed description of each instance variable defined by the + class. </li> + <li> A detailed description of each class (static) variable defined + by the class. </li> + </ul> + +<h2> Project Documentation </h2> + + <p> The <strong>Trees</strong> page contains the module and class hierarchies: </p> + <ul> + <li> The <em>module hierarchy</em> lists every package and module, with + modules grouped into packages. At the top level, and within each + package, modules and sub-packages are listed alphabetically. </li> + <li> The <em>class hierarchy</em> lists every class, grouped by base + class. If a class has more than one base class, then it will be + listed under each base class. At the top level, and under each base + class, classes are listed alphabetically. </li> + </ul> + + <p> The <strong>Index</strong> page contains indices of terms and + identifiers: </p> + <ul> + <li> The <em>term index</em> lists every term indexed by any object's + documentation. For each term, the index provides links to each + place where the term is indexed. </li> + <li> The <em>identifier index</em> lists the (short) name of every package, + module, class, method, function, variable, and parameter. For each + identifier, the index provides a short description, and a link to + its documentation. </li> + </ul> + +<h2> The Table of Contents </h2> + +<p> The table of contents occupies the two frames on the left side of +the window. The upper-left frame displays the <em>project +contents</em>, and the lower-left frame displays the <em>module +contents</em>: </p> + +<table class="help summary" border="1" cellspacing="0" cellpadding="3"> + <tr style="height: 30%"> + <td align="center" style="font-size: small"> + Project<br />Contents<hr />...</td> + <td align="center" style="font-size: small" rowspan="2" width="70%"> + API<br />Documentation<br />Frame<br /><br /><br /> + </td> + </tr> + <tr> + <td align="center" style="font-size: small"> + Module<br />Contents<hr /> <br />...<br /> + </td> + </tr> +</table><br /> + +<p> The <strong>project contents frame</strong> contains a list of all packages +and modules that are defined by the project. Clicking on an entry +will display its contents in the module contents frame. Clicking on a +special entry, labeled "Everything," will display the contents of +the entire project. </p> + +<p> The <strong>module contents frame</strong> contains a list of every +submodule, class, type, exception, function, and variable defined by a +module or package. Clicking on an entry will display its +documentation in the API documentation frame. Clicking on the name of +the module, at the top of the frame, will display the documentation +for the module itself. </p> + +<p> The "<strong>frames</strong>" and "<strong>no frames</strong>" buttons below the top +navigation bar can be used to control whether the table of contents is +displayed or not. </p> + +<h2> The Navigation Bar </h2> + +<p> A navigation bar is located at the top and bottom of every page. +It indicates what type of page you are currently viewing, and allows +you to go to related pages. The following table describes the labels +on the navigation bar. Note that not some labels (such as +[Parent]) are not displayed on all pages. </p> + +<table class="summary" border="1" cellspacing="0" cellpadding="3" width="100%"> +<tr class="summary"> + <th>Label</th> + <th>Highlighted when...</th> + <th>Links to...</th> +</tr> + <tr><td valign="top"><strong>[Parent]</strong></td> + <td valign="top"><em>(never highlighted)</em></td> + <td valign="top"> the parent of the current package </td></tr> + <tr><td valign="top"><strong>[Package]</strong></td> + <td valign="top">viewing a package</td> + <td valign="top">the package containing the current object + </td></tr> + <tr><td valign="top"><strong>[Module]</strong></td> + <td valign="top">viewing a module</td> + <td valign="top">the module containing the current object + </td></tr> + <tr><td valign="top"><strong>[Class]</strong></td> + <td valign="top">viewing a class </td> + <td valign="top">the class containing the current object</td></tr> + <tr><td valign="top"><strong>[Trees]</strong></td> + <td valign="top">viewing the trees page</td> + <td valign="top"> the trees page </td></tr> + <tr><td valign="top"><strong>[Index]</strong></td> + <td valign="top">viewing the index page</td> + <td valign="top"> the index page </td></tr> + <tr><td valign="top"><strong>[Help]</strong></td> + <td valign="top">viewing the help page</td> + <td valign="top"> the help page </td></tr> +</table> + +<p> The "<strong>show private</strong>" and "<strong>hide private</strong>" buttons below +the top navigation bar can be used to control whether documentation +for private objects is displayed. Private objects are usually defined +as objects whose (short) names begin with a single underscore, but do +not end with an underscore. For example, "<code>_x</code>", +"<code>__pprint</code>", and "<code>epydoc.epytext._tokenize</code>" +are private objects; but "<code>re.sub</code>", +"<code>__init__</code>", and "<code>type_</code>" are not. However, +if a module defines the "<code>__all__</code>" variable, then its +contents are used to decide which objects are private. </p> + +<p> A timestamp below the bottom navigation bar indicates when each +page was last updated. </p> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th bgcolor="#70b0f0" class="navselect"> Help </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:37 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/public/index.html b/psycopg2/doc/api/public/index.html new file mode 100644 index 00000000..ffd65360 --- /dev/null +++ b/psycopg2/doc/api/public/index.html @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" + "DTD/xhtml1-frameset.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title> API Documentation </title> +</head> +<frameset cols="20%,80%"> + <frameset rows="30%,70%"> + <frame src="toc.html" name="moduleListFrame" id="moduleListFrame" /> + <frame src="toc-everything.html" name="moduleFrame" id="moduleFrame" /> + </frameset> + <frame src="psycopg2-module.html" name="mainFrame" id="mainFrame" /> +</frameset> +</html> diff --git a/psycopg2/doc/api/public/indices.html b/psycopg2/doc/api/public/indices.html new file mode 100644 index 00000000..a6d0fadc --- /dev/null +++ b/psycopg2/doc/api/public/indices.html @@ -0,0 +1,418 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>Index</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th bgcolor="#70b0f0" class="navselect"> Index </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<a href="../private/indices.html">show private</a> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="indices.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> +<br /> + +<!-- =========== START OF IDENTIFIER INDEX =========== --> +<table class="index" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="index"> + <th colspan="2">Identifier Index</th></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__add__"><code>__add__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.type-class.html#__base__"><code>__base__</code></a></td> + <td>member_descriptor in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.type-class.html#__bases__"><code>__bases__</code></a></td> + <td>Variable in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.type-class.html#__basicsize__"><code>__basicsize__</code></a></td> + <td>member_descriptor in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.type-class.html#__call__"><code>__call__</code></a></td> + <td>Method in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.type-class.html"><code>type</code></a></td> + <td>Class in module <code>__builtin__</code></td></tr> + <tr><td width="15%"><a href="__builtin__.type-class.html#__cmp__"><code>__cmp__</code></a></td> + <td>Method in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__contains__"><code>__contains__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.object-class.html#__delattr__"><code>__delattr__</code></a></td> + <td>Method in class <a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.type-class.html#__delattr__"><code>__delattr__</code></a></td> + <td>Method in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__delitem__"><code>__delitem__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__delslice__"><code>__delslice__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.type-class.html#__dictoffset__"><code>__dictoffset__</code></a></td> + <td>member_descriptor in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__eq__"><code>__eq__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.type-class.html#__flags__"><code>__flags__</code></a></td> + <td>member_descriptor in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__ge__"><code>__ge__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__getattribute__"><code>__getattribute__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.object-class.html#__getattribute__"><code>__getattribute__</code></a></td> + <td>Method in class <a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.type-class.html#__getattribute__"><code>__getattribute__</code></a></td> + <td>Method in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr> + <tr><td width="15%"><a href="datetime.tzinfo-class.html#__getattribute__"><code>__getattribute__</code></a></td> + <td>Method in class <a href="datetime.tzinfo-class.html"><code>datetime.tzinfo</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__getitem__"><code>__getitem__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="exceptions.Exception-class.html#__getitem__"><code>__getitem__</code></a></td> + <td>Method in class <a href="exceptions.Exception-class.html"><code>exceptions.Exception</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extras.DictRow-class.html#__getitem__"><code>__getitem__</code></a></td> + <td>Method in class <a href="psycopg2.extras.DictRow-class.html"><code>psycopg2.extras.DictRow</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__getslice__"><code>__getslice__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__gt__"><code>__gt__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__hash__"><code>__hash__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.object-class.html#__hash__"><code>__hash__</code></a></td> + <td>Method in class <a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.type-class.html#__hash__"><code>__hash__</code></a></td> + <td>Method in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__iadd__"><code>__iadd__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__imul__"><code>__imul__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__init__"><code>__init__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.object-class.html#__init__"><code>__init__</code></a></td> + <td>Method in class <a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></td></tr> + <tr><td width="15%"><a href="exceptions.Exception-class.html#__init__"><code>__init__</code></a></td> + <td>Method in class <a href="exceptions.Exception-class.html"><code>exceptions.Exception</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extras.DictRow-class.html#__init__"><code>__init__</code></a></td> + <td>Method in class <a href="psycopg2.extras.DictRow-class.html"><code>psycopg2.extras.DictRow</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extras.SQL_IN-class.html#__init__"><code>__init__</code></a></td> + <td>Method in class <a href="psycopg2.extras.SQL_IN-class.html"><code>psycopg2.extras.SQL_IN</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.pool.AbstractConnectionPool-class.html#__init__"><code>__init__</code></a></td> + <td>Method in class <a href="psycopg2.pool.AbstractConnectionPool-class.html"><code>psycopg2.pool.AbstractConnectionPool</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.pool.PersistentConnectionPool-class.html#__init__"><code>__init__</code></a></td> + <td>Method in class <a href="psycopg2.pool.PersistentConnectionPool-class.html"><code>psycopg2.pool.PersistentConnectionPool</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.pool.ThreadedConnectionPool-class.html#__init__"><code>__init__</code></a></td> + <td>Method in class <a href="psycopg2.pool.ThreadedConnectionPool-class.html"><code>psycopg2.pool.ThreadedConnectionPool</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.tz.FixedOffsetTimezone-class.html#__init__"><code>__init__</code></a></td> + <td>Method in class <a href="psycopg2.tz.FixedOffsetTimezone-class.html"><code>psycopg2.tz.FixedOffsetTimezone</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.type-class.html#__itemsize__"><code>__itemsize__</code></a></td> + <td>member_descriptor in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__iter__"><code>__iter__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__le__"><code>__le__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__len__"><code>__len__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__lt__"><code>__lt__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.type-class.html#__mro__"><code>__mro__</code></a></td> + <td>member_descriptor in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__mul__"><code>__mul__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.type-class.html#__name__"><code>__name__</code></a></td> + <td>Variable in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__ne__"><code>__ne__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__new__"><code>__new__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.object-class.html#__new__"><code>__new__</code></a></td> + <td>Method in class <a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.type-class.html#__new__"><code>__new__</code></a></td> + <td>Method in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr> + <tr><td width="15%"><a href="datetime.tzinfo-class.html#__new__"><code>__new__</code></a></td> + <td>Method in class <a href="datetime.tzinfo-class.html"><code>datetime.tzinfo</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.object-class.html#__reduce__"><code>__reduce__</code></a></td> + <td>Method in class <a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></td></tr> + <tr><td width="15%"><a href="datetime.tzinfo-class.html#__reduce__"><code>__reduce__</code></a></td> + <td>Method in class <a href="datetime.tzinfo-class.html"><code>datetime.tzinfo</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.object-class.html#__reduce_ex__"><code>__reduce_ex__</code></a></td> + <td>Method in class <a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__repr__"><code>__repr__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.object-class.html#__repr__"><code>__repr__</code></a></td> + <td>Method in class <a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.type-class.html#__repr__"><code>__repr__</code></a></td> + <td>Method in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__rmul__"><code>__rmul__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.object-class.html#__setattr__"><code>__setattr__</code></a></td> + <td>Method in class <a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.type-class.html#__setattr__"><code>__setattr__</code></a></td> + <td>Method in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__setitem__"><code>__setitem__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#__setslice__"><code>__setslice__</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.object-class.html#__str__"><code>__str__</code></a></td> + <td>Method in class <a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></td></tr> + <tr><td width="15%"><a href="exceptions.Exception-class.html#__str__"><code>__str__</code></a></td> + <td>Method in class <a href="exceptions.Exception-class.html"><code>exceptions.Exception</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.type-class.html#__subclasses__"><code>__subclasses__</code></a></td> + <td>Method in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.type-class.html#__weakrefoffset__"><code>__weakrefoffset__</code></a></td> + <td>member_descriptor in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.pool.AbstractConnectionPool-class.html"><code>AbstractConnectionPool</code></a></td> + <td>Class in module <a href="psycopg2.pool-module.html"><code>psycopg2.pool</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extensions-module.html#adapt"><code>adapt</code></a></td> + <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#append"><code>append</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extensions-module.html#AsIs"><code>AsIs</code></a></td> + <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.psycopg1.connection-class.html#autocommit"><code>autocommit</code></a></td> + <td>Method in class <a href="psycopg2.psycopg1.connection-class.html"><code>psycopg2.psycopg1.connection</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2-module.html#Binary"><code>Binary</code></a></td> + <td>Function in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extensions-module.html#Boolean"><code>Boolean</code></a></td> + <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extras.DictCursor-class.html#callproc"><code>callproc</code></a></td> + <td>Method in class <a href="psycopg2.extras.DictCursor-class.html"><code>psycopg2.extras.DictCursor</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.pool.PersistentConnectionPool-class.html#closeall"><code>closeall</code></a></td> + <td>Method in class <a href="psycopg2.pool.PersistentConnectionPool-class.html"><code>psycopg2.pool.PersistentConnectionPool</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.pool.ThreadedConnectionPool-class.html#closeall"><code>closeall</code></a></td> + <td>Method in class <a href="psycopg2.pool.ThreadedConnectionPool-class.html"><code>psycopg2.pool.ThreadedConnectionPool</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2-module.html#connect"><code>connect</code></a></td> + <td>Function in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.psycopg1-module.html#connect"><code>connect</code></a></td> + <td>Function in module <a href="psycopg2.psycopg1-module.html"><code>psycopg2.psycopg1</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.psycopg1.connection-class.html"><code>connection</code></a></td> + <td>Class in module <a href="psycopg2.psycopg1-module.html"><code>psycopg2.psycopg1</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#count"><code>count</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extras.DictConnection-class.html#cursor"><code>cursor</code></a></td> + <td>Method in class <a href="psycopg2.extras.DictConnection-class.html"><code>psycopg2.extras.DictConnection</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.psycopg1.connection-class.html#cursor"><code>cursor</code></a></td> + <td>Method in class <a href="psycopg2.psycopg1.connection-class.html"><code>psycopg2.psycopg1.connection</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.psycopg1.cursor-class.html"><code>cursor</code></a></td> + <td>Class in module <a href="psycopg2.psycopg1-module.html"><code>psycopg2.psycopg1</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.DatabaseError-class.html"><code>DatabaseError</code></a></td> + <td>Class in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.DataError-class.html"><code>DataError</code></a></td> + <td>Class in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2-module.html#Date"><code>Date</code></a></td> + <td>Function in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extensions-module.html#DateFromPy"><code>DateFromPy</code></a></td> + <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2-module.html#DateFromTicks"><code>DateFromTicks</code></a></td> + <td>Function in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.pool-module.html#dbg"><code>dbg</code></a></td> + <td>Function in module <a href="psycopg2.pool-module.html"><code>psycopg2.pool</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extras.DictConnection-class.html"><code>DictConnection</code></a></td> + <td>Class in module <a href="psycopg2.extras-module.html"><code>psycopg2.extras</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extras.DictCursor-class.html"><code>DictCursor</code></a></td> + <td>Class in module <a href="psycopg2.extras-module.html"><code>psycopg2.extras</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.psycopg1.cursor-class.html#dictfetchall"><code>dictfetchall</code></a></td> + <td>Method in class <a href="psycopg2.psycopg1.cursor-class.html"><code>psycopg2.psycopg1.cursor</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.psycopg1.cursor-class.html#dictfetchmany"><code>dictfetchmany</code></a></td> + <td>Method in class <a href="psycopg2.psycopg1.cursor-class.html"><code>psycopg2.psycopg1.cursor</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.psycopg1.cursor-class.html#dictfetchone"><code>dictfetchone</code></a></td> + <td>Method in class <a href="psycopg2.psycopg1.cursor-class.html"><code>psycopg2.psycopg1.cursor</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extras.DictRow-class.html"><code>DictRow</code></a></td> + <td>Class in module <a href="psycopg2.extras-module.html"><code>psycopg2.extras</code></a></td></tr> + <tr><td width="15%"><a href="datetime.tzinfo-class.html#dst"><code>dst</code></a></td> + <td>Method in class <a href="datetime.tzinfo-class.html"><code>datetime.tzinfo</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.tz.FixedOffsetTimezone-class.html#dst"><code>dst</code></a></td> + <td>Method in class <a href="psycopg2.tz.FixedOffsetTimezone-class.html"><code>psycopg2.tz.FixedOffsetTimezone</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.tz.LocalTimezone-class.html#dst"><code>dst</code></a></td> + <td>Method in class <a href="psycopg2.tz.LocalTimezone-class.html"><code>psycopg2.tz.LocalTimezone</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.tz-module.html#DSTDIFF"><code>DSTDIFF</code></a></td> + <td>Variable in module <a href="psycopg2.tz-module.html"><code>psycopg2.tz</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.Error-class.html"><code>Error</code></a></td> + <td>Class in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="exceptions.Exception-class.html"><code>Exception</code></a></td> + <td>Class in module <code>exceptions</code></td></tr> + <tr><td width="15%"><a href="psycopg2.extras.DictCursor-class.html#execute"><code>execute</code></a></td> + <td>Method in class <a href="psycopg2.extras.DictCursor-class.html"><code>psycopg2.extras.DictCursor</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#extend"><code>extend</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extensions-module.html"><code>extensions</code></a></td> + <td>Module in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extras-module.html"><code>extras</code></a></td> + <td>Module in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extras.DictCursor-class.html#fetchall"><code>fetchall</code></a></td> + <td>Method in class <a href="psycopg2.extras.DictCursor-class.html"><code>psycopg2.extras.DictCursor</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extras.DictCursor-class.html#fetchmany"><code>fetchmany</code></a></td> + <td>Method in class <a href="psycopg2.extras.DictCursor-class.html"><code>psycopg2.extras.DictCursor</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extras.DictCursor-class.html#fetchone"><code>fetchone</code></a></td> + <td>Method in class <a href="psycopg2.extras.DictCursor-class.html"><code>psycopg2.extras.DictCursor</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.tz.FixedOffsetTimezone-class.html"><code>FixedOffsetTimezone</code></a></td> + <td>Class in module <a href="psycopg2.tz-module.html"><code>psycopg2.tz</code></a></td></tr> + <tr><td width="15%"><a href="datetime.tzinfo-class.html#fromutc"><code>fromutc</code></a></td> + <td>Method in class <a href="datetime.tzinfo-class.html"><code>datetime.tzinfo</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extras.DictRow-class.html#get"><code>get</code></a></td> + <td>Method in class <a href="psycopg2.extras.DictRow-class.html"><code>psycopg2.extras.DictRow</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.pool.PersistentConnectionPool-class.html#getconn"><code>getconn</code></a></td> + <td>Method in class <a href="psycopg2.pool.PersistentConnectionPool-class.html"><code>psycopg2.pool.PersistentConnectionPool</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.pool.ThreadedConnectionPool-class.html#getconn"><code>getconn</code></a></td> + <td>Method in class <a href="psycopg2.pool.ThreadedConnectionPool-class.html"><code>psycopg2.pool.ThreadedConnectionPool</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extras.SQL_IN-class.html#getquoted"><code>getquoted</code></a></td> + <td>Method in class <a href="psycopg2.extras.SQL_IN-class.html"><code>psycopg2.extras.SQL_IN</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extras.DictRow-class.html#has_key"><code>has_key</code></a></td> + <td>Method in class <a href="psycopg2.extras.DictRow-class.html"><code>psycopg2.extras.DictRow</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#index"><code>index</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#insert"><code>insert</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.IntegrityError-class.html"><code>IntegrityError</code></a></td> + <td>Class in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.InterfaceError-class.html"><code>InterfaceError</code></a></td> + <td>Class in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.InternalError-class.html"><code>InternalError</code></a></td> + <td>Class in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extensions-module.html#IntervalFromPy"><code>IntervalFromPy</code></a></td> + <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extensions-module.html#ISOLATION_LEVEL_AUTOCOMMIT"><code>ISOLATION_LEVEL_AUTOCOMMIT</code></a></td> + <td>Variable in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extensions-module.html#ISOLATION_LEVEL_READ_COMMITTED"><code>ISOLATION_LEVEL_READ_COMMITTED</code></a></td> + <td>Variable in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extensions-module.html#ISOLATION_LEVEL_READ_UNCOMMITTED"><code>ISOLATION_LEVEL_READ_UNCOMMITTED</code></a></td> + <td>Variable in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extensions-module.html#ISOLATION_LEVEL_REPEATABLE_READ"><code>ISOLATION_LEVEL_REPEATABLE_READ</code></a></td> + <td>Variable in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extensions-module.html#ISOLATION_LEVEL_SERIALIZABLE"><code>ISOLATION_LEVEL_SERIALIZABLE</code></a></td> + <td>Variable in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extras.DictRow-class.html#items"><code>items</code></a></td> + <td>Method in class <a href="psycopg2.extras.DictRow-class.html"><code>psycopg2.extras.DictRow</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extras.DictRow-class.html#keys"><code>keys</code></a></td> + <td>Method in class <a href="psycopg2.extras.DictRow-class.html"><code>psycopg2.extras.DictRow</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html"><code>list</code></a></td> + <td>Class in module <code>__builtin__</code></td></tr> + <tr><td width="15%"><a href="psycopg2.tz-module.html#LOCAL"><code>LOCAL</code></a></td> + <td>Variable in module <a href="psycopg2.tz-module.html"><code>psycopg2.tz</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.tz.LocalTimezone-class.html"><code>LocalTimezone</code></a></td> + <td>Class in module <a href="psycopg2.tz-module.html"><code>psycopg2.tz</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.type-class.html#mro"><code>mro</code></a></td> + <td>Method in class <a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extensions-module.html#new_type"><code>new_type</code></a></td> + <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.NotSupportedError-class.html"><code>NotSupportedError</code></a></td> + <td>Class in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.object-class.html"><code>object</code></a></td> + <td>Class in module <code>__builtin__</code></td></tr> + <tr><td width="15%"><a href="psycopg2.OperationalError-class.html"><code>OperationalError</code></a></td> + <td>Class in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.pool.PersistentConnectionPool-class.html"><code>PersistentConnectionPool</code></a></td> + <td>Class in module <a href="psycopg2.pool-module.html"><code>psycopg2.pool</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.pool-module.html"><code>pool</code></a></td> + <td>Module in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.pool.PoolError-class.html"><code>PoolError</code></a></td> + <td>Class in module <a href="psycopg2.pool-module.html"><code>psycopg2.pool</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#pop"><code>pop</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.ProgrammingError-class.html"><code>ProgrammingError</code></a></td> + <td>Class in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.psycopg1-module.html"><code>psycopg1</code></a></td> + <td>Module in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2-module.html"><code>psycopg2</code></a></td> + <td>Package</td></tr> + <tr><td width="15%"><a href="psycopg2.pool.PersistentConnectionPool-class.html#putconn"><code>putconn</code></a></td> + <td>Method in class <a href="psycopg2.pool.PersistentConnectionPool-class.html"><code>psycopg2.pool.PersistentConnectionPool</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.pool.ThreadedConnectionPool-class.html#putconn"><code>putconn</code></a></td> + <td>Method in class <a href="psycopg2.pool.ThreadedConnectionPool-class.html"><code>psycopg2.pool.ThreadedConnectionPool</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extensions-module.html#QuotedString"><code>QuotedString</code></a></td> + <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extensions-module.html#register_adapter"><code>register_adapter</code></a></td> + <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extensions-module.html#register_type"><code>register_type</code></a></td> + <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#remove"><code>remove</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#reverse"><code>reverse</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.pool.SimpleConnectionPool-class.html"><code>SimpleConnectionPool</code></a></td> + <td>Class in module <a href="psycopg2.pool-module.html"><code>psycopg2.pool</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.list-class.html#sort"><code>sort</code></a></td> + <td>Method in class <a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extras.SQL_IN-class.html"><code>SQL_IN</code></a></td> + <td>Class in module <a href="psycopg2.extras-module.html"><code>psycopg2.extras</code></a></td></tr> + <tr><td width="15%"><a href="exceptions.StandardError-class.html"><code>StandardError</code></a></td> + <td>Class in module <code>exceptions</code></td></tr> + <tr><td width="15%"><a href="psycopg2.tz-module.html#STDOFFSET"><code>STDOFFSET</code></a></td> + <td>Variable in module <a href="psycopg2.tz-module.html"><code>psycopg2.tz</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.pool.ThreadedConnectionPool-class.html"><code>ThreadedConnectionPool</code></a></td> + <td>Class in module <a href="psycopg2.pool-module.html"><code>psycopg2.pool</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2-module.html#Time"><code>Time</code></a></td> + <td>Function in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extensions-module.html#TimeFromPy"><code>TimeFromPy</code></a></td> + <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2-module.html#TimeFromTicks"><code>TimeFromTicks</code></a></td> + <td>Function in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2-module.html#Timestamp"><code>Timestamp</code></a></td> + <td>Function in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extensions-module.html#TimestampFromPy"><code>TimestampFromPy</code></a></td> + <td>Function in module <a href="psycopg2.extensions-module.html"><code>psycopg2.extensions</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2-module.html#TimestampFromTicks"><code>TimestampFromTicks</code></a></td> + <td>Function in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="__builtin__.type-class.html"><code>type</code></a></td> + <td>Class in module <code>__builtin__</code></td></tr> + <tr><td width="15%"><a href="psycopg2.tz-module.html"><code>tz</code></a></td> + <td>Module in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="datetime.tzinfo-class.html"><code>tzinfo</code></a></td> + <td>Class in module <code>datetime</code></td></tr> + <tr><td width="15%"><a href="datetime.tzinfo-class.html#tzname"><code>tzname</code></a></td> + <td>Method in class <a href="datetime.tzinfo-class.html"><code>datetime.tzinfo</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.tz.FixedOffsetTimezone-class.html#tzname"><code>tzname</code></a></td> + <td>Method in class <a href="psycopg2.tz.FixedOffsetTimezone-class.html"><code>psycopg2.tz.FixedOffsetTimezone</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.tz.LocalTimezone-class.html#tzname"><code>tzname</code></a></td> + <td>Method in class <a href="psycopg2.tz.LocalTimezone-class.html"><code>psycopg2.tz.LocalTimezone</code></a></td></tr> + <tr><td width="15%"><a href="datetime.tzinfo-class.html#utcoffset"><code>utcoffset</code></a></td> + <td>Method in class <a href="datetime.tzinfo-class.html"><code>datetime.tzinfo</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.tz.FixedOffsetTimezone-class.html#utcoffset"><code>utcoffset</code></a></td> + <td>Method in class <a href="psycopg2.tz.FixedOffsetTimezone-class.html"><code>psycopg2.tz.FixedOffsetTimezone</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.tz.LocalTimezone-class.html#utcoffset"><code>utcoffset</code></a></td> + <td>Method in class <a href="psycopg2.tz.LocalTimezone-class.html"><code>psycopg2.tz.LocalTimezone</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.extras.DictRow-class.html#values"><code>values</code></a></td> + <td>Method in class <a href="psycopg2.extras.DictRow-class.html"><code>psycopg2.extras.DictRow</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.Warning-class.html"><code>Warning</code></a></td> + <td>Class in package <a href="psycopg2-module.html"><code>psycopg2</code></a></td></tr> + <tr><td width="15%"><a href="psycopg2.tz-module.html#ZERO"><code>ZERO</code></a></td> + <td>Variable in module <a href="psycopg2.tz-module.html"><code>psycopg2.tz</code></a></td></tr> +</table> +<br /> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th bgcolor="#70b0f0" class="navselect"> Index </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:37 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/public/psycopg2-module.html b/psycopg2/doc/api/public/psycopg2-module.html new file mode 100644 index 00000000..052c338d --- /dev/null +++ b/psycopg2/doc/api/public/psycopg2-module.html @@ -0,0 +1,335 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th bgcolor="#70b0f0" class="navselect"> Home </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + Package psycopg2 + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<a href="../private/psycopg2-module.html">show private</a> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2-module.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF PACKAGE DESCRIPTION =========== --> +<h2 class="package">Package psycopg2</h2> + +<p>A Python driver for PostgreSQL</p> +<p>psycopg is a <a class="reference" href="http://www.postgresql.org/">PostgreSQL</a> database adapter for the <a class="reference" href="http://www.python.org/">Python</a> programming +language. This is version 2, a complete rewrite of the original code to +provide new-style classes for connection and cursor objects and other sweet +candies. Like the original, psycopg 2 was written with the aim of being very +small and fast, and stable as a rock.</p> +<p>Homepage: <a class="reference" href="http://initd.org/projects/psycopg2">http://initd.org/projects/psycopg2</a></p> +<hr/> + +<!-- =========== START OF SUBMODULES =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Submodules</th></tr> + <tr><td><ul> +<li> <strong class="uidlink"><a href="psycopg2.extensions-module.html"><code>extensions</code></a></strong>: <em class="summary">psycopg extensions to the DBAPI-2.0</em></li> +<li> <strong class="uidlink"><a href="psycopg2.extras-module.html"><code>extras</code></a></strong>: <em class="summary">Miscellaneous goodies for psycopg2</em></li> +<li> <strong class="uidlink"><a href="psycopg2.pool-module.html"><code>pool</code></a></strong>: <em class="summary">Connection pooling for psycopg2</em></li> +<li> <strong class="uidlink"><a href="psycopg2.psycopg1-module.html"><code>psycopg1</code></a></strong>: <em class="summary">psycopg 1.1.x compatibility module</em></li> +<li> <strong class="uidlink"><a href="psycopg2.tz-module.html"><code>tz</code></a></strong>: <em class="summary">tzinfo implementations for psycopg2</em></li> + </ul></td></tr> +</table><br /> + + +<!-- =========== START OF EXCEPTIONS =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Exceptions</th></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.DatabaseError-class.html"><code>DatabaseError</code></a></strong></td> + <td>Error related to the database engine.</td></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.DataError-class.html"><code>DataError</code></a></strong></td> + <td>Error related to problems with the processed data.</td></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.Error-class.html"><code>Error</code></a></strong></td> + <td>Base class for error exceptions.</td></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.IntegrityError-class.html"><code>IntegrityError</code></a></strong></td> + <td>Error related to database integrity.</td></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.InterfaceError-class.html"><code>InterfaceError</code></a></strong></td> + <td>Error related to the database interface.</td></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.InternalError-class.html"><code>InternalError</code></a></strong></td> + <td>The database encountered an internal error.</td></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.NotSupportedError-class.html"><code>NotSupportedError</code></a></strong></td> + <td>A not supported datbase API was called.</td></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.OperationalError-class.html"><code>OperationalError</code></a></strong></td> + <td>Error related to database operation (disconnect, memory allocation etc).</td></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.ProgrammingError-class.html"><code>ProgrammingError</code></a></strong></td> + <td>Error related to database programming (SQL error, table not found etc).</td></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.Warning-class.html"><code>Warning</code></a></strong></td> + <td>A database warning.</td></tr> +</table><br /> + + +<!-- =========== START OF FUNCTION SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Function Summary</th></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Connections creation</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"><a href="../private/psycopg2._psycopg.connection-class.html" class="link"><code>extensions.connection</code></a></td> + <td><code><span class="summary-sig"><a href="psycopg2-module.html#connect" class="summary-sig-name"><code>connect</code></a>(<span class="summary-sig-arg">dsn</span>, + <span class="summary-sig-vararg">...</span>)</span></code> +<br /> +Create a new database connection.</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Value objects constructors</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">new binary object</td> + <td><code><span class="summary-sig"><a href="psycopg2-module.html#Binary" class="summary-sig-name"><code>Binary</code></a>(<span class="summary-sig-arg">buffer</span>)</span></code> +<br /> +Build an object capable to hold a bynary string value.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">new date</td> + <td><code><span class="summary-sig"><a href="psycopg2-module.html#Date" class="summary-sig-name"><code>Date</code></a>(<span class="summary-sig-arg">year</span>, + <span class="summary-sig-arg">month</span>, + <span class="summary-sig-arg">day</span>)</span></code> +<br /> +Build an object holding a date value.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">new date</td> + <td><code><span class="summary-sig"><a href="psycopg2-module.html#DateFromTicks" class="summary-sig-name"><code>DateFromTicks</code></a>(<span class="summary-sig-arg">ticks</span>)</span></code> +<br /> +Build an object holding a date value from the given ticks value.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">new time</td> + <td><code><span class="summary-sig"><a href="psycopg2-module.html#Time" class="summary-sig-name"><code>Time</code></a>(<span class="summary-sig-arg">hour</span>, + <span class="summary-sig-arg">minutes</span>, + <span class="summary-sig-arg">seconds</span>, + <span class="summary-sig-arg">tzinfo</span>)</span></code> +<br /> +Build an object holding a time value.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">new time</td> + <td><code><span class="summary-sig"><a href="psycopg2-module.html#TimeFromTicks" class="summary-sig-name"><code>TimeFromTicks</code></a>(<span class="summary-sig-arg">ticks</span>)</span></code> +<br /> +Build an object holding a time value from the given ticks value.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">new timestamp</td> + <td><code><span class="summary-sig"><a href="psycopg2-module.html#Timestamp" class="summary-sig-name"><code>Timestamp</code></a>(<span class="summary-sig-arg">year</span>, + <span class="summary-sig-arg">month</span>, + <span class="summary-sig-arg">day</span>, + <span class="summary-sig-arg">hour</span>, + <span class="summary-sig-arg">minutes</span>, + <span class="summary-sig-arg">seconds</span>, + <span class="summary-sig-arg">tzinfo</span>)</span></code> +<br /> +Build an object holding a timestamp value.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">new timestamp</td> + <td><code><span class="summary-sig"><a href="psycopg2-module.html#TimestampFromTicks" class="summary-sig-name"><code>TimestampFromTicks</code></a>(<span class="summary-sig-arg">ticks</span>)</span></code> +<br /> +Build an object holding a timestamp value from the given ticks value.</td></tr> +</table><br /> + + +<!-- =========== START OF FUNCTION DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Function Details</th></tr> +</table> + +<a name="connect"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">connect</span>(<span class="sig-arg">dsn</span>, + <span class="sig-vararg">...</span>)</span> + </h3> +<p>Create a new database connection.</p> +<p>This function supports two different but equivalent sets of arguments. +A single data source name or <tt class="docutils literal"><span class="pre">dsn</span></tt> string can be used to specify the +connection parameters, as follows:</p> +<pre class="literal-block"> +psycopg2.connect("dbname=xxx user=xxx ...") +</pre> +<p>If <tt class="docutils literal"><span class="pre">dsn</span></tt> is not provided it is possible to pass the parameters as +keyword arguments; e.g.:</p> +<pre class="literal-block"> +psycopg2.connect(database='xxx', user='xxx', ...) +</pre> +<p>The full list of available parameters is:</p> +<ul class="rst-simple"> +<li><tt class="docutils literal"><span class="pre">dbname</span></tt> -- database name (only in 'dsn')</li> +<li><tt class="docutils literal"><span class="pre">database</span></tt> -- database name (only as keyword argument)</li> +<li><tt class="docutils literal"><span class="pre">host</span></tt> -- host address (defaults to UNIX socket if not provided)</li> +<li><tt class="docutils literal"><span class="pre">port</span></tt> -- port number (defaults to 5432 if not provided)</li> +<li><tt class="docutils literal"><span class="pre">user</span></tt> -- user name used to authenticate</li> +<li><tt class="docutils literal"><span class="pre">password</span></tt> -- password used to authenticate</li> +<li><tt class="docutils literal"><span class="pre">sslmode</span></tt> -- SSL mode (see PostgreSQL documentation)</li> +</ul> +<p>If the <tt class="docutils literal"><span class="pre">connection_factory</span></tt> keyword argument is not provided this +function always return an instance of the <code>connection</code> class. +Else the given sub-class of <a href="../private/psycopg2._psycopg.connection-class.html" class="link"><code>extensions.connection</code></a> will be used to +instantiate the connection object.</p> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +New database connection <br /><em> + (type=<a href="../private/psycopg2._psycopg.connection-class.html" class="link"><code>extensions.connection</code></a>)</em> + </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="Binary"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">Binary</span>(<span class="sig-arg">buffer</span>)</span> + </h3> +<p>Build an object capable to hold a bynary string value.</p> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +new binary object </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="Date"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">Date</span>(<span class="sig-arg">year</span>, + <span class="sig-arg">month</span>, + <span class="sig-arg">day</span>)</span> + </h3> +<p>Build an object holding a date value.</p> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +new date </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="DateFromTicks"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">DateFromTicks</span>(<span class="sig-arg">ticks</span>)</span> + </h3> +<p>Build an object holding a date value from the given ticks value.</p> +<p>Ticks are the number of seconds since the epoch; see the documentation of the standard Python time module for details).</p> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +new date </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="Time"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">Time</span>(<span class="sig-arg">hour</span>, + <span class="sig-arg">minutes</span>, + <span class="sig-arg">seconds</span>, + <span class="sig-arg">tzinfo</span>=<span class="sig-default">None</span>)</span> + </h3> +<p>Build an object holding a time value.</p> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +new time </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="TimeFromTicks"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">TimeFromTicks</span>(<span class="sig-arg">ticks</span>)</span> + </h3> +<p>Build an object holding a time value from the given ticks value.</p> +<p>Ticks are the number of seconds since the epoch; see the documentation of the standard Python time module for details).</p> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +new time </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="Timestamp"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">Timestamp</span>(<span class="sig-arg">year</span>, + <span class="sig-arg">month</span>, + <span class="sig-arg">day</span>, + <span class="sig-arg">hour</span>, + <span class="sig-arg">minutes</span>, + <span class="sig-arg">seconds</span>, + <span class="sig-arg">tzinfo</span>=<span class="sig-default">None</span>)</span> + </h3> +<p>Build an object holding a timestamp value.</p> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +new timestamp </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="TimestampFromTicks"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">TimestampFromTicks</span>(<span class="sig-arg">ticks</span>)</span> + </h3> +<p>Build an object holding a timestamp value from the given ticks value.</p> +<p>Ticks are the number of seconds since the epoch; see the documentation of the standard Python time module for details).</p> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +new timestamp </dd> + </dl> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th bgcolor="#70b0f0" class="navselect"> Home </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:35 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/public/psycopg2.DataError-class.html b/psycopg2/doc/api/public/psycopg2.DataError-class.html new file mode 100644 index 00000000..48749b90 --- /dev/null +++ b/psycopg2/doc/api/public/psycopg2.DataError-class.html @@ -0,0 +1,103 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.DataError</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + Class DataError + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<a href="../private/psycopg2.DataError-class.html">show private</a> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.DataError-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Class DataError</h2> + +<pre class="base-tree"> +<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ + | +<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+ + | + <a href="psycopg2.Error-class.html"><code>Error</code></a> --+ + | + <a href="psycopg2.DatabaseError-class.html"><code>DatabaseError</code></a> --+ + | + <strong class="uidshort">DataError</strong> +</pre><br /> + +<hr/> + +<p>Error related to problems with the processed data.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from Exception</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +</table><br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/public/psycopg2.DatabaseError-class.html b/psycopg2/doc/api/public/psycopg2.DatabaseError-class.html new file mode 100644 index 00000000..154af859 --- /dev/null +++ b/psycopg2/doc/api/public/psycopg2.DatabaseError-class.html @@ -0,0 +1,110 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.DatabaseError</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + Class DatabaseError + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<a href="../private/psycopg2.DatabaseError-class.html">show private</a> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.DatabaseError-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Class DatabaseError</h2> + +<pre class="base-tree"> +<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ + | +<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+ + | + <a href="psycopg2.Error-class.html"><code>Error</code></a> --+ + | + <strong class="uidshort">DatabaseError</strong> +</pre><br /> + +<dl><dt>Known Subclasses:</dt> +<dd> + <a href="psycopg2.DataError-class.html"><code>DataError</code></a>, + <a href="psycopg2.IntegrityError-class.html"><code>IntegrityError</code></a>, + <a href="psycopg2.InternalError-class.html"><code>InternalError</code></a>, + <a href="psycopg2.NotSupportedError-class.html"><code>NotSupportedError</code></a>, + <a href="psycopg2.OperationalError-class.html"><code>OperationalError</code></a>, + <a href="psycopg2.ProgrammingError-class.html"><code>ProgrammingError</code></a></dd></dl> + +<hr/> + +<p>Error related to the database engine.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from Exception</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +</table><br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:34 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/public/psycopg2.Error-class.html b/psycopg2/doc/api/public/psycopg2.Error-class.html new file mode 100644 index 00000000..ed0b9fa3 --- /dev/null +++ b/psycopg2/doc/api/public/psycopg2.Error-class.html @@ -0,0 +1,105 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.Error</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + Class Error + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<a href="../private/psycopg2.Error-class.html">show private</a> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.Error-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Class Error</h2> + +<pre class="base-tree"> +<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ + | +<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+ + | + <strong class="uidshort">Error</strong> +</pre><br /> + +<dl><dt>Known Subclasses:</dt> +<dd> + <a href="psycopg2.DatabaseError-class.html"><code>DatabaseError</code></a>, + <a href="psycopg2.InterfaceError-class.html"><code>InterfaceError</code></a>, + <a href="psycopg2.pool.PoolError-class.html"><code>PoolError</code></a></dd></dl> + +<hr/> + +<p>Base class for error exceptions.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from Exception</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +</table><br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/public/psycopg2.IntegrityError-class.html b/psycopg2/doc/api/public/psycopg2.IntegrityError-class.html new file mode 100644 index 00000000..f2e2752f --- /dev/null +++ b/psycopg2/doc/api/public/psycopg2.IntegrityError-class.html @@ -0,0 +1,103 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.IntegrityError</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + Class IntegrityError + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<a href="../private/psycopg2.IntegrityError-class.html">show private</a> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.IntegrityError-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Class IntegrityError</h2> + +<pre class="base-tree"> +<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ + | +<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+ + | + <a href="psycopg2.Error-class.html"><code>Error</code></a> --+ + | + <a href="psycopg2.DatabaseError-class.html"><code>DatabaseError</code></a> --+ + | + <strong class="uidshort">IntegrityError</strong> +</pre><br /> + +<hr/> + +<p>Error related to database integrity.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from Exception</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +</table><br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:34 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/public/psycopg2.InterfaceError-class.html b/psycopg2/doc/api/public/psycopg2.InterfaceError-class.html new file mode 100644 index 00000000..40667fa8 --- /dev/null +++ b/psycopg2/doc/api/public/psycopg2.InterfaceError-class.html @@ -0,0 +1,101 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.InterfaceError</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + Class InterfaceError + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<a href="../private/psycopg2.InterfaceError-class.html">show private</a> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.InterfaceError-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Class InterfaceError</h2> + +<pre class="base-tree"> +<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ + | +<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+ + | + <a href="psycopg2.Error-class.html"><code>Error</code></a> --+ + | + <strong class="uidshort">InterfaceError</strong> +</pre><br /> + +<hr/> + +<p>Error related to the database interface.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from Exception</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +</table><br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:34 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/public/psycopg2.InternalError-class.html b/psycopg2/doc/api/public/psycopg2.InternalError-class.html new file mode 100644 index 00000000..13290d4f --- /dev/null +++ b/psycopg2/doc/api/public/psycopg2.InternalError-class.html @@ -0,0 +1,103 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.InternalError</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + Class InternalError + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<a href="../private/psycopg2.InternalError-class.html">show private</a> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.InternalError-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Class InternalError</h2> + +<pre class="base-tree"> +<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ + | +<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+ + | + <a href="psycopg2.Error-class.html"><code>Error</code></a> --+ + | + <a href="psycopg2.DatabaseError-class.html"><code>DatabaseError</code></a> --+ + | + <strong class="uidshort">InternalError</strong> +</pre><br /> + +<hr/> + +<p>The database encountered an internal error.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from Exception</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +</table><br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:34 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/public/psycopg2.NotSupportedError-class.html b/psycopg2/doc/api/public/psycopg2.NotSupportedError-class.html new file mode 100644 index 00000000..842c79f4 --- /dev/null +++ b/psycopg2/doc/api/public/psycopg2.NotSupportedError-class.html @@ -0,0 +1,103 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.NotSupportedError</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + Class NotSupportedError + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<a href="../private/psycopg2.NotSupportedError-class.html">show private</a> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.NotSupportedError-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Class NotSupportedError</h2> + +<pre class="base-tree"> +<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ + | +<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+ + | + <a href="psycopg2.Error-class.html"><code>Error</code></a> --+ + | + <a href="psycopg2.DatabaseError-class.html"><code>DatabaseError</code></a> --+ + | + <strong class="uidshort">NotSupportedError</strong> +</pre><br /> + +<hr/> + +<p>A not supported datbase API was called.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from Exception</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +</table><br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/public/psycopg2.OperationalError-class.html b/psycopg2/doc/api/public/psycopg2.OperationalError-class.html new file mode 100644 index 00000000..e52e8b11 --- /dev/null +++ b/psycopg2/doc/api/public/psycopg2.OperationalError-class.html @@ -0,0 +1,103 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.OperationalError</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + Class OperationalError + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<a href="../private/psycopg2.OperationalError-class.html">show private</a> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.OperationalError-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Class OperationalError</h2> + +<pre class="base-tree"> +<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ + | +<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+ + | + <a href="psycopg2.Error-class.html"><code>Error</code></a> --+ + | + <a href="psycopg2.DatabaseError-class.html"><code>DatabaseError</code></a> --+ + | + <strong class="uidshort">OperationalError</strong> +</pre><br /> + +<hr/> + +<p>Error related to database operation (disconnect, memory allocation etc).</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from Exception</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +</table><br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:35 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/public/psycopg2.ProgrammingError-class.html b/psycopg2/doc/api/public/psycopg2.ProgrammingError-class.html new file mode 100644 index 00000000..ea995a50 --- /dev/null +++ b/psycopg2/doc/api/public/psycopg2.ProgrammingError-class.html @@ -0,0 +1,103 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.ProgrammingError</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + Class ProgrammingError + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<a href="../private/psycopg2.ProgrammingError-class.html">show private</a> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.ProgrammingError-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Class ProgrammingError</h2> + +<pre class="base-tree"> +<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ + | +<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+ + | + <a href="psycopg2.Error-class.html"><code>Error</code></a> --+ + | + <a href="psycopg2.DatabaseError-class.html"><code>DatabaseError</code></a> --+ + | + <strong class="uidshort">ProgrammingError</strong> +</pre><br /> + +<hr/> + +<p>Error related to database programming (SQL error, table not found etc).</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from Exception</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +</table><br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:35 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/public/psycopg2.Warning-class.html b/psycopg2/doc/api/public/psycopg2.Warning-class.html new file mode 100644 index 00000000..86631fe2 --- /dev/null +++ b/psycopg2/doc/api/public/psycopg2.Warning-class.html @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.Warning</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + Class Warning + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<a href="../private/psycopg2.Warning-class.html">show private</a> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.Warning-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Class Warning</h2> + +<pre class="base-tree"> +<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ + | +<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+ + | + <strong class="uidshort">Warning</strong> +</pre><br /> + +<hr/> + +<p>A database warning.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from Exception</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +</table><br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/public/psycopg2._psycopg-module.html b/psycopg2/doc/api/public/psycopg2._psycopg-module.html new file mode 100644 index 00000000..034827e7 --- /dev/null +++ b/psycopg2/doc/api/public/psycopg2._psycopg-module.html @@ -0,0 +1,1001 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2._psycopg</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + Module _psycopg + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<a href="../private/psycopg2._psycopg-module.html">show private</a> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2._psycopg-module.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF MODULE DESCRIPTION =========== --> +<h2 class="module">Module psycopg2._psycopg</h2> + +<p>psycopg PostgreSQL driver</p> +<hr/> + +<!-- =========== START OF VARIABLE SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Variable Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>str</code></td> +<td><strong><a href="psycopg2._psycopg-module.html#__version__"><code>__version__</code></a></strong> = <span title="'2.0b7 (dt ext pq3)'"><code><span class="variable-quote">'</span>2.0b7 (dt ext pq3)<span class="variable-quote">'</span> </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>dict</code></td> +<td><strong><a href="psycopg2._psycopg-module.html#adapters"><code>adapters</code></a></strong> = <span title="{(<type 'bool'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.Boolean'>, (<type 'list'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.List'>, (<type 'datetime.datetime'>, <type 'psycopg2._psycopg.ISQLQuote'>): <built-in function TimestampFromPy>, (<type 'buffer'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.Binary'>, (<type 'unicode'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.QuotedString'>, (<type 'datetime.date'>, <type 'psycopg2._psycopg.ISQLQuote'>): <built-in function DateFromPy>, (<type 'datetime.time'>, ..."><code>{(<type 'bool'>, <type 'psycopg2._psycopg.ISQ<span class="variable-ellipsis">...</span></code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>str</code></td> +<td><strong><a href="psycopg2._psycopg-module.html#apilevel"><code>apilevel</code></a></strong> = <span title="'2.0'"><code><span class="variable-quote">'</span>2.0<span class="variable-quote">'</span> </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="psycopg2._psycopg-module.html#BINARY"><code>BINARY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x009558C0>"><code><psycopg2._psycopg.type object at 0x009558C0> </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>dict</code></td> +<td><strong><a href="psycopg2._psycopg-module.html#binary_types"><code>binary_types</code></a></strong> = <span title="{}"><code>{} </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="psycopg2._psycopg-module.html#BINARYARRAY"><code>BINARYARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955B60>"><code><psycopg2._psycopg.type object at 0x00955B<span class="variable-ellipsis">...</span></code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="psycopg2._psycopg-module.html#BOOLEAN"><code>BOOLEAN</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955760>"><code><psycopg2._psycopg.type object at 0x00955760> </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="psycopg2._psycopg-module.html#BOOLEANARRAY"><code>BOOLEANARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955A20>"><code><psycopg2._psycopg.type object at 0x00955<span class="variable-ellipsis">...</span></code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="psycopg2._psycopg-module.html#DATE"><code>DATE</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x009558A0>"><code><psycopg2._psycopg.type object at 0x009558A0> </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="psycopg2._psycopg-module.html#DATEARRAY"><code>DATEARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955AA0>"><code><psycopg2._psycopg.type object at 0x00955AA0<span class="variable-ellipsis">...</span></code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="psycopg2._psycopg-module.html#DATETIME"><code>DATETIME</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x009557C0>"><code><psycopg2._psycopg.type object at 0x009557C0> </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="psycopg2._psycopg-module.html#DATETIMEARRAY"><code>DATETIMEARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955AC0>"><code><psycopg2._psycopg.type object at 0x0095<span class="variable-ellipsis">...</span></code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="psycopg2._psycopg-module.html#DECIMAL"><code>DECIMAL</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955680>"><code><psycopg2._psycopg.type object at 0x00955680> </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="psycopg2._psycopg-module.html#DECIMALARRAY"><code>DECIMALARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955260>"><code><psycopg2._psycopg.type object at 0x00955<span class="variable-ellipsis">...</span></code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>dict</code></td> +<td><strong><a href="psycopg2._psycopg-module.html#encodings"><code>encodings</code></a></strong> = <span title="{'UTF8': 'utf_8', 'LATIN-1': 'latin_1', 'SQL_ASCII': 'ascii', 'UNICODE': 'utf_8', 'LATIN1': 'latin_1'}"><code>{'UTF8': 'utf_8', 'LATIN-1': 'latin_1', 'SQL<span class="variable-ellipsis">...</span></code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="psycopg2._psycopg-module.html#FLOAT"><code>FLOAT</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955660>"><code><psycopg2._psycopg.type object at 0x00955660> </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="psycopg2._psycopg-module.html#FLOATARRAY"><code>FLOATARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x009559E0>"><code><psycopg2._psycopg.type object at 0x009559E<span class="variable-ellipsis">...</span></code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="psycopg2._psycopg-module.html#INTEGER"><code>INTEGER</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955620>"><code><psycopg2._psycopg.type object at 0x00955620> </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="psycopg2._psycopg-module.html#INTEGERARRAY"><code>INTEGERARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955A00>"><code><psycopg2._psycopg.type object at 0x00955<span class="variable-ellipsis">...</span></code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="psycopg2._psycopg-module.html#INTERVAL"><code>INTERVAL</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955860>"><code><psycopg2._psycopg.type object at 0x00955860> </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="psycopg2._psycopg-module.html#INTERVALARRAY"><code>INTERVALARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955BA0>"><code><psycopg2._psycopg.type object at 0x0095<span class="variable-ellipsis">...</span></code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="psycopg2._psycopg-module.html#LONGINTEGER"><code>LONGINTEGER</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x009555C0>"><code><psycopg2._psycopg.type object at 0x009555<span class="variable-ellipsis">...</span></code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="psycopg2._psycopg-module.html#LONGINTEGERARRAY"><code>LONGINTEGERARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955960>"><code><psycopg2._psycopg.type object at 0x0<span class="variable-ellipsis">...</span></code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="psycopg2._psycopg-module.html#NUMBER"><code>NUMBER</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955540>"><code><psycopg2._psycopg.type object at 0x00955540> </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>str</code></td> +<td><strong><a href="psycopg2._psycopg-module.html#paramstyle"><code>paramstyle</code></a></strong> = <span title="'pyformat'"><code><span class="variable-quote">'</span>pyformat<span class="variable-quote">'</span> </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="psycopg2._psycopg-module.html#PYDATE"><code>PYDATE</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955D00>"><code><psycopg2._psycopg.type object at 0x00955D00> </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="psycopg2._psycopg-module.html#PYDATETIME"><code>PYDATETIME</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955C00>"><code><psycopg2._psycopg.type object at 0x00955C0<span class="variable-ellipsis">...</span></code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="psycopg2._psycopg-module.html#PYINTERVAL"><code>PYINTERVAL</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955CE0>"><code><psycopg2._psycopg.type object at 0x00955CE<span class="variable-ellipsis">...</span></code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="psycopg2._psycopg-module.html#PYTIME"><code>PYTIME</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955C40>"><code><psycopg2._psycopg.type object at 0x00955C40> </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="psycopg2._psycopg-module.html#ROWID"><code>ROWID</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x009559A0>"><code><psycopg2._psycopg.type object at 0x009559A0> </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="psycopg2._psycopg-module.html#ROWIDARRAY"><code>ROWIDARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955BE0>"><code><psycopg2._psycopg.type object at 0x00955BE<span class="variable-ellipsis">...</span></code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="psycopg2._psycopg-module.html#STRING"><code>STRING</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955720>"><code><psycopg2._psycopg.type object at 0x00955720> </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>dict</code></td> +<td><strong><a href="psycopg2._psycopg-module.html#string_types"><code>string_types</code></a></strong> = <span title="{1028: <psycopg2._psycopg.type object at 0x00955BE0>, 1005: <psycopg2._psycopg.type object at 0x00955A00>, 16: <psycopg2._psycopg.type object at 0x00955760>, 17: <psycopg2._psycopg.type object at 0x009558C0>, 1042: <psycopg2._psycopg.type object at 0x00955720>, 1043: <psycopg2._psycopg.type object at 0x00955720>, 20: <psycopg2._psycopg.type object at 0x009555C0>, 21: <psycopg2._psycopg.type object at 0x00955620>, 23: <psycopg2._psycopg.type object at 0x00955620>, 25: <psycopg2._psycopg.type object at 0x00955720>, 26: <psycopg2._psycopg.type object at 0x009559A0>, 1182: <psycopg2._psycopg.ty..."><code>{1028: <psycopg2._psycopg.type object at <span class="variable-ellipsis">...</span></code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="psycopg2._psycopg-module.html#STRINGARRAY"><code>STRINGARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955A80>"><code><psycopg2._psycopg.type object at 0x00955A<span class="variable-ellipsis">...</span></code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>int</code></td> +<td><strong><a href="psycopg2._psycopg-module.html#threadsafety"><code>threadsafety</code></a></strong> = <span title="2">2 </span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="psycopg2._psycopg-module.html#TIME"><code>TIME</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955840>"><code><psycopg2._psycopg.type object at 0x00955840> </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="psycopg2._psycopg-module.html#TIMEARRAY"><code>TIMEARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955B00>"><code><psycopg2._psycopg.type object at 0x00955B00<span class="variable-ellipsis">...</span></code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="psycopg2._psycopg-module.html#UNICODE"><code>UNICODE</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x009556C0>"><code><psycopg2._psycopg.type object at 0x009556C0> </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>type</code></td> +<td><strong><a href="psycopg2._psycopg-module.html#UNICODEARRAY"><code>UNICODEARRAY</code></a></strong> = <span title="<psycopg2._psycopg.type object at 0x00955A40>"><code><psycopg2._psycopg.type object at 0x00955<span class="variable-ellipsis">...</span></code> +</span></td></tr> +</table><br /> + + +<!-- =========== START OF VARIABLE DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Variable Details</th></tr> +</table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="__version__"></a> +<h3>__version__</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>str</code> + + </dd> + <dt title="'2.0b7 (dt ext pq3)'">Value:</dt> + <dd title="'2.0b7 (dt ext pq3)'"><table><tr><td> +<pre class="variable"> +<span class="variable-quote">'</span>2.0b7 (dt ext pq3)<span class="variable-quote">'</span> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="adapters"></a> +<h3>adapters</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>dict</code> + + </dd> + <dt title="{(<type 'bool'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.Boolean'>, (<type 'list'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.List'>, (<type 'datetime.datetime'>, <type 'psycopg2._psycopg.ISQLQuote'>): <built-in function TimestampFromPy>, (<type 'buffer'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.Binary'>, (<type 'unicode'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.QuotedString'>, (<type 'datetime.date'>, <type 'psycopg2._psycopg.ISQLQuote'>): <built-in function DateFromPy>, (<type 'datetime.time'>, ...">Value:</dt> + <dd title="{(<type 'bool'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.Boolean'>, (<type 'list'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.List'>, (<type 'datetime.datetime'>, <type 'psycopg2._psycopg.ISQLQuote'>): <built-in function TimestampFromPy>, (<type 'buffer'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.Binary'>, (<type 'unicode'>, <type 'psycopg2._psycopg.ISQLQuote'>): <type 'psycopg2._psycopg.QuotedString'>, (<type 'datetime.date'>, <type 'psycopg2._psycopg.ISQLQuote'>): <built-in function DateFromPy>, (<type 'datetime.time'>, ..."><table><tr><td> +<pre class="variable"> +{(<type 'datetime.timedelta'>, <type 'psycopg2._psycopg.ISQLQuote'>): <span class="variable-linewrap">\</span> +<built-in function IntervalFromPy>, + (<type 'datetime.date'>, <type 'psycopg2._psycopg.ISQLQuote'>): <buil<span class="variable-linewrap">\</span> +t-in function DateFromPy>, + (<type 'datetime.time'>, <type 'psycopg2._psycopg.ISQLQuote'>): <buil<span class="variable-linewrap">\</span> +t-in function TimeFromPy>, + (<type 'datetime.datetime'>, <type 'psycopg2._psycopg.ISQLQuote'>): <<span class="variable-linewrap">\</span> +built-in function TimestampFromPy>, +<span class="variable-ellipsis">...</span> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="apilevel"></a> +<h3>apilevel</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>str</code> + + </dd> + <dt title="'2.0'">Value:</dt> + <dd title="'2.0'"><table><tr><td> +<pre class="variable"> +<span class="variable-quote">'</span>2.0<span class="variable-quote">'</span> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="BINARY"></a> +<h3>BINARY</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x009558C0>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x009558C0>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x009558C0> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="binary_types"></a> +<h3>binary_types</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>dict</code> + + </dd> + <dt title="{}">Value:</dt> + <dd title="{}"><table><tr><td> +<pre class="variable"> +{} </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="BINARYARRAY"></a> +<h3>BINARYARRAY</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00955B60>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00955B60>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00955B60> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="BOOLEAN"></a> +<h3>BOOLEAN</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00955760>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00955760>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00955760> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="BOOLEANARRAY"></a> +<h3>BOOLEANARRAY</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00955A20>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00955A20>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00955A20> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="DATE"></a> +<h3>DATE</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x009558A0>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x009558A0>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x009558A0> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="DATEARRAY"></a> +<h3>DATEARRAY</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00955AA0>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00955AA0>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00955AA0> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="DATETIME"></a> +<h3>DATETIME</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x009557C0>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x009557C0>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x009557C0> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="DATETIMEARRAY"></a> +<h3>DATETIMEARRAY</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00955AC0>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00955AC0>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00955AC0> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="DECIMAL"></a> +<h3>DECIMAL</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00955680>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00955680>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00955680> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="DECIMALARRAY"></a> +<h3>DECIMALARRAY</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00955260>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00955260>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00955260> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="encodings"></a> +<h3>encodings</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>dict</code> + + </dd> + <dt title="{'UTF8': 'utf_8', 'LATIN-1': 'latin_1', 'SQL_ASCII': 'ascii', 'UNICODE': 'utf_8', 'LATIN1': 'latin_1'}">Value:</dt> + <dd title="{'UTF8': 'utf_8', 'LATIN-1': 'latin_1', 'SQL_ASCII': 'ascii', 'UNICODE': 'utf_8', 'LATIN1': 'latin_1'}"><table><tr><td> +<pre class="variable"> +{'LATIN-1': 'latin_1', + 'LATIN1': 'latin_1', + 'SQL_ASCII': 'ascii', + 'UNICODE': 'utf_8', + 'UTF8': 'utf_8'} </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="FLOAT"></a> +<h3>FLOAT</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00955660>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00955660>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00955660> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="FLOATARRAY"></a> +<h3>FLOATARRAY</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x009559E0>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x009559E0>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x009559E0> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="INTEGER"></a> +<h3>INTEGER</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00955620>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00955620>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00955620> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="INTEGERARRAY"></a> +<h3>INTEGERARRAY</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00955A00>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00955A00>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00955A00> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="INTERVAL"></a> +<h3>INTERVAL</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00955860>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00955860>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00955860> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="INTERVALARRAY"></a> +<h3>INTERVALARRAY</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00955BA0>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00955BA0>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00955BA0> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="LONGINTEGER"></a> +<h3>LONGINTEGER</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x009555C0>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x009555C0>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x009555C0> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="LONGINTEGERARRAY"></a> +<h3>LONGINTEGERARRAY</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00955960>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00955960>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00955960> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="NUMBER"></a> +<h3>NUMBER</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00955540>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00955540>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00955540> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="paramstyle"></a> +<h3>paramstyle</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>str</code> + + </dd> + <dt title="'pyformat'">Value:</dt> + <dd title="'pyformat'"><table><tr><td> +<pre class="variable"> +<span class="variable-quote">'</span>pyformat<span class="variable-quote">'</span> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="PYDATE"></a> +<h3>PYDATE</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00955D00>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00955D00>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00955D00> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="PYDATETIME"></a> +<h3>PYDATETIME</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00955C00>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00955C00>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00955C00> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="PYINTERVAL"></a> +<h3>PYINTERVAL</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00955CE0>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00955CE0>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00955CE0> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="PYTIME"></a> +<h3>PYTIME</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00955C40>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00955C40>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00955C40> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="ROWID"></a> +<h3>ROWID</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x009559A0>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x009559A0>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x009559A0> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="ROWIDARRAY"></a> +<h3>ROWIDARRAY</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00955BE0>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00955BE0>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00955BE0> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="STRING"></a> +<h3>STRING</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00955720>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00955720>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00955720> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="string_types"></a> +<h3>string_types</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>dict</code> + + </dd> + <dt title="{1028: <psycopg2._psycopg.type object at 0x00955BE0>, 1005: <psycopg2._psycopg.type object at 0x00955A00>, 16: <psycopg2._psycopg.type object at 0x00955760>, 17: <psycopg2._psycopg.type object at 0x009558C0>, 1042: <psycopg2._psycopg.type object at 0x00955720>, 1043: <psycopg2._psycopg.type object at 0x00955720>, 20: <psycopg2._psycopg.type object at 0x009555C0>, 21: <psycopg2._psycopg.type object at 0x00955620>, 23: <psycopg2._psycopg.type object at 0x00955620>, 25: <psycopg2._psycopg.type object at 0x00955720>, 26: <psycopg2._psycopg.type object at 0x009559A0>, 1182: <psycopg2._psycopg.ty...">Value:</dt> + <dd title="{1028: <psycopg2._psycopg.type object at 0x00955BE0>, 1005: <psycopg2._psycopg.type object at 0x00955A00>, 16: <psycopg2._psycopg.type object at 0x00955760>, 17: <psycopg2._psycopg.type object at 0x009558C0>, 1042: <psycopg2._psycopg.type object at 0x00955720>, 1043: <psycopg2._psycopg.type object at 0x00955720>, 20: <psycopg2._psycopg.type object at 0x009555C0>, 21: <psycopg2._psycopg.type object at 0x00955620>, 23: <psycopg2._psycopg.type object at 0x00955620>, 25: <psycopg2._psycopg.type object at 0x00955720>, 26: <psycopg2._psycopg.type object at 0x009559A0>, 1182: <psycopg2._psycopg.ty..."><table><tr><td> +<pre class="variable"> +{16: <psycopg2._psycopg.type object at 0x00955760>, + 17: <psycopg2._psycopg.type object at 0x009558C0>, + 18: <psycopg2._psycopg.type object at 0x00955720>, + 19: <psycopg2._psycopg.type object at 0x00955720>, + 20: <psycopg2._psycopg.type object at 0x009555C0>, + 21: <psycopg2._psycopg.type object at 0x00955620>, + 23: <psycopg2._psycopg.type object at 0x00955620>, + 25: <psycopg2._psycopg.type object at 0x00955720>, +<span class="variable-ellipsis">...</span> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="STRINGARRAY"></a> +<h3>STRINGARRAY</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00955A80>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00955A80>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00955A80> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="threadsafety"></a> +<h3>threadsafety</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>int</code> + + </dd> + <dt title="2">Value:</dt> + <dd title="2"><table><tr><td> +<pre class="variable"> +2 </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="TIME"></a> +<h3>TIME</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00955840>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00955840>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00955840> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="TIMEARRAY"></a> +<h3>TIMEARRAY</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00955B00>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00955B00>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00955B00> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="UNICODE"></a> +<h3>UNICODE</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x009556C0>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x009556C0>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x009556C0> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="UNICODEARRAY"></a> +<h3>UNICODEARRAY</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>type</code> + + </dd> + <dt title="<psycopg2._psycopg.type object at 0x00955A40>">Value:</dt> + <dd title="<psycopg2._psycopg.type object at 0x00955A40>"><table><tr><td> +<pre class="variable"> +<psycopg2._psycopg.type object at 0x00955A40> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Fri Jan 13 10:57:06 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/public/psycopg2.extensions-module.html b/psycopg2/doc/api/public/psycopg2.extensions-module.html new file mode 100644 index 00000000..4e974489 --- /dev/null +++ b/psycopg2/doc/api/public/psycopg2.extensions-module.html @@ -0,0 +1,418 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.extensions</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + Module extensions + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<a href="../private/psycopg2.extensions-module.html">show private</a> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.extensions-module.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF MODULE DESCRIPTION =========== --> +<h2 class="module">Module psycopg2.extensions</h2> + +<p>psycopg extensions to the DBAPI-2.0</p> +<p>This module holds all the extensions to the DBAPI-2.0 provided by psycopg.</p> +<ul class="rst-simple"> +<li><a href="../private/psycopg2._psycopg.connection-class.html" class="link"><code>connection</code></a> -- the new-type inheritable connection class</li> +<li><a href="../private/psycopg2._psycopg.cursor-class.html" class="link"><code>cursor</code></a> -- the new-type inheritable cursor class</li> +<li><a href="psycopg2.extensions-module.html#adapt" class="link"><code>adapt()</code></a> -- exposes the <a class="reference" href="http://www.python.org/peps/pep-0246.html">PEP-246</a> compatible adapting mechanism used +by psycopg to adapt Python types to PostgreSQL ones</li> +</ul> +<hr/> + +<!-- =========== START OF FUNCTION SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Function Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">object</td> + <td><code><span class="summary-sig"><a href="psycopg2.extensions-module.html#adapt" class="summary-sig-name"><code>adapt</code></a>(<span class="summary-sig-arg">obj</span>, + <span class="summary-sig-arg">protocol</span>, + <span class="summary-sig-arg">alternate</span>)</span></code> +<br /> +adapt obj to given protocol</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">new AsIs wrapper object</td> + <td><code><a name="AsIs"></a><span class="summary-sig"><span class="summary-sig-name">AsIs</span>(<span class="summary-sig-arg">obj</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">new boolean value</td> + <td><code><a name="Boolean"></a><span class="summary-sig"><span class="summary-sig-name">Boolean</span>(<span class="summary-sig-arg">obj</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">new wrapper</td> + <td><code><a name="DateFromPy"></a><span class="summary-sig"><span class="summary-sig-name">DateFromPy</span>(<span class="summary-sig-arg">datetime.date</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">new wrapper</td> + <td><code><a name="IntervalFromPy"></a><span class="summary-sig"><span class="summary-sig-name">IntervalFromPy</span>(<span class="summary-sig-arg">datetime.timedelta</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">new type object</td> + <td><code><span class="summary-sig"><a href="psycopg2.extensions-module.html#new_type" class="summary-sig-name"><code>new_type</code></a>(<span class="summary-sig-arg">oids</span>, + <span class="summary-sig-arg">name</span>, + <span class="summary-sig-arg">adapter</span>)</span></code> +<br /> +Create a new binding object.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">new quoted string</td> + <td><code><a name="QuotedString"></a><span class="summary-sig"><span class="summary-sig-name">QuotedString</span>(<span class="summary-sig-arg">str</span>, + <span class="summary-sig-arg">enc</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="psycopg2.extensions-module.html#register_adapter" class="summary-sig-name"><code>register_adapter</code></a>(<span class="summary-sig-arg">typ</span>, + <span class="summary-sig-arg">callable</span>)</span></code> +<br /> +Register 'callable' as an ISQLQuote adapter for type 'typ'.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">None</td> + <td><code><span class="summary-sig"><a href="psycopg2.extensions-module.html#register_type" class="summary-sig-name"><code>register_type</code></a>(<span class="summary-sig-arg">obj</span>)</span></code> +<br /> +register obj with psycopg type system</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">new wrapper</td> + <td><code><a name="TimeFromPy"></a><span class="summary-sig"><span class="summary-sig-name">TimeFromPy</span>(<span class="summary-sig-arg">datetime.time</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">new wrapper</td> + <td><code><a name="TimestampFromPy"></a><span class="summary-sig"><span class="summary-sig-name">TimestampFromPy</span>(<span class="summary-sig-arg">datetime.datetime</span>)</span></code> +</td></tr> +</table><br /> + + +<!-- =========== START OF VARIABLE SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Variable Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>int</code></td> +<td><strong><a href="psycopg2.extensions-module.html#ISOLATION_LEVEL_AUTOCOMMIT"><code>ISOLATION_LEVEL_AUTOCOMMIT</code></a></strong> = <span title="0">0 </span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>int</code></td> +<td><strong><a href="psycopg2.extensions-module.html#ISOLATION_LEVEL_READ_COMMITTED"><code>ISOLATION_LEVEL_READ_COMMITTED</code></a></strong> = <span title="1">1 </span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>int</code></td> +<td><strong><a href="psycopg2.extensions-module.html#ISOLATION_LEVEL_READ_UNCOMMITTED"><code>ISOLATION_LEVEL_READ_UNCOMMITTED</code></a></strong> = <span title="1">1 </span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>int</code></td> +<td><strong><a href="psycopg2.extensions-module.html#ISOLATION_LEVEL_REPEATABLE_READ"><code>ISOLATION_LEVEL_REPEATABLE_READ</code></a></strong> = <span title="2">2 </span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>int</code></td> +<td><strong><a href="psycopg2.extensions-module.html#ISOLATION_LEVEL_SERIALIZABLE"><code>ISOLATION_LEVEL_SERIALIZABLE</code></a></strong> = <span title="2">2 </span></td></tr> +</table><br /> + + +<!-- =========== START OF FUNCTION DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Function Details</th></tr> +</table> + +<a name="adapt"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">adapt</span>(<span class="sig-arg">obj</span>, + <span class="sig-arg">protocol</span>, + <span class="sig-arg">alternate</span>)</span> + </h3> +<p>adapt obj to given protocol</p> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +object </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="AsIs"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">AsIs</span>(<span class="sig-arg">obj</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +new AsIs wrapper object </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="Boolean"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">Boolean</span>(<span class="sig-arg">obj</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +new boolean value </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="DateFromPy"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">DateFromPy</span>(<span class="sig-arg">datetime.date</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +new wrapper </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="IntervalFromPy"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">IntervalFromPy</span>(<span class="sig-arg">datetime.timedelta</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +new wrapper </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="new_type"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">new_type</span>(<span class="sig-arg">oids</span>, + <span class="sig-arg">name</span>, + <span class="sig-arg">adapter</span>)</span> + </h3> +<p>Create a new binding object. The object can be used with the +<a href="psycopg2.extensions-module.html#register_type" class="link"><code>register_type()</code></a> function to bind PostgreSQL objects to python objects.</p> + <dl><dt></dt><dd> + <dl><dt>Parameters:</dt> + <dd><code><strong class="pname">oids</strong></code> - + Tuple of <tt class="docutils literal"><span class="pre">oid</span></tt> of the PostgreSQL types to convert. + </dd> + <dd><code><strong class="pname">name</strong></code> - + Name for the new type + </dd> + <dd><code><strong class="pname">adapter</strong></code> - + Callable to perform type conversion. +It must have the signature <tt class="docutils literal"><span class="pre">fun(value,</span> <span class="pre">cur)</span></tt> where <tt class="docutils literal"><span class="pre">value</span></tt> is +the string representation returned by PostgreSQL (<code>None</code> if <tt class="docutils literal"><span class="pre">NULL</span></tt>) +and <tt class="docutils literal"><span class="pre">cur</span></tt> is the cursor from which data are read. + </dd> + </dl> + <dl><dt>Returns:</dt> + <dd> +new type object </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="QuotedString"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">QuotedString</span>(<span class="sig-arg">str</span>, + <span class="sig-arg">enc</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +new quoted string </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="register_adapter"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">register_adapter</span>(<span class="sig-arg">typ</span>, + <span class="sig-arg">callable</span>)</span> + </h3> +<p>Register 'callable' as an ISQLQuote adapter for type 'typ'.</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="register_type"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">register_type</span>(<span class="sig-arg">obj</span>)</span> + </h3> +<p>register obj with psycopg type system</p> + <dl><dt></dt><dd> + <dl><dt>Parameters:</dt> + <dd><code><strong class="pname">obj</strong></code> - + A type adapter created by <a href="psycopg2.extensions-module.html#new_type" class="link"><code>new_type()</code></a> + </dd> + </dl> + <dl><dt>Returns:</dt> + <dd> +None </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="TimeFromPy"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">TimeFromPy</span>(<span class="sig-arg">datetime.time</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +new wrapper </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="TimestampFromPy"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">TimestampFromPy</span>(<span class="sig-arg">datetime.datetime</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +new wrapper </dd> + </dl> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF VARIABLE DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Variable Details</th></tr> +</table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="ISOLATION_LEVEL_AUTOCOMMIT"></a> +<h3>ISOLATION_LEVEL_AUTOCOMMIT</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>int</code> + + </dd> + <dt title="0">Value:</dt> + <dd title="0"><table><tr><td> +<pre class="variable"> +0 </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="ISOLATION_LEVEL_READ_COMMITTED"></a> +<h3>ISOLATION_LEVEL_READ_COMMITTED</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>int</code> + + </dd> + <dt title="1">Value:</dt> + <dd title="1"><table><tr><td> +<pre class="variable"> +1 </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="ISOLATION_LEVEL_READ_UNCOMMITTED"></a> +<h3>ISOLATION_LEVEL_READ_UNCOMMITTED</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>int</code> + + </dd> + <dt title="1">Value:</dt> + <dd title="1"><table><tr><td> +<pre class="variable"> +1 </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="ISOLATION_LEVEL_REPEATABLE_READ"></a> +<h3>ISOLATION_LEVEL_REPEATABLE_READ</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>int</code> + + </dd> + <dt title="2">Value:</dt> + <dd title="2"><table><tr><td> +<pre class="variable"> +2 </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="ISOLATION_LEVEL_SERIALIZABLE"></a> +<h3>ISOLATION_LEVEL_SERIALIZABLE</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>int</code> + + </dd> + <dt title="2">Value:</dt> + <dd title="2"><table><tr><td> +<pre class="variable"> +2 </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:32 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/public/psycopg2.extras-module.html b/psycopg2/doc/api/public/psycopg2.extras-module.html new file mode 100644 index 00000000..c99a0ce6 --- /dev/null +++ b/psycopg2/doc/api/public/psycopg2.extras-module.html @@ -0,0 +1,91 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.extras</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + Module extras + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<a href="../private/psycopg2.extras-module.html">show private</a> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.extras-module.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF MODULE DESCRIPTION =========== --> +<h2 class="module">Module psycopg2.extras</h2> + +<p>Miscellaneous goodies for psycopg2</p> +<p>This module is a generic place used to hold little helper functions +and classes untill a better place in the distribution is found.</p> +<hr/> + +<!-- =========== START OF CLASSES =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Classes</th></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.extras.DictConnection-class.html"><code>DictConnection</code></a></strong></td> + <td>A connection that uses DictCursor automatically.</td></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.extras.DictCursor-class.html"><code>DictCursor</code></a></strong></td> + <td>A cursor that keeps a list of column name -> index mappings.</td></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.extras.DictRow-class.html"><code>DictRow</code></a></strong></td> + <td>A row object that allow by-colun-name access to data.</td></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.extras.SQL_IN-class.html"><code>SQL_IN</code></a></strong></td> + <td>Adapt any iterable to an SQL quotable object.</td></tr> +</table><br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:32 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/public/psycopg2.extras.DictConnection-class.html b/psycopg2/doc/api/public/psycopg2.extras.DictConnection-class.html new file mode 100644 index 00000000..988bd797 --- /dev/null +++ b/psycopg2/doc/api/public/psycopg2.extras.DictConnection-class.html @@ -0,0 +1,137 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.extras.DictConnection</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + <a href="psycopg2.extras-module.html">Module extras</a> :: + Class DictConnection + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<a href="../private/psycopg2.extras.DictConnection-class.html">show private</a> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.extras.DictConnection-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Type DictConnection</h2> + +<pre class="base-tree"> +<a href="__builtin__.object-class.html"><code>object</code></a> --+ + | +<a href="../private/psycopg2._psycopg.connection-class.html"><code>connection</code></a> --+ + | + <strong class="uidshort">DictConnection</strong> +</pre><br /> + +<hr/> + +<p>A connection that uses DictCursor automatically.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="cursor"></a><span class="summary-sig"><span class="summary-sig-name">cursor</span>(<span class="summary-sig-arg">self</span>)</span></code> +</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from object</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__delattr__('name') <==> del x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__getattribute__('name') <==> x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return hash(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__setattr__('name', value) <==> x.name = value</td></tr> +</table><br /> + + +<!-- =========== START OF METHOD DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Method Details</th></tr> +</table> + +<a name="cursor"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">cursor</span>(<span class="sig-arg">self</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="../private/psycopg2._psycopg.connection-class.html#cursor"><code>psycopg2._psycopg.connection.cursor</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:31 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/public/psycopg2.extras.DictCursor-class.html b/psycopg2/doc/api/public/psycopg2.extras.DictCursor-class.html new file mode 100644 index 00000000..d546d3aa --- /dev/null +++ b/psycopg2/doc/api/public/psycopg2.extras.DictCursor-class.html @@ -0,0 +1,205 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.extras.DictCursor</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + <a href="psycopg2.extras-module.html">Module extras</a> :: + Class DictCursor + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<a href="../private/psycopg2.extras.DictCursor-class.html">show private</a> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.extras.DictCursor-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Type DictCursor</h2> + +<pre class="base-tree"> +<a href="__builtin__.object-class.html"><code>object</code></a> --+ + | + <a href="../private/psycopg2._psycopg.cursor-class.html"><code>cursor</code></a> --+ + | + <strong class="uidshort">DictCursor</strong> +</pre><br /> + +<hr/> + +<p>A cursor that keeps a list of column name -> index mappings.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="callproc"></a><span class="summary-sig"><span class="summary-sig-name">callproc</span>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">procname</span>, + <span class="summary-sig-arg">vars</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="execute"></a><span class="summary-sig"><span class="summary-sig-name">execute</span>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">query</span>, + <span class="summary-sig-arg">vars</span>, + <span class="summary-sig-arg">async</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="fetchall"></a><span class="summary-sig"><span class="summary-sig-name">fetchall</span>(<span class="summary-sig-arg">self</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="fetchmany"></a><span class="summary-sig"><span class="summary-sig-name">fetchmany</span>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">size</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="fetchone"></a><span class="summary-sig"><span class="summary-sig-name">fetchone</span>(<span class="summary-sig-arg">self</span>)</span></code> +</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from object</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__delattr__('name') <==> del x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__getattribute__('name') <==> x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return hash(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__setattr__('name', value) <==> x.name = value</td></tr> +</table><br /> + + +<!-- =========== START OF METHOD DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Method Details</th></tr> +</table> + +<a name="callproc"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">callproc</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">procname</span>, + <span class="sig-arg">vars</span>=<span class="sig-default">None</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="../private/psycopg2._psycopg.cursor-class.html#callproc"><code>psycopg2._psycopg.cursor.callproc</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="execute"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">execute</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">query</span>, + <span class="sig-arg">vars</span>=<span class="sig-default">None</span>, + <span class="sig-arg">async</span>=<span class="sig-default">0</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="../private/psycopg2._psycopg.cursor-class.html#execute"><code>psycopg2._psycopg.cursor.execute</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="fetchall"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">fetchall</span>(<span class="sig-arg">self</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="../private/psycopg2._psycopg.cursor-class.html#fetchall"><code>psycopg2._psycopg.cursor.fetchall</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="fetchmany"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">fetchmany</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">size</span>=<span class="sig-default">None</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="../private/psycopg2._psycopg.cursor-class.html#fetchmany"><code>psycopg2._psycopg.cursor.fetchmany</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="fetchone"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">fetchone</span>(<span class="sig-arg">self</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="../private/psycopg2._psycopg.cursor-class.html#fetchone"><code>psycopg2._psycopg.cursor.fetchone</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:32 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/public/psycopg2.extras.DictRow-class.html b/psycopg2/doc/api/public/psycopg2.extras.DictRow-class.html new file mode 100644 index 00000000..e278ca3b --- /dev/null +++ b/psycopg2/doc/api/public/psycopg2.extras.DictRow-class.html @@ -0,0 +1,376 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.extras.DictRow</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + <a href="psycopg2.extras-module.html">Module extras</a> :: + Class DictRow + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<a href="../private/psycopg2.extras.DictRow-class.html">show private</a> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.extras.DictRow-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Type DictRow</h2> + +<pre class="base-tree"> +<a href="__builtin__.object-class.html"><code>object</code></a> --+ + | + <a href="__builtin__.list-class.html"><code>list</code></a> --+ + | + <strong class="uidshort">DictRow</strong> +</pre><br /> + +<hr/> + +<p>A row object that allow by-colun-name access to data.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__init__"></a><span class="summary-sig"><span class="summary-sig-name">__init__</span>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">cursor</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__getitem__"></a><span class="summary-sig"><span class="summary-sig-name">__getitem__</span>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">x</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="get"></a><span class="summary-sig"><span class="summary-sig-name">get</span>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">default</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="has_key"></a><span class="summary-sig"><span class="summary-sig-name">has_key</span>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">x</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="items"></a><span class="summary-sig"><span class="summary-sig-name">items</span>(<span class="summary-sig-arg">self</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="keys"></a><span class="summary-sig"><span class="summary-sig-name">keys</span>(<span class="summary-sig-arg">self</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="values"></a><span class="summary-sig"><span class="summary-sig-name">values</span>(<span class="summary-sig-arg">self</span>)</span></code> +</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from list</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__add__" class="summary-sig-name"><code>__add__</code></a>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return x+y...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__contains__" class="summary-sig-name"><code>__contains__</code></a>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return y in x...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__delitem__" class="summary-sig-name"><code>__delitem__</code></a>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return del x[y]...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__delslice__" class="summary-sig-name"><code>__delslice__</code></a>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">i</span>, + <span class="summary-sig-arg">j</span>)</span></code> +<br /> +Use of negative indices is not supported.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__eq__" class="summary-sig-name"><code>__eq__</code></a>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return x==y...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__ge__" class="summary-sig-name"><code>__ge__</code></a>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return x>=y...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__getattribute__('name') <==> x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__getslice__" class="summary-sig-name"><code>__getslice__</code></a>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">i</span>, + <span class="summary-sig-arg">j</span>)</span></code> +<br /> +Use of negative indices is not supported.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__gt__" class="summary-sig-name"><code>__gt__</code></a>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return x>y...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return hash(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__iadd__" class="summary-sig-name"><code>__iadd__</code></a>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return x+=y...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__imul__" class="summary-sig-name"><code>__imul__</code></a>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return x*=y...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__iter__" class="summary-sig-name"><code>__iter__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return iter(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__le__" class="summary-sig-name"><code>__le__</code></a>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return x<=y...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__len__" class="summary-sig-name"><code>__len__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return len(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__lt__" class="summary-sig-name"><code>__lt__</code></a>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return x<y...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__mul__" class="summary-sig-name"><code>__mul__</code></a>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">n</span>)</span></code> +<br /> +Return x*n...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__ne__" class="summary-sig-name"><code>__ne__</code></a>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return x!=y...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__new__" class="summary-sig-name"><code>__new__</code></a>(<span class="summary-sig-arg">T</span>, + <span class="summary-sig-arg">S</span>, + <span class="summary-sig-vararg">...</span>)</span></code> +<br /> +Return a new object with type S, a subtype of T...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return repr(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__rmul__" class="summary-sig-name"><code>__rmul__</code></a>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">n</span>)</span></code> +<br /> +Return n*x...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__setitem__" class="summary-sig-name"><code>__setitem__</code></a>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">i</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Return x[i]=y...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#__setslice__" class="summary-sig-name"><code>__setslice__</code></a>(<span class="summary-sig-arg">x</span>, + <span class="summary-sig-arg">i</span>, + <span class="summary-sig-arg">j</span>, + <span class="summary-sig-arg">y</span>)</span></code> +<br /> +Use of negative indices is not supported.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#append" class="summary-sig-name"><code>append</code></a>(<span class="summary-sig-arg">L</span>, + <span class="summary-sig-arg">object</span>)</span></code> +<br /> +append object to end</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#count" class="summary-sig-name"><code>count</code></a>(<span class="summary-sig-arg">L</span>, + <span class="summary-sig-arg">value</span>)</span></code> +<br /> +return number of occurrences of value</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#extend" class="summary-sig-name"><code>extend</code></a>(<span class="summary-sig-arg">L</span>, + <span class="summary-sig-arg">iterable</span>)</span></code> +<br /> +extend list by appending elements from the iterable</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#index" class="summary-sig-name"><code>index</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +L.index(value, [start, [stop]]) -> integer -- return first index of value</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#insert" class="summary-sig-name"><code>insert</code></a>(<span class="summary-sig-arg">L</span>, + <span class="summary-sig-arg">index</span>, + <span class="summary-sig-arg">object</span>)</span></code> +<br /> +insert object before index</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#pop" class="summary-sig-name"><code>pop</code></a>(<span class="summary-sig-arg">L</span>, + <span class="summary-sig-arg">index</span>)</span></code> +<br /> +remove and return item at index (default last)</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#remove" class="summary-sig-name"><code>remove</code></a>(<span class="summary-sig-arg">L</span>, + <span class="summary-sig-arg">value</span>)</span></code> +<br /> +remove first occurrence of value</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#reverse" class="summary-sig-name"><code>reverse</code></a>(<span class="summary-sig-arg">L</span>)</span></code> +<br /> +reverse <em>IN PLACE</em></td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.list-class.html#sort" class="summary-sig-name"><code>sort</code></a>(<span class="summary-sig-arg">L</span>, + <span class="summary-sig-arg">cmpfunc</span>)</span></code> +<br /> +stable sort <em>IN PLACE</em>; cmpfunc(x, y) -> -1, 0, 1</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from object</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__delattr__('name') <==> del x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__setattr__('name', value) <==> x.name = value</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return str(x)...</td></tr> +</table><br /> + + +<!-- =========== START OF METHOD DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Method Details</th></tr> +</table> + +<a name="__init__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">cursor</span>)</span> + <br /><em class="fname">(Constructor)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.list-class.html#__init__"><code>__builtin__.list.__init__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="__getitem__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__getitem__</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">x</span>)</span> + <br /><em class="fname">(Indexing operator)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.list-class.html#__getitem__"><code>__builtin__.list.__getitem__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="get"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">get</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">x</span>, + <span class="sig-arg">default</span>=<span class="sig-default">None</span>)</span> + </h3> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="has_key"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">has_key</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">x</span>)</span> + </h3> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="items"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">items</span>(<span class="sig-arg">self</span>)</span> + </h3> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="keys"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">keys</span>(<span class="sig-arg">self</span>)</span> + </h3> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="values"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">values</span>(<span class="sig-arg">self</span>)</span> + </h3> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/public/psycopg2.extras.SQL_IN-class.html b/psycopg2/doc/api/public/psycopg2.extras.SQL_IN-class.html new file mode 100644 index 00000000..0b05cd22 --- /dev/null +++ b/psycopg2/doc/api/public/psycopg2.extras.SQL_IN-class.html @@ -0,0 +1,171 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.extras.SQL_IN</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + <a href="psycopg2.extras-module.html">Module extras</a> :: + Class SQL_IN + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<a href="../private/psycopg2.extras.SQL_IN-class.html">show private</a> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.extras.SQL_IN-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Type SQL_IN</h2> + +<pre class="base-tree"> +<a href="__builtin__.object-class.html"><code>object</code></a> --+ + | + <strong class="uidshort">SQL_IN</strong> +</pre><br /> + +<hr/> + +<p>Adapt any iterable to an SQL quotable object.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__init__"></a><span class="summary-sig"><span class="summary-sig-name">__init__</span>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">seq</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="getquoted"></a><span class="summary-sig"><span class="summary-sig-name">__str__</span>(<span class="summary-sig-arg">self</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="getquoted"></a><span class="summary-sig"><span class="summary-sig-name">getquoted</span>(<span class="summary-sig-arg">self</span>)</span></code> +</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from object</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__delattr__('name') <==> del x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__getattribute__('name') <==> x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return hash(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__new__" class="summary-sig-name"><code>__new__</code></a>(<span class="summary-sig-arg">T</span>, + <span class="summary-sig-arg">S</span>, + <span class="summary-sig-vararg">...</span>)</span></code> +<br /> +Return a new object with type S, a subtype of T...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return repr(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__setattr__('name', value) <==> x.name = value</td></tr> +</table><br /> + + +<!-- =========== START OF METHOD DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Method Details</th></tr> +</table> + +<a name="__init__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">seq</span>)</span> + <br /><em class="fname">(Constructor)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__init__"><code>__builtin__.object.__init__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="getquoted"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__str__</span>(<span class="sig-arg">self</span>)</span> + <br /><em class="fname">(Informal representation operator)</em> + </h3> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="getquoted"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">getquoted</span>(<span class="sig-arg">self</span>)</span> + </h3> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:35 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/public/psycopg2.pool-module.html b/psycopg2/doc/api/public/psycopg2.pool-module.html new file mode 100644 index 00000000..34fbebde --- /dev/null +++ b/psycopg2/doc/api/public/psycopg2.pool-module.html @@ -0,0 +1,126 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.pool</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + Module pool + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<a href="../private/psycopg2.pool-module.html">show private</a> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.pool-module.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF MODULE DESCRIPTION =========== --> +<h2 class="module">Module psycopg2.pool</h2> + +<p>Connection pooling for psycopg2</p> +<p>This module implements thread-safe (and not) connection pools.</p> +<hr/> + +<!-- =========== START OF CLASSES =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Classes</th></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.pool.AbstractConnectionPool-class.html"><code>AbstractConnectionPool</code></a></strong></td> + <td>Generic key-based pooling code.</td></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.pool.PersistentConnectionPool-class.html"><code>PersistentConnectionPool</code></a></strong></td> + <td>A pool that assigns persistent connections to different threads.</td></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.pool.SimpleConnectionPool-class.html"><code>SimpleConnectionPool</code></a></strong></td> + <td>A connection pool that can't be shared across different threads.</td></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.pool.ThreadedConnectionPool-class.html"><code>ThreadedConnectionPool</code></a></strong></td> + <td>A connection pool that works with the threading module.</td></tr> +</table><br /> + + +<!-- =========== START OF EXCEPTIONS =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Exceptions</th></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.pool.PoolError-class.html"><code>PoolError</code></a></strong></td> + <td> </td></tr> +</table><br /> + + +<!-- =========== START OF FUNCTION SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Function Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="dbg"></a><span class="summary-sig"><span class="summary-sig-name">dbg</span>(<span class="summary-sig-vararg">*args</span>)</span></code> +</td></tr> +</table><br /> + + +<!-- =========== START OF FUNCTION DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Function Details</th></tr> +</table> + +<a name="dbg"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">dbg</span>(<span class="sig-vararg">*args</span>)</span> + </h3> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:34 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/public/psycopg2.pool.AbstractConnectionPool-class.html b/psycopg2/doc/api/public/psycopg2.pool.AbstractConnectionPool-class.html new file mode 100644 index 00000000..41d63b91 --- /dev/null +++ b/psycopg2/doc/api/public/psycopg2.pool.AbstractConnectionPool-class.html @@ -0,0 +1,169 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.pool.AbstractConnectionPool</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + <a href="psycopg2.pool-module.html">Module pool</a> :: + Class AbstractConnectionPool + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<a href="../private/psycopg2.pool.AbstractConnectionPool-class.html">show private</a> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.pool.AbstractConnectionPool-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Type AbstractConnectionPool</h2> + +<pre class="base-tree"> +<a href="__builtin__.object-class.html"><code>object</code></a> --+ + | + <strong class="uidshort">AbstractConnectionPool</strong> +</pre><br /> + +<dl><dt>Known Subclasses:</dt> +<dd> + <a href="psycopg2.pool.PersistentConnectionPool-class.html"><code>PersistentConnectionPool</code></a>, + <a href="psycopg2.pool.SimpleConnectionPool-class.html"><code>SimpleConnectionPool</code></a>, + <a href="psycopg2.pool.ThreadedConnectionPool-class.html"><code>ThreadedConnectionPool</code></a></dd></dl> + +<hr/> + +<p>Generic key-based pooling code.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="psycopg2.pool.AbstractConnectionPool-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">minconn</span>, + <span class="summary-sig-arg">maxconn</span>, + <span class="summary-sig-vararg">*args</span>, + <span class="summary-sig-kwarg">**kwargs</span>)</span></code> +<br /> +Initialize the connection pool.</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from object</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__delattr__('name') <==> del x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__getattribute__('name') <==> x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return hash(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__new__" class="summary-sig-name"><code>__new__</code></a>(<span class="summary-sig-arg">T</span>, + <span class="summary-sig-arg">S</span>, + <span class="summary-sig-vararg">...</span>)</span></code> +<br /> +Return a new object with type S, a subtype of T...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return repr(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__setattr__('name', value) <==> x.name = value</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return str(x)...</td></tr> +</table><br /> + + +<!-- =========== START OF METHOD DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Method Details</th></tr> +</table> + +<a name="__init__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">minconn</span>, + <span class="sig-arg">maxconn</span>, + <span class="sig-vararg">*args</span>, + <span class="sig-kwarg">**kwargs</span>)</span> + <br /><em class="fname">(Constructor)</em> + </h3> +<p>Initialize the connection pool.</p> +<p>New 'minconn' connections are created immediately calling 'connfunc' +with given parameters. The connection pool will support a maximum of +about 'maxconn' connections.</p> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__init__"><code>__builtin__.object.__init__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:34 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/public/psycopg2.pool.PersistentConnectionPool-class.html b/psycopg2/doc/api/public/psycopg2.pool.PersistentConnectionPool-class.html new file mode 100644 index 00000000..954b8b53 --- /dev/null +++ b/psycopg2/doc/api/public/psycopg2.pool.PersistentConnectionPool-class.html @@ -0,0 +1,210 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.pool.PersistentConnectionPool</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + <a href="psycopg2.pool-module.html">Module pool</a> :: + Class PersistentConnectionPool + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<a href="../private/psycopg2.pool.PersistentConnectionPool-class.html">show private</a> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.pool.PersistentConnectionPool-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Type PersistentConnectionPool</h2> + +<pre class="base-tree"> + <a href="__builtin__.object-class.html"><code>object</code></a> --+ + | +<a href="psycopg2.pool.AbstractConnectionPool-class.html"><code>AbstractConnectionPool</code></a> --+ + | + <strong class="uidshort">PersistentConnectionPool</strong> +</pre><br /> + +<hr/> + +<p>A pool that assigns persistent connections to different threads.</p> +<p>Note that this connection pool generates by itself the required keys +using the current thread id. This means that untill a thread put away +a connection it will always get the same connection object by successive +.getconn() calls. This also means that a thread can't use more than one +single connection from the pool.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="psycopg2.pool.PersistentConnectionPool-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">minconn</span>, + <span class="summary-sig-arg">maxconn</span>, + <span class="summary-sig-vararg">*args</span>, + <span class="summary-sig-kwarg">**kwargs</span>)</span></code> +<br /> +Initialize the threading lock.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="psycopg2.pool.PersistentConnectionPool-class.html#closeall" class="summary-sig-name"><code>closeall</code></a>(<span class="summary-sig-arg">self</span>)</span></code> +<br /> +Close all connections (even the one currently in use.)</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="psycopg2.pool.PersistentConnectionPool-class.html#getconn" class="summary-sig-name"><code>getconn</code></a>(<span class="summary-sig-arg">self</span>)</span></code> +<br /> +Generate thread id and return a connection.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="psycopg2.pool.PersistentConnectionPool-class.html#putconn" class="summary-sig-name"><code>putconn</code></a>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">conn</span>, + <span class="summary-sig-arg">close</span>)</span></code> +<br /> +Put away an unused connection.</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from object</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__delattr__('name') <==> del x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__getattribute__('name') <==> x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return hash(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__new__" class="summary-sig-name"><code>__new__</code></a>(<span class="summary-sig-arg">T</span>, + <span class="summary-sig-arg">S</span>, + <span class="summary-sig-vararg">...</span>)</span></code> +<br /> +Return a new object with type S, a subtype of T...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return repr(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__setattr__('name', value) <==> x.name = value</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return str(x)...</td></tr> +</table><br /> + + +<!-- =========== START OF METHOD DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Method Details</th></tr> +</table> + +<a name="__init__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">minconn</span>, + <span class="sig-arg">maxconn</span>, + <span class="sig-vararg">*args</span>, + <span class="sig-kwarg">**kwargs</span>)</span> + <br /><em class="fname">(Constructor)</em> + </h3> +<p>Initialize the threading lock.</p> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="psycopg2.pool.AbstractConnectionPool-class.html#__init__"><code>psycopg2.pool.AbstractConnectionPool.__init__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="closeall"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">closeall</span>(<span class="sig-arg">self</span>)</span> + </h3> +<p>Close all connections (even the one currently in use.)</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="getconn"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">getconn</span>(<span class="sig-arg">self</span>)</span> + </h3> +<p>Generate thread id and return a connection.</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="putconn"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">putconn</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">conn</span>=<span class="sig-default">None</span>, + <span class="sig-arg">close</span>=<span class="sig-default">False</span>)</span> + </h3> +<p>Put away an unused connection.</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:34 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/public/psycopg2.pool.PoolError-class.html b/psycopg2/doc/api/public/psycopg2.pool.PoolError-class.html new file mode 100644 index 00000000..89cd4f73 --- /dev/null +++ b/psycopg2/doc/api/public/psycopg2.pool.PoolError-class.html @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.pool.PoolError</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + <a href="psycopg2.pool-module.html">Module pool</a> :: + Class PoolError + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<a href="../private/psycopg2.pool.PoolError-class.html">show private</a> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.pool.PoolError-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Class PoolError</h2> + +<pre class="base-tree"> +<a href="exceptions.Exception-class.html"><code>Exception</code></a> --+ + | +<a href="exceptions.StandardError-class.html"><code>StandardError</code></a> --+ + | + <a href="psycopg2.Error-class.html"><code>Error</code></a> --+ + | + <strong class="uidshort">PoolError</strong> +</pre><br /> + +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from Exception</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__getitem__" class="summary-sig-name"><code>__getitem__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="exceptions.Exception-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +</table><br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:34 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/public/psycopg2.pool.SimpleConnectionPool-class.html b/psycopg2/doc/api/public/psycopg2.pool.SimpleConnectionPool-class.html new file mode 100644 index 00000000..ea8f605f --- /dev/null +++ b/psycopg2/doc/api/public/psycopg2.pool.SimpleConnectionPool-class.html @@ -0,0 +1,139 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.pool.SimpleConnectionPool</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + <a href="psycopg2.pool-module.html">Module pool</a> :: + Class SimpleConnectionPool + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<a href="../private/psycopg2.pool.SimpleConnectionPool-class.html">show private</a> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.pool.SimpleConnectionPool-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Type SimpleConnectionPool</h2> + +<pre class="base-tree"> + <a href="__builtin__.object-class.html"><code>object</code></a> --+ + | +<a href="psycopg2.pool.AbstractConnectionPool-class.html"><code>AbstractConnectionPool</code></a> --+ + | + <strong class="uidshort">SimpleConnectionPool</strong> +</pre><br /> + +<hr/> + +<p>A connection pool that can't be shared across different threads.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from AbstractConnectionPool</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="psycopg2.pool.AbstractConnectionPool-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">minconn</span>, + <span class="summary-sig-arg">maxconn</span>, + <span class="summary-sig-vararg">*args</span>, + <span class="summary-sig-kwarg">**kwargs</span>)</span></code> +<br /> +Initialize the connection pool.</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from object</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__delattr__('name') <==> del x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__getattribute__('name') <==> x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return hash(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__new__" class="summary-sig-name"><code>__new__</code></a>(<span class="summary-sig-arg">T</span>, + <span class="summary-sig-arg">S</span>, + <span class="summary-sig-vararg">...</span>)</span></code> +<br /> +Return a new object with type S, a subtype of T...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return repr(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__setattr__('name', value) <==> x.name = value</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return str(x)...</td></tr> +</table><br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:35 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/public/psycopg2.pool.ThreadedConnectionPool-class.html b/psycopg2/doc/api/public/psycopg2.pool.ThreadedConnectionPool-class.html new file mode 100644 index 00000000..64c95a95 --- /dev/null +++ b/psycopg2/doc/api/public/psycopg2.pool.ThreadedConnectionPool-class.html @@ -0,0 +1,209 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.pool.ThreadedConnectionPool</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + <a href="psycopg2.pool-module.html">Module pool</a> :: + Class ThreadedConnectionPool + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<a href="../private/psycopg2.pool.ThreadedConnectionPool-class.html">show private</a> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.pool.ThreadedConnectionPool-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Type ThreadedConnectionPool</h2> + +<pre class="base-tree"> + <a href="__builtin__.object-class.html"><code>object</code></a> --+ + | +<a href="psycopg2.pool.AbstractConnectionPool-class.html"><code>AbstractConnectionPool</code></a> --+ + | + <strong class="uidshort">ThreadedConnectionPool</strong> +</pre><br /> + +<hr/> + +<p>A connection pool that works with the threading module.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="psycopg2.pool.ThreadedConnectionPool-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">minconn</span>, + <span class="summary-sig-arg">maxconn</span>, + <span class="summary-sig-vararg">*args</span>, + <span class="summary-sig-kwarg">**kwargs</span>)</span></code> +<br /> +Initialize the threading lock.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="psycopg2.pool.ThreadedConnectionPool-class.html#closeall" class="summary-sig-name"><code>closeall</code></a>(<span class="summary-sig-arg">self</span>)</span></code> +<br /> +Close all connections (even the one currently in use.)</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="psycopg2.pool.ThreadedConnectionPool-class.html#getconn" class="summary-sig-name"><code>getconn</code></a>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">key</span>)</span></code> +<br /> +Get a free connection and assign it to 'key' if not None.</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="psycopg2.pool.ThreadedConnectionPool-class.html#putconn" class="summary-sig-name"><code>putconn</code></a>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">conn</span>, + <span class="summary-sig-arg">key</span>, + <span class="summary-sig-arg">close</span>)</span></code> +<br /> +Put away an unused connection.</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from object</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__delattr__('name') <==> del x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__getattribute__('name') <==> x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return hash(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__new__" class="summary-sig-name"><code>__new__</code></a>(<span class="summary-sig-arg">T</span>, + <span class="summary-sig-arg">S</span>, + <span class="summary-sig-vararg">...</span>)</span></code> +<br /> +Return a new object with type S, a subtype of T...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return repr(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__setattr__('name', value) <==> x.name = value</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return str(x)...</td></tr> +</table><br /> + + +<!-- =========== START OF METHOD DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Method Details</th></tr> +</table> + +<a name="__init__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">minconn</span>, + <span class="sig-arg">maxconn</span>, + <span class="sig-vararg">*args</span>, + <span class="sig-kwarg">**kwargs</span>)</span> + <br /><em class="fname">(Constructor)</em> + </h3> +<p>Initialize the threading lock.</p> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="psycopg2.pool.AbstractConnectionPool-class.html#__init__"><code>psycopg2.pool.AbstractConnectionPool.__init__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="closeall"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">closeall</span>(<span class="sig-arg">self</span>)</span> + </h3> +<p>Close all connections (even the one currently in use.)</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="getconn"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">getconn</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">key</span>=<span class="sig-default">None</span>)</span> + </h3> +<p>Get a free connection and assign it to 'key' if not None.</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="putconn"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">putconn</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">conn</span>=<span class="sig-default">None</span>, + <span class="sig-arg">key</span>=<span class="sig-default">None</span>, + <span class="sig-arg">close</span>=<span class="sig-default">False</span>)</span> + </h3> +<p>Put away an unused connection.</p> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:35 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/public/psycopg2.psycopg1-module.html b/psycopg2/doc/api/public/psycopg2.psycopg1-module.html new file mode 100644 index 00000000..18a9a751 --- /dev/null +++ b/psycopg2/doc/api/public/psycopg2.psycopg1-module.html @@ -0,0 +1,121 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.psycopg1</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + Module psycopg1 + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<a href="../private/psycopg2.psycopg1-module.html">show private</a> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.psycopg1-module.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF MODULE DESCRIPTION =========== --> +<h2 class="module">Module psycopg2.psycopg1</h2> + +<p>psycopg 1.1.x compatibility module</p> +<p>This module uses the new style connection and cursor types to build a psycopg +1.1.1.x compatibility layer. It should be considered a temporary hack to run +old code while porting to psycopg 2. Import it as follows:</p> +<pre class="literal-block"> +from psycopg2 import psycopg1 as psycopg +</pre> +<hr/> + +<!-- =========== START OF CLASSES =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Classes</th></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.psycopg1.connection-class.html"><code>connection</code></a></strong></td> + <td>psycopg 1.1.x connection.</td></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.psycopg1.cursor-class.html"><code>cursor</code></a></strong></td> + <td>psycopg 1.1.x cursor.</td></tr> +</table><br /> + + +<!-- =========== START OF FUNCTION SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Function Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">new psycopg 1.1.x compatible connection object</td> + <td><code><a name="connect"></a><span class="summary-sig"><span class="summary-sig-name">connect</span>(<span class="summary-sig-arg">dsn</span>, + <span class="summary-sig-vararg">...</span>)</span></code> +</td></tr> +</table><br /> + + +<!-- =========== START OF FUNCTION DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Function Details</th></tr> +</table> + +<a name="connect"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">connect</span>(<span class="sig-arg">dsn</span>, + <span class="sig-vararg">...</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +new psycopg 1.1.x compatible connection object </dd> + </dl> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/public/psycopg2.psycopg1.connection-class.html b/psycopg2/doc/api/public/psycopg2.psycopg1.connection-class.html new file mode 100644 index 00000000..9b5b429f --- /dev/null +++ b/psycopg2/doc/api/public/psycopg2.psycopg1.connection-class.html @@ -0,0 +1,156 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.psycopg1.connection</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + <a href="psycopg2.psycopg1-module.html">Module psycopg1</a> :: + Class connection + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<a href="../private/psycopg2.psycopg1.connection-class.html">show private</a> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.psycopg1.connection-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Type connection</h2> + +<pre class="base-tree"> +<a href="__builtin__.object-class.html"><code>object</code></a> --+ + | +<a href="../private/psycopg2._psycopg.connection-class.html"><code>connection</code></a> --+ + | + <strong class="uidshort">connection</strong> +</pre><br /> + +<hr/> + +<p>psycopg 1.1.x connection.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">switch autocommit on (1) or off (0)</td> + <td><code><a name="autocommit"></a><span class="summary-sig"><span class="summary-sig-name">autocommit</span>(<span class="summary-sig-arg">on_off</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype">new psycopg 1.1.x compatible cursor object</td> + <td><code><a name="cursor"></a><span class="summary-sig"><span class="summary-sig-name">cursor</span>()</span></code> +</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from object</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__delattr__('name') <==> del x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__getattribute__('name') <==> x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return hash(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__setattr__('name', value) <==> x.name = value</td></tr> +</table><br /> + + +<!-- =========== START OF METHOD DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Method Details</th></tr> +</table> + +<a name="autocommit"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">autocommit</span>(<span class="sig-arg">on_off</span>=<span class="sig-default">1</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +switch autocommit on (1) or off (0) </dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="cursor"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">cursor</span>()</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Returns:</dt> + <dd> +new psycopg 1.1.x compatible cursor object </dd> + </dl> + <dl><dt>Overrides:</dt> + <dd><a href="../private/psycopg2._psycopg.connection-class.html#cursor"><code>psycopg2._psycopg.connection.cursor</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/public/psycopg2.psycopg1.cursor-class.html b/psycopg2/doc/api/public/psycopg2.psycopg1.cursor-class.html new file mode 100644 index 00000000..f80677d9 --- /dev/null +++ b/psycopg2/doc/api/public/psycopg2.psycopg1.cursor-class.html @@ -0,0 +1,161 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.psycopg1.cursor</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + <a href="psycopg2.psycopg1-module.html">Module psycopg1</a> :: + Class cursor + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<a href="../private/psycopg2.psycopg1.cursor-class.html">show private</a> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.psycopg1.cursor-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Type cursor</h2> + +<pre class="base-tree"> +<a href="__builtin__.object-class.html"><code>object</code></a> --+ + | + <a href="../private/psycopg2._psycopg.cursor-class.html"><code>cursor</code></a> --+ + | + <strong class="uidshort">cursor</strong> +</pre><br /> + +<hr/> + +<p>psycopg 1.1.x cursor.</p> +<p>Note that this cursor implements the exact procedure used by psycopg 1 to +build dictionaries out of result rows. The DictCursor in the +psycopg.extras modules implements a much better and faster algorithm.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="dictfetchall"></a><span class="summary-sig"><span class="summary-sig-name">dictfetchall</span>(<span class="summary-sig-arg">self</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="dictfetchmany"></a><span class="summary-sig"><span class="summary-sig-name">dictfetchmany</span>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">size</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="dictfetchone"></a><span class="summary-sig"><span class="summary-sig-name">dictfetchone</span>(<span class="summary-sig-arg">self</span>)</span></code> +</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from object</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__delattr__('name') <==> del x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__getattribute__('name') <==> x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return hash(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__setattr__('name', value) <==> x.name = value</td></tr> +</table><br /> + + +<!-- =========== START OF METHOD DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Method Details</th></tr> +</table> + +<a name="dictfetchall"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">dictfetchall</span>(<span class="sig-arg">self</span>)</span> + </h3> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="dictfetchmany"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">dictfetchmany</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">size</span>)</span> + </h3> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> + +<a name="dictfetchone"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">dictfetchone</span>(<span class="sig-arg">self</span>)</span> + </h3> + <dl><dt></dt><dd> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:33 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/public/psycopg2.tz-module.html b/psycopg2/doc/api/public/psycopg2.tz-module.html new file mode 100644 index 00000000..192ac5e0 --- /dev/null +++ b/psycopg2/doc/api/public/psycopg2.tz-module.html @@ -0,0 +1,193 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.tz</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + Module tz + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<a href="../private/psycopg2.tz-module.html">show private</a> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.tz-module.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF MODULE DESCRIPTION =========== --> +<h2 class="module">Module psycopg2.tz</h2> + +<p>tzinfo implementations for psycopg2</p> +<p>This module holds two different tzinfo implementations that can be used as +the 'tzinfo' argument to datetime constructors, directly passed to psycopg +functions or used to set the .tzinfo_factory attribute in cursors.</p> +<hr/> + +<!-- =========== START OF CLASSES =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Classes</th></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.tz.FixedOffsetTimezone-class.html"><code>FixedOffsetTimezone</code></a></strong></td> + <td>Fixed offset in minutes east from UTC.</td></tr> +<tr><td width="15%"> + <strong><a href="psycopg2.tz.LocalTimezone-class.html"><code>LocalTimezone</code></a></strong></td> + <td>Platform idea of local timezone.</td></tr> +</table><br /> + + +<!-- =========== START OF VARIABLE SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Variable Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>timedelta</code></td> +<td><strong><a href="psycopg2.tz-module.html#DSTDIFF"><code>DSTDIFF</code></a></strong> = <span title="datetime.timedelta(0, 3600)"><code>datetime.timedelta(0, 3600) </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>LocalTimezone</code></td> +<td><strong><a href="psycopg2.tz-module.html#LOCAL"><code>LOCAL</code></a></strong> = <span title="<psycopg2.tz.LocalTimezone object at 0x00847090>"><code><psycopg2.tz.LocalTimezone object at 0x00847090> </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>timedelta</code></td> +<td><strong><a href="psycopg2.tz-module.html#STDOFFSET"><code>STDOFFSET</code></a></strong> = <span title="datetime.timedelta(0, 3600)"><code>datetime.timedelta(0, 3600) </code> +</span></td></tr> +<tr><td align="right" valign="top" width="15%" class="vtype"><code>timedelta</code></td> +<td><strong><a href="psycopg2.tz-module.html#ZERO"><code>ZERO</code></a></strong> = <span title="datetime.timedelta(0)"><code>datetime.timedelta(0) </code> +</span></td></tr> +</table><br /> + + +<!-- =========== START OF VARIABLE DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Variable Details</th></tr> +</table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="DSTDIFF"></a> +<h3>DSTDIFF</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>timedelta</code> + + </dd> + <dt title="datetime.timedelta(0, 3600)">Value:</dt> + <dd title="datetime.timedelta(0, 3600)"><table><tr><td> +<pre class="variable"> +datetime.timedelta(0, 3600) </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="LOCAL"></a> +<h3>LOCAL</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>LocalTimezone</code> + + </dd> + <dt title="<psycopg2.tz.LocalTimezone object at 0x00847090>">Value:</dt> + <dd title="<psycopg2.tz.LocalTimezone object at 0x00847090>"><table><tr><td> +<pre class="variable"> +<psycopg2.tz.LocalTimezone object at 0x00847090> </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="STDOFFSET"></a> +<h3>STDOFFSET</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>timedelta</code> + + </dd> + <dt title="datetime.timedelta(0, 3600)">Value:</dt> + <dd title="datetime.timedelta(0, 3600)"><table><tr><td> +<pre class="variable"> +datetime.timedelta(0, 3600) </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td> +<a name="ZERO"></a> +<h3>ZERO</h3> +<dl> + <dt></dt> + <dd> + <dl> + <dt>Type:</dt> + <dd> + <code>timedelta</code> + + </dd> + <dt title="datetime.timedelta(0)">Value:</dt> + <dd title="datetime.timedelta(0)"><table><tr><td> +<pre class="variable"> +datetime.timedelta(0) </pre> + </td></tr></table></dd> + </dl> + </dd> +</dl></td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:37 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/public/psycopg2.tz.FixedOffsetTimezone-class.html b/psycopg2/doc/api/public/psycopg2.tz.FixedOffsetTimezone-class.html new file mode 100644 index 00000000..71145ddd --- /dev/null +++ b/psycopg2/doc/api/public/psycopg2.tz.FixedOffsetTimezone-class.html @@ -0,0 +1,213 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.tz.FixedOffsetTimezone</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + <a href="psycopg2.tz-module.html">Module tz</a> :: + Class FixedOffsetTimezone + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<a href="../private/psycopg2.tz.FixedOffsetTimezone-class.html">show private</a> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.tz.FixedOffsetTimezone-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Type FixedOffsetTimezone</h2> + +<pre class="base-tree"> +<a href="__builtin__.object-class.html"><code>object</code></a> --+ + | + <a href="datetime.tzinfo-class.html"><code>tzinfo</code></a> --+ + | + <strong class="uidshort">FixedOffsetTimezone</strong> +</pre><br /> + +<hr/> + +<p>Fixed offset in minutes east from UTC.</p> +<p>This is exactly the implementation found in Python 2.3.x documentation, +with a small change to the __init__ method to allow for pickling and a +default name in the form 'sHH:MM' ('s' is the sign.)</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="__init__"></a><span class="summary-sig"><span class="summary-sig-name">__init__</span>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">offset</span>, + <span class="summary-sig-arg">name</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="dst"></a><span class="summary-sig"><span class="summary-sig-name">dst</span>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">dt</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="tzname"></a><span class="summary-sig"><span class="summary-sig-name">tzname</span>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">dt</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="utcoffset"></a><span class="summary-sig"><span class="summary-sig-name">utcoffset</span>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">dt</span>)</span></code> +</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from tzinfo</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__getattribute__('name') <==> x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#__new__" class="summary-sig-name"><code>__new__</code></a>(<span class="summary-sig-arg">T</span>, + <span class="summary-sig-arg">S</span>, + <span class="summary-sig-vararg">...</span>)</span></code> +<br /> +Return a new object with type S, a subtype of T...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +-> (cls, state)</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#fromutc" class="summary-sig-name"><code>fromutc</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +datetime in UTC -> datetime in local time.</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from object</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__delattr__('name') <==> del x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return hash(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return repr(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__setattr__('name', value) <==> x.name = value</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return str(x)...</td></tr> +</table><br /> + + +<!-- =========== START OF METHOD DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Method Details</th></tr> +</table> + +<a name="__init__"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">offset</span>=<span class="sig-default">None</span>, + <span class="sig-arg">name</span>=<span class="sig-default">None</span>)</span> + <br /><em class="fname">(Constructor)</em> + </h3> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="__builtin__.object-class.html#__init__"><code>__builtin__.object.__init__</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="dst"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">dst</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">dt</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="datetime.tzinfo-class.html#dst"><code>datetime.tzinfo.dst</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="tzname"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">tzname</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">dt</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="datetime.tzinfo-class.html#tzname"><code>datetime.tzinfo.tzname</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="utcoffset"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">utcoffset</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">dt</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="datetime.tzinfo-class.html#utcoffset"><code>datetime.tzinfo.utcoffset</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:36 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/public/psycopg2.tz.LocalTimezone-class.html b/psycopg2/doc/api/public/psycopg2.tz.LocalTimezone-class.html new file mode 100644 index 00000000..7f95294f --- /dev/null +++ b/psycopg2/doc/api/public/psycopg2.tz.LocalTimezone-class.html @@ -0,0 +1,196 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.tz.LocalTimezone</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + <span class="breadcrumbs"> + <a href="psycopg2-module.html">Package psycopg2</a> :: + <a href="psycopg2.tz-module.html">Module tz</a> :: + Class LocalTimezone + </span><br /> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<a href="../private/psycopg2.tz.LocalTimezone-class.html">show private</a> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="psycopg2.tz.LocalTimezone-class.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF CLASS DESCRIPTION =========== --> +<h2 class="class">Type LocalTimezone</h2> + +<pre class="base-tree"> +<a href="__builtin__.object-class.html"><code>object</code></a> --+ + | + <a href="datetime.tzinfo-class.html"><code>tzinfo</code></a> --+ + | + <strong class="uidshort">LocalTimezone</strong> +</pre><br /> + +<hr/> + +<p>Platform idea of local timezone.</p> +<p>This is the exact implementation from the Pyhton 2.3 documentation.</p> +<hr/> + + +<!-- =========== START OF METHOD SUMMARY =========== --> +<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="summary"> + <th colspan="2">Method Summary</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="dst"></a><span class="summary-sig"><span class="summary-sig-name">dst</span>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">dt</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="tzname"></a><span class="summary-sig"><span class="summary-sig-name">tzname</span>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">dt</span>)</span></code> +</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><a name="utcoffset"></a><span class="summary-sig"><span class="summary-sig-name">utcoffset</span>(<span class="summary-sig-arg">self</span>, + <span class="summary-sig-arg">dt</span>)</span></code> +</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from tzinfo</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#__getattribute__" class="summary-sig-name"><code>__getattribute__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__getattribute__('name') <==> x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#__new__" class="summary-sig-name"><code>__new__</code></a>(<span class="summary-sig-arg">T</span>, + <span class="summary-sig-arg">S</span>, + <span class="summary-sig-vararg">...</span>)</span></code> +<br /> +Return a new object with type S, a subtype of T...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#__reduce__" class="summary-sig-name"><code>__reduce__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +-> (cls, state)</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="datetime.tzinfo-class.html#fromutc" class="summary-sig-name"><code>fromutc</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +datetime in UTC -> datetime in local time.</td></tr> +<tr bgcolor="#e8f0f8" class="group"> + <th colspan="2"> Inherited from object</th></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__init__(...) initializes x; see x.__class__.__doc__ for signature</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__delattr__" class="summary-sig-name"><code>__delattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__delattr__('name') <==> del x.name</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__hash__" class="summary-sig-name"><code>__hash__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return hash(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__reduce_ex__" class="summary-sig-name"><code>__reduce_ex__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +helper for pickle</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return repr(x)...</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__setattr__" class="summary-sig-name"><code>__setattr__</code></a>(<span class="summary-sig-vararg">...</span>)</span></code> +<br /> +x.__setattr__('name', value) <==> x.name = value</td></tr> +<tr><td align="right" valign="top" width="15%" class="rtype"> </td> + <td><code><span class="summary-sig"><a href="__builtin__.object-class.html#__str__" class="summary-sig-name"><code>__str__</code></a>(<span class="summary-sig-arg">x</span>)</span></code> +<br /> +Return str(x)...</td></tr> +</table><br /> + + +<!-- =========== START OF METHOD DETAILS =========== --> +<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> +<tr bgcolor="#70b0f0" class="details"> + <th colspan="2">Method Details</th></tr> +</table> + +<a name="dst"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">dst</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">dt</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="datetime.tzinfo-class.html#dst"><code>datetime.tzinfo.dst</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="tzname"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">tzname</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">dt</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="datetime.tzinfo-class.html#tzname"><code>datetime.tzinfo.tzname</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> + +<a name="utcoffset"></a> +<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td> + <h3><span class="sig"><span class="sig-name">utcoffset</span>(<span class="sig-arg">self</span>, + <span class="sig-arg">dt</span>)</span> + </h3> + <dl><dt></dt><dd> + <dl><dt>Overrides:</dt> + <dd><a href="datetime.tzinfo-class.html#utcoffset"><code>datetime.tzinfo.utcoffset</code></a></dd> + </dl> + </dd></dl> +</td></tr></table> +<br /> + + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:34 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/api/public/toc-everything.html b/psycopg2/doc/api/public/toc-everything.html new file mode 100644 index 00000000..a13c5023 --- /dev/null +++ b/psycopg2/doc/api/public/toc-everything.html @@ -0,0 +1,90 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>Everything</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> +<h1 class="tocheading">Everything</h1> +<hr /> + +<!-- =========== START OF ALL CLASSES =========== --> +<h2 class="tocheading">All Classes</h2> +<p class="toc"><a target="mainFrame" href="psycopg2.extras.DictConnection-class.html">psycopg2.extras.DictConnection</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extras.DictCursor-class.html">psycopg2.extras.DictCursor</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extras.DictRow-class.html">psycopg2.extras.DictRow</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extras.SQL_IN-class.html">psycopg2.extras.SQL_IN</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.pool.AbstractConnectionPool-class.html">psycopg2.pool.AbstractConnectionPool</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.pool.PersistentConnectionPool-class.html">psycopg2.pool.PersistentConnectionPool</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.pool.SimpleConnectionPool-class.html">psycopg2.pool.SimpleConnectionPool</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.pool.ThreadedConnectionPool-class.html">psycopg2.pool.ThreadedConnectionPool</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.psycopg1.connection-class.html">psycopg2.psycopg1.connection</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.psycopg1.cursor-class.html">psycopg2.psycopg1.cursor</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.tz.FixedOffsetTimezone-class.html">psycopg2.tz.FixedOffsetTimezone</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.tz.LocalTimezone-class.html">psycopg2.tz.LocalTimezone</a></p> + +<!-- =========== START OF ALL EXCEPTIONS =========== --> +<h2 class="tocheading">All Exceptions</h2> +<p class="toc"><a target="mainFrame" href="psycopg2.DatabaseError-class.html">psycopg2.DatabaseError</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.DataError-class.html">psycopg2.DataError</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.Error-class.html">psycopg2.Error</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.IntegrityError-class.html">psycopg2.IntegrityError</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.InterfaceError-class.html">psycopg2.InterfaceError</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.InternalError-class.html">psycopg2.InternalError</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.NotSupportedError-class.html">psycopg2.NotSupportedError</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.OperationalError-class.html">psycopg2.OperationalError</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.pool.PoolError-class.html">psycopg2.pool.PoolError</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.ProgrammingError-class.html">psycopg2.ProgrammingError</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.Warning-class.html">psycopg2.Warning</a></p> + +<!-- =========== START OF ALL FUNCTIONS =========== --> +<h2 class="tocheading">All Functions</h2> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#adapt">adapt</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#AsIs">AsIs</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2-module.html#Binary">Binary</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#Boolean">Boolean</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2-module.html#connect">connect</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.psycopg1-module.html#connect">connect</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2-module.html#Date">Date</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#DateFromPy">DateFromPy</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2-module.html#DateFromTicks">DateFromTicks</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.pool-module.html#dbg">dbg</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#IntervalFromPy">IntervalFromPy</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#new_type">new_type</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#QuotedString">QuotedString</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#register_adapter">register_adapter</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#register_type">register_type</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2-module.html#Time">Time</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#TimeFromPy">TimeFromPy</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2-module.html#TimeFromTicks">TimeFromTicks</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2-module.html#Timestamp">Timestamp</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#TimestampFromPy">TimestampFromPy</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2-module.html#TimestampFromTicks">TimestampFromTicks</a></p> + +<!-- =========== START OF ALL VARIABLES =========== --> +<h2 class="tocheading">All Variables</h2> +<p class="toc"><a target="mainFrame" href="psycopg2.tz-module.html#DSTDIFF">DSTDIFF</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#ISOLATION_LEVEL_AUTOCOMMIT">ISOLATION_LEVEL_AUTOCOMMIT</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#ISOLATION_LEVEL_READ_COMMITTED">ISOLATION_LEVEL_READ_COMMITTED</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#ISOLATION_LEVEL_READ_UNCOMMITTED">ISOLATION_LEVEL_READ_UNCOMMITTED</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#ISOLATION_LEVEL_REPEATABLE_READ">ISOLATION_LEVEL_REPEATABLE_READ</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#ISOLATION_LEVEL_SERIALIZABLE">ISOLATION_LEVEL_SERIALIZABLE</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.tz-module.html#LOCAL">LOCAL</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.tz-module.html#STDOFFSET">STDOFFSET</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.tz-module.html#ZERO">ZERO</a></p> + +<hr /> +<span class="options">[<a href="../private/toc-everything.html">show private</a> | hide private]</span> +</body> +</html> diff --git a/psycopg2/doc/api/public/toc-psycopg2-module.html b/psycopg2/doc/api/public/toc-psycopg2-module.html new file mode 100644 index 00000000..fa15e9b4 --- /dev/null +++ b/psycopg2/doc/api/public/toc-psycopg2-module.html @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> +<h1 class="tocheading"><a target="mainFrame" href="psycopg2-module.html">psycopg2</a></h1> +<hr /> + +<!-- =========== START OF MODULES =========== --> +<h2 class="tocheading">Modules</h2> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html">extensions</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extras-module.html">extras</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.pool-module.html">pool</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.psycopg1-module.html">psycopg1</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.tz-module.html">tz</a></p> + +<!-- =========== START OF EXCEPTIONS =========== --> +<h2 class="tocheading">Exceptions</h2> +<p class="toc"><a target="mainFrame" href="psycopg2.DatabaseError-class.html">DatabaseError</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.DataError-class.html">DataError</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.Error-class.html">Error</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.IntegrityError-class.html">IntegrityError</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.InterfaceError-class.html">InterfaceError</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.InternalError-class.html">InternalError</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.NotSupportedError-class.html">NotSupportedError</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.OperationalError-class.html">OperationalError</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.ProgrammingError-class.html">ProgrammingError</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.Warning-class.html">Warning</a></p> + +<!-- =========== START OF FUNCTIONS =========== --> +<h2 class="tocheading">Functions</h2> +<p class="toc"><a target="mainFrame" href="psycopg2-module.html#Binary">Binary</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2-module.html#connect">connect</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2-module.html#Date">Date</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2-module.html#DateFromTicks">DateFromTicks</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2-module.html#Time">Time</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2-module.html#TimeFromTicks">TimeFromTicks</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2-module.html#Timestamp">Timestamp</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2-module.html#TimestampFromTicks">TimestampFromTicks</a></p> + +<hr /> +<span class="options">[<a href="../private/toc-psycopg2-module.html">show private</a> | hide private]</span> +</body> +</html> diff --git a/psycopg2/doc/api/public/toc-psycopg2._psycopg-module.html b/psycopg2/doc/api/public/toc-psycopg2._psycopg-module.html new file mode 100644 index 00000000..6e8fa491 --- /dev/null +++ b/psycopg2/doc/api/public/toc-psycopg2._psycopg-module.html @@ -0,0 +1,73 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2._psycopg</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> +<h1 class="tocheading"><a target="mainFrame" href="psycopg2._psycopg-module.html">_psycopg</a></h1> +<hr /> + +<!-- =========== START OF CLASSES =========== --> +<h2 class="tocheading">Classes</h2> + +<!-- =========== START OF FUNCTIONS =========== --> +<h2 class="tocheading">Functions</h2> + +<!-- =========== START OF VARIABLES =========== --> +<h2 class="tocheading">Variables</h2> +<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#__version__">__version__</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#adapters">adapters</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#apilevel">apilevel</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#BINARY">BINARY</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#binary_types">binary_types</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#BINARYARRAY">BINARYARRAY</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#BOOLEAN">BOOLEAN</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#BOOLEANARRAY">BOOLEANARRAY</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#DATE">DATE</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#DATEARRAY">DATEARRAY</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#DATETIME">DATETIME</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#DATETIMEARRAY">DATETIMEARRAY</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#DECIMAL">DECIMAL</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#DECIMALARRAY">DECIMALARRAY</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#encodings">encodings</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#FLOAT">FLOAT</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#FLOATARRAY">FLOATARRAY</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#INTEGER">INTEGER</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#INTEGERARRAY">INTEGERARRAY</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#INTERVAL">INTERVAL</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#INTERVALARRAY">INTERVALARRAY</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#LONGINTEGER">LONGINTEGER</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#LONGINTEGERARRAY">LONGINTEGERARRAY</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#NUMBER">NUMBER</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#paramstyle">paramstyle</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#PYDATE">PYDATE</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#PYDATETIME">PYDATETIME</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#PYINTERVAL">PYINTERVAL</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#PYTIME">PYTIME</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#ROWID">ROWID</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#ROWIDARRAY">ROWIDARRAY</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#STRING">STRING</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#string_types">string_types</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#STRINGARRAY">STRINGARRAY</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#threadsafety">threadsafety</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#TIME">TIME</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#TIMEARRAY">TIMEARRAY</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#UNICODE">UNICODE</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2._psycopg-module.html#UNICODEARRAY">UNICODEARRAY</a></p> + +<hr /> +<span class="options">[<a href="../private/toc-psycopg2._psycopg-module.html">show private</a> | hide private]</span> +</body> +</html> diff --git a/psycopg2/doc/api/public/toc-psycopg2.extensions-module.html b/psycopg2/doc/api/public/toc-psycopg2.extensions-module.html new file mode 100644 index 00000000..abf93ebb --- /dev/null +++ b/psycopg2/doc/api/public/toc-psycopg2.extensions-module.html @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.extensions</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> +<h1 class="tocheading"><a target="mainFrame" href="psycopg2.extensions-module.html">extensions</a></h1> +<hr /> + +<!-- =========== START OF FUNCTIONS =========== --> +<h2 class="tocheading">Functions</h2> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#adapt">adapt</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#AsIs">AsIs</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#Boolean">Boolean</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#DateFromPy">DateFromPy</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#IntervalFromPy">IntervalFromPy</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#new_type">new_type</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#QuotedString">QuotedString</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#register_adapter">register_adapter</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#register_type">register_type</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#TimeFromPy">TimeFromPy</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#TimestampFromPy">TimestampFromPy</a></p> + +<!-- =========== START OF VARIABLES =========== --> +<h2 class="tocheading">Variables</h2> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#ISOLATION_LEVEL_AUTOCOMMIT">ISOLATION_LEVEL_AUTOCOMMIT</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#ISOLATION_LEVEL_READ_COMMITTED">ISOLATION_LEVEL_READ_COMMITTED</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#ISOLATION_LEVEL_READ_UNCOMMITTED">ISOLATION_LEVEL_READ_UNCOMMITTED</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#ISOLATION_LEVEL_REPEATABLE_READ">ISOLATION_LEVEL_REPEATABLE_READ</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extensions-module.html#ISOLATION_LEVEL_SERIALIZABLE">ISOLATION_LEVEL_SERIALIZABLE</a></p> + +<hr /> +<span class="options">[<a href="../private/toc-psycopg2.extensions-module.html">show private</a> | hide private]</span> +</body> +</html> diff --git a/psycopg2/doc/api/public/toc-psycopg2.extras-module.html b/psycopg2/doc/api/public/toc-psycopg2.extras-module.html new file mode 100644 index 00000000..f193b475 --- /dev/null +++ b/psycopg2/doc/api/public/toc-psycopg2.extras-module.html @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.extras</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> +<h1 class="tocheading"><a target="mainFrame" href="psycopg2.extras-module.html">extras</a></h1> +<hr /> + +<!-- =========== START OF CLASSES =========== --> +<h2 class="tocheading">Classes</h2> +<p class="toc"><a target="mainFrame" href="psycopg2.extras.DictConnection-class.html">DictConnection</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extras.DictCursor-class.html">DictCursor</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extras.DictRow-class.html">DictRow</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.extras.SQL_IN-class.html">SQL_IN</a></p> + +<hr /> +<span class="options">[<a href="../private/toc-psycopg2.extras-module.html">show private</a> | hide private]</span> +</body> +</html> diff --git a/psycopg2/doc/api/public/toc-psycopg2.pool-module.html b/psycopg2/doc/api/public/toc-psycopg2.pool-module.html new file mode 100644 index 00000000..07360190 --- /dev/null +++ b/psycopg2/doc/api/public/toc-psycopg2.pool-module.html @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.pool</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> +<h1 class="tocheading"><a target="mainFrame" href="psycopg2.pool-module.html">pool</a></h1> +<hr /> + +<!-- =========== START OF CLASSES =========== --> +<h2 class="tocheading">Classes</h2> +<p class="toc"><a target="mainFrame" href="psycopg2.pool.AbstractConnectionPool-class.html">AbstractConnectionPool</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.pool.PersistentConnectionPool-class.html">PersistentConnectionPool</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.pool.SimpleConnectionPool-class.html">SimpleConnectionPool</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.pool.ThreadedConnectionPool-class.html">ThreadedConnectionPool</a></p> + +<!-- =========== START OF EXCEPTIONS =========== --> +<h2 class="tocheading">Exceptions</h2> +<p class="toc"><a target="mainFrame" href="psycopg2.pool.PoolError-class.html">PoolError</a></p> + +<!-- =========== START OF FUNCTIONS =========== --> +<h2 class="tocheading">Functions</h2> +<p class="toc"><a target="mainFrame" href="psycopg2.pool-module.html#dbg">dbg</a></p> + +<hr /> +<span class="options">[<a href="../private/toc-psycopg2.pool-module.html">show private</a> | hide private]</span> +</body> +</html> diff --git a/psycopg2/doc/api/public/toc-psycopg2.psycopg1-module.html b/psycopg2/doc/api/public/toc-psycopg2.psycopg1-module.html new file mode 100644 index 00000000..69b1f790 --- /dev/null +++ b/psycopg2/doc/api/public/toc-psycopg2.psycopg1-module.html @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.psycopg1</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> +<h1 class="tocheading"><a target="mainFrame" href="psycopg2.psycopg1-module.html">psycopg1</a></h1> +<hr /> + +<!-- =========== START OF CLASSES =========== --> +<h2 class="tocheading">Classes</h2> +<p class="toc"><a target="mainFrame" href="psycopg2.psycopg1.connection-class.html">connection</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.psycopg1.cursor-class.html">cursor</a></p> + +<!-- =========== START OF FUNCTIONS =========== --> +<h2 class="tocheading">Functions</h2> +<p class="toc"><a target="mainFrame" href="psycopg2.psycopg1-module.html#connect">connect</a></p> + +<hr /> +<span class="options">[<a href="../private/toc-psycopg2.psycopg1-module.html">show private</a> | hide private]</span> +</body> +</html> diff --git a/psycopg2/doc/api/public/toc-psycopg2.tz-module.html b/psycopg2/doc/api/public/toc-psycopg2.tz-module.html new file mode 100644 index 00000000..6f617fea --- /dev/null +++ b/psycopg2/doc/api/public/toc-psycopg2.tz-module.html @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>psycopg2.tz</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> +<h1 class="tocheading"><a target="mainFrame" href="psycopg2.tz-module.html">tz</a></h1> +<hr /> + +<!-- =========== START OF CLASSES =========== --> +<h2 class="tocheading">Classes</h2> +<p class="toc"><a target="mainFrame" href="psycopg2.tz.FixedOffsetTimezone-class.html">FixedOffsetTimezone</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.tz.LocalTimezone-class.html">LocalTimezone</a></p> + +<!-- =========== START OF VARIABLES =========== --> +<h2 class="tocheading">Variables</h2> +<p class="toc"><a target="mainFrame" href="psycopg2.tz-module.html#DSTDIFF">DSTDIFF</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.tz-module.html#LOCAL">LOCAL</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.tz-module.html#STDOFFSET">STDOFFSET</a></p> +<p class="toc"><a target="mainFrame" href="psycopg2.tz-module.html#ZERO">ZERO</a></p> + +<hr /> +<span class="options">[<a href="../private/toc-psycopg2.tz-module.html">show private</a> | hide private]</span> +</body> +</html> diff --git a/psycopg2/doc/api/public/toc.html b/psycopg2/doc/api/public/toc.html new file mode 100644 index 00000000..89021cc8 --- /dev/null +++ b/psycopg2/doc/api/public/toc.html @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>Table of Contents</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> +<h1 class="tocheading">Table of Contents</h1> +<hr /> +<p class="toc"><a target="moduleFrame" href="toc-everything.html">Everything</a></p> + +<!-- =========== START OF PACKAGES =========== --> +<h2 class="tocheading">Packages</h2> +<p class="toc"><a target="moduleFrame" href="toc-psycopg2-module.html" onclick="setFrame('toc-psycopg2-module.html', 'psycopg2-module.html');">psycopg2</a></p> + +<!-- =========== START OF MODULES =========== --> +<h2 class="tocheading">Modules</h2> +<p class="toc"><a target="moduleFrame" href="toc-psycopg2.extensions-module.html" onclick="setFrame('toc-psycopg2.extensions-module.html', 'psycopg2.extensions-module.html');">psycopg2.extensions</a></p> +<p class="toc"><a target="moduleFrame" href="toc-psycopg2.extras-module.html" onclick="setFrame('toc-psycopg2.extras-module.html', 'psycopg2.extras-module.html');">psycopg2.extras</a></p> +<p class="toc"><a target="moduleFrame" href="toc-psycopg2.pool-module.html" onclick="setFrame('toc-psycopg2.pool-module.html', 'psycopg2.pool-module.html');">psycopg2.pool</a></p> +<p class="toc"><a target="moduleFrame" href="toc-psycopg2.psycopg1-module.html" onclick="setFrame('toc-psycopg2.psycopg1-module.html', 'psycopg2.psycopg1-module.html');">psycopg2.psycopg1</a></p> +<p class="toc"><a target="moduleFrame" href="toc-psycopg2.tz-module.html" onclick="setFrame('toc-psycopg2.tz-module.html', 'psycopg2.tz-module.html');">psycopg2.tz</a></p> + +<hr /> +<span class="options">[<a href="../private/toc.html">show private</a> | hide private]</span> +</body> +</html> diff --git a/psycopg2/doc/api/public/trees.html b/psycopg2/doc/api/public/trees.html new file mode 100644 index 00000000..44573d92 --- /dev/null +++ b/psycopg2/doc/api/public/trees.html @@ -0,0 +1,174 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>Module and Class Hierarchies</title> + <link rel="stylesheet" href="epydoc.css" type="text/css" /> +<script type="text/javascript"> +<!-- +function setFrame(url1, url2){ + parent.frames[1].location.href = url1; + parent.frames[2].location.href = url2; +} +--> +</script> +</head> +<body bgcolor="white" text="black" link="blue" vlink="#204080" + alink="#204080"> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th bgcolor="#70b0f0" class="navselect"> Trees </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> +<table width="100%" cellpadding="0" cellspacing="0"> + <tr valign="top"> + <td width="100%"> + </td> + <td><table cellpadding="0" cellspacing="0"> + <tr><td align="right"><span class="options">[<a href="../private/trees.html">show private</a> | hide private]</span></td></tr> + <tr><td align="right"><span class="options">[<a href="frames.html" target="_top">frames</a> | <a href="trees.html" target="_top">no frames</a>]</span></td></tr> + </table></td> +</tr></table> + +<!-- =========== START OF MODULE HIERARCHY =========== --> +<h2>Module Hierarchy</h2> +<ul> +<li> <strong class="uidlink"><a href="psycopg2-module.html"><code>psycopg2</code></a></strong>: <em class="summary">A Python driver for PostgreSQL</em> <ul> + <li> <strong class="uidlink"><a href="psycopg2.extensions-module.html"><code>extensions</code></a></strong>: <em class="summary">psycopg extensions to the DBAPI-2.0</em></li> + <li> <strong class="uidlink"><a href="psycopg2.extras-module.html"><code>extras</code></a></strong>: <em class="summary">Miscellaneous goodies for psycopg2</em></li> + <li> <strong class="uidlink"><a href="psycopg2.pool-module.html"><code>pool</code></a></strong>: <em class="summary">Connection pooling for psycopg2</em></li> + <li> <strong class="uidlink"><a href="psycopg2.psycopg1-module.html"><code>psycopg1</code></a></strong>: <em class="summary">psycopg 1.1.x compatibility module</em></li> + <li> <strong class="uidlink"><a href="psycopg2.tz-module.html"><code>tz</code></a></strong>: <em class="summary">tzinfo implementations for psycopg2</em></li> + </ul> +</li> +</ul> + +<!-- =========== START OF CLASS HIERARCHY =========== --> +<h2>Class Hierarchy</h2> +<ul> + <li> <strong class="uidlink"><a href="__builtin__.object-class.html"><code>__builtin__.object</code></a></strong>: <em class="summary"> +The most base type</em> + <ul> + <li> <strong class="uidlink"><a href="psycopg2.pool.AbstractConnectionPool-class.html"><code>psycopg2.pool.AbstractConnectionPool</code></a></strong>: <em class="summary"> +Generic key-based pooling code.</em> + <ul> + <li> <strong class="uidlink"><a href="psycopg2.pool.PersistentConnectionPool-class.html"><code>psycopg2.pool.PersistentConnectionPool</code></a></strong>: <em class="summary"> +A pool that assigns persistent connections to different threads.</em> + </li> + <li> <strong class="uidlink"><a href="psycopg2.pool.SimpleConnectionPool-class.html"><code>psycopg2.pool.SimpleConnectionPool</code></a></strong>: <em class="summary"> +A connection pool that can't be shared across different threads.</em> + </li> + <li> <strong class="uidlink"><a href="psycopg2.pool.ThreadedConnectionPool-class.html"><code>psycopg2.pool.ThreadedConnectionPool</code></a></strong>: <em class="summary"> +A connection pool that works with the threading module.</em> + </li> + </ul> + </li> + <li> <strong class="uidlink"><a href="__builtin__.list-class.html"><code>__builtin__.list</code></a></strong>: <em class="summary"> +list() -> new list +list(sequence) -> new list initialized from sequence's items</em> + <ul> + <li> <strong class="uidlink"><a href="psycopg2.extras.DictRow-class.html"><code>psycopg2.extras.DictRow</code></a></strong>: <em class="summary"> +A row object that allow by-colun-name access to data.</em> + </li> + </ul> + </li> + <li> <strong class="uidlink"><a href="psycopg2.extras.SQL_IN-class.html"><code>psycopg2.extras.SQL_IN</code></a></strong>: <em class="summary"> +Adapt any iterable to an SQL quotable object.</em> + </li> + <li> <strong class="uidlink"><a href="__builtin__.type-class.html"><code>__builtin__.type</code></a></strong>: <em class="summary"> +type(object) -> the object's type +type(name, bases, dict) -> a new type</em> + </li> + <li> <strong class="uidlink"><a href="datetime.tzinfo-class.html"><code>datetime.tzinfo</code></a></strong>: <em class="summary"> +Abstract base class for time zone info objects.</em> + <ul> + <li> <strong class="uidlink"><a href="psycopg2.tz.FixedOffsetTimezone-class.html"><code>psycopg2.tz.FixedOffsetTimezone</code></a></strong>: <em class="summary"> +Fixed offset in minutes east from UTC.</em> + </li> + <li> <strong class="uidlink"><a href="psycopg2.tz.LocalTimezone-class.html"><code>psycopg2.tz.LocalTimezone</code></a></strong>: <em class="summary"> +Platform idea of local timezone.</em> + </li> + </ul> + </li> + <ul> + </ul> + <ul> + </ul> + </ul> + </li> + <li> <strong class="uidlink"><a href="exceptions.Exception-class.html"><code>exceptions.Exception</code></a></strong>: <em class="summary"> +Common base class for all exceptions.</em> + <ul> + <li> <strong class="uidlink"><a href="exceptions.StandardError-class.html"><code>exceptions.StandardError</code></a></strong>: <em class="summary"> +Base class for all standard Python exceptions.</em> + <ul> + <li> <strong class="uidlink"><a href="psycopg2.Error-class.html"><code>psycopg2.Error</code></a></strong>: <em class="summary"> +Base class for error exceptions.</em> + <ul> + <li> <strong class="uidlink"><a href="psycopg2.DatabaseError-class.html"><code>psycopg2.DatabaseError</code></a></strong>: <em class="summary"> +Error related to the database engine.</em> + <ul> + <li> <strong class="uidlink"><a href="psycopg2.DataError-class.html"><code>psycopg2.DataError</code></a></strong>: <em class="summary"> +Error related to problems with the processed data.</em> + </li> + <li> <strong class="uidlink"><a href="psycopg2.IntegrityError-class.html"><code>psycopg2.IntegrityError</code></a></strong>: <em class="summary"> +Error related to database integrity.</em> + </li> + <li> <strong class="uidlink"><a href="psycopg2.InternalError-class.html"><code>psycopg2.InternalError</code></a></strong>: <em class="summary"> +The database encountered an internal error.</em> + </li> + <li> <strong class="uidlink"><a href="psycopg2.NotSupportedError-class.html"><code>psycopg2.NotSupportedError</code></a></strong>: <em class="summary"> +A not supported datbase API was called.</em> + </li> + <li> <strong class="uidlink"><a href="psycopg2.OperationalError-class.html"><code>psycopg2.OperationalError</code></a></strong>: <em class="summary"> +Error related to database operation (disconnect, memory allocation etc).</em> + </li> + <li> <strong class="uidlink"><a href="psycopg2.ProgrammingError-class.html"><code>psycopg2.ProgrammingError</code></a></strong>: <em class="summary"> +Error related to database programming (SQL error, table not found etc).</em> + </li> + </ul> + </li> + <li> <strong class="uidlink"><a href="psycopg2.InterfaceError-class.html"><code>psycopg2.InterfaceError</code></a></strong>: <em class="summary"> +Error related to the database interface.</em> + </li> + <li> <strong class="uidlink"><a href="psycopg2.pool.PoolError-class.html"><code>psycopg2.pool.PoolError</code></a></strong> + </li> + </ul> + </li> + <li> <strong class="uidlink"><a href="psycopg2.Warning-class.html"><code>psycopg2.Warning</code></a></strong>: <em class="summary"> +A database warning.</em> + </li> + </ul> + </li> + </ul> + </li> +</ul> + +<!-- =========== START OF NAVBAR =========== --> +<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> + <tr valign="middle"> + <th class="navbar"> <a class="navbar" href="psycopg2-module.html">Home</a> </th> + <th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th> + <th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th> + <th class="navbar"> <a class="navbar" href="help.html">Help</a> </th> + <th class="navbar" width="100%"></th> + </tr> +</table> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr> + <td align="left" class="footer">Generated by Epydoc 2.1 on Sat Jan 14 01:42:37 2006</td> + <td align="right" class="footer"> + <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a> + </td> + </tr> +</table> +</body> +</html> diff --git a/psycopg2/doc/async.txt b/psycopg2/doc/async.txt new file mode 100644 index 00000000..518d5fe2 --- /dev/null +++ b/psycopg2/doc/async.txt @@ -0,0 +1,67 @@ +psycopg asynchronous API +************************ + +** Important: async quaeries are not enabled for 2.0 ** + +Program code can initiate an asynchronous query by passing an 'async=1' flag +to the .execute() method. A very simple example, from the connection to the +query: + + conn = psycopg.connect(database='test') + curs = conn.cursor() + curs.execute("SEECT * from test WHERE fielda > %s", (1971,), async=1) + +From then on any query on other cursors derived from the same connection is +doomed to fail (and raise an exception) until the original cursor (the one +executing the query) complete the asynchronous operation. This can happen in +a number of different ways: + + 1) one of the .fetchXXX() methods is called, effectively blocking untill + data has been sent from the backend to the client, terminating the + query. + + 2) .cancel() is called. This method tries to abort the current query and + will block until the query is aborted or fully executed. The return + value is True if the query was successfully aborted or False if it + was executed. Query result are discarded in both cases. + + 3) .execute() is called again on the same cursor (.execute() on a + different cursor will simply raise an exception.) This waits for the + complete execution of the current query, discard any data and execute + the new one. + +Note that calling .execute() two times in a row will not abort the former +query and will temporarily go to synchronous mode until the first of the two +queries is executed. + +Cursors now have some extra methods that make them usefull during +asynchronous queries: + + .fileno() + Returns the file descriptor associated with the current connection and + make possible to use a cursor in a context where a file object would be + expected (like in a select() call.) + + .isbusy() + Returns True if the backend is still processing the query or false if + data is ready to be fetched (by one of the .fetchXXX() methods.) + +A code snippet that shows how to use the cursor object in a select() call: + + import psycopg + import select + + conn = psycopg.connect(database='test') + curs = conn.cursor() + curs.execute("SEECT * from test WHERE fielda > %s", (1971,), async=1) + + # wait for input with a maximum timeout of 5 seconds + query_ended = False + while not query_ended: + rread, rwrite, rspec = select([cursor, another_file], [], [], 5) + if not cursor.isbusy(): + query_ended = True + # manage input from other sources like other_file, etc. + print "Query Results:" + for row in cursor: + print row diff --git a/psycopg2/doc/extensions.html b/psycopg2/doc/extensions.html new file mode 100644 index 00000000..cb712004 --- /dev/null +++ b/psycopg2/doc/extensions.html @@ -0,0 +1,219 @@ +<?xml version="1.0" encoding="utf-8" ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<meta name="generator" content="Docutils 0.3.9: http://docutils.sourceforge.net/" /> +<title>psycopg 2 extensions to the DBAPI 2.0</title> +<link rel="stylesheet" href="default.css" type="text/css" /> +</head> +<body> +<div class="document" id="psycopg-2-extensions-to-the-dbapi-2-0"> +<h1 class="title">psycopg 2 extensions to the DBAPI 2.0</h1> +<p>This document is a short summary of the extensions built in psycopg 2.0.x over +the standard <a class="reference" href="http://www.python.org/peps/pep-0249.html">Python Database API Specification 2.0</a>, usually called simply +DBAPI-2.0 or even PEP-249. Before reading on this document please make sure +you already know how to program in Python using a DBAPI-2.0 compliant driver: +basic concepts like opening a connection, executing queries and commiting or +rolling back a transaction will not be explained but just used.</p> +<p>Many objects and extension functions are defined in the <a class="reference" href="api/public/psycopg2.extensions-module.html"><tt class="docutils literal"><span class="pre">psycopg2.extensions</span></tt></a> +module.</p> +<div class="section" id="connection-and-cursor-factories"> +<h1><a name="connection-and-cursor-factories">Connection and cursor factories</a></h1> +<p>psycopg 2 exposes two new-style classes that can be sub-classed and expanded to +adapt them to the needs of the programmer: <a class="reference" href="api/private/psycopg2._psycopg.cursor-class.html"><tt class="docutils literal"><span class="pre">cursor</span></tt></a> and <a class="reference" href="api/private/psycopg2._psycopg.connection-class.html"><tt class="docutils literal"><span class="pre">connection</span></tt></a>. The +<a class="reference" href="api/private/psycopg2._psycopg.connection-class.html"><tt class="docutils literal"><span class="pre">connection</span></tt></a> class is usually sub-classed only to provide a . <a class="reference" href="api/private/psycopg2._psycopg.cursor-class.html"><tt class="docutils literal"><span class="pre">cursor</span></tt></a> is much +more interesting, because it is the class where query building, execution and +result type-casting into Python variables happens.</p> +<div class="section" id="row-factories"> +<h2><a name="row-factories">Row factories</a></h2> +</div> +<div class="section" id="tzinfo-factories"> +<h2><a name="tzinfo-factories">tzinfo factories</a></h2> +</div> +</div> +<div class="section" id="setting-transaction-isolation-levels"> +<h1><a name="setting-transaction-isolation-levels">Setting transaction isolation levels</a></h1> +<p>psycopg2 connection objects hold informations about the PostgreSQL <a class="reference" href="http://www.postgresql.org/docs/8.1/static/transaction-iso.html">transaction +isolation level</a>. The current transaction level can be read from the +<a class="reference" href="api/private/psycopg2._psycopg.connection-class.html#isolation_level"><tt class="docutils literal"><span class="pre">.isolation_level</span></tt></a> attribute. The default isolation level is <tt class="docutils literal"><span class="pre">READ</span> +<span class="pre">COMMITTED</span></tt>. A different isolation level con be set through the +<a class="reference" href="api/private/psycopg2._psycopg.connection-class.html#set_isolation_level"><tt class="docutils literal"><span class="pre">.set_isolation_level()</span></tt></a> method. The level can be set to one of the following +constants, defined in <a class="reference" href="api/public/psycopg2.extensions-module.html"><tt class="docutils literal"><span class="pre">psycopg2.extensions</span></tt></a>:</p> +<dl class="docutils"> +<dt><a class="reference" href="api/public/psycopg2.extensions-module.html#ISOLATION_LEVEL_AUTOCOMMIT"><tt class="docutils literal"><span class="pre">ISOLATION_LEVEL_AUTOCOMMIT</span></tt></a></dt> +<dd>No transaction is started when command are issued and no +<a class="reference" href="api/private/psycopg2._psycopg.connection-class.html#commit"><tt class="docutils literal"><span class="pre">.commit()</span></tt></a>/<a class="reference" href="api/private/psycopg2._psycopg.connection-class.html#rollback"><tt class="docutils literal"><span class="pre">.rollback()</span></tt></a> is required. Some PostgreSQL command such as +<tt class="docutils literal"><span class="pre">CREATE</span> <span class="pre">DATABASE</span></tt> can't run into a transaction: to run such command use +<a class="reference" href="api/private/psycopg2._psycopg.connection-class.html#set_isolation_level"><tt class="docutils literal"><span class="pre">.set_isolation_level(ISOLATION_LEVEL_AUTOCOMMIT)</span></tt></a>.</dd> +<dt><a href="#id2" name="id3"><span class="problematic" id="id3">`ISOLATION_LEVEL_READ_COMMITTED`</span></a></dt> +<dd><div class="first system-message" id="id2"> +<p class="system-message-title">System Message: <a name="id2">ERROR/3</a> (<tt class="docutils">../doc/extensions.rst</tt>, line 54); <em><a href="#id3">backlink</a></em></p> +Can't find 'ISOLATION_LEVEL_READ_COMMITTED' in any provided module.</div> +<p class="last">This is the default value. A new transaction is started at the first +<a class="reference" href="api/private/psycopg2._psycopg.cursor-class.html#execute"><tt class="docutils literal"><span class="pre">.execute()</span></tt></a> command on a cursor and at each new <a class="reference" href="api/private/psycopg2._psycopg.cursor-class.html#execute"><tt class="docutils literal"><span class="pre">.execute()</span></tt></a> after a +<a class="reference" href="api/private/psycopg2._psycopg.connection-class.html#commit"><tt class="docutils literal"><span class="pre">.commit()</span></tt></a> or a <a class="reference" href="api/private/psycopg2._psycopg.connection-class.html#rollback"><tt class="docutils literal"><span class="pre">.rollback()</span></tt></a>. The transaction runs in the PostgreSQL +<tt class="docutils literal"><span class="pre">READ</span> <span class="pre">COMMITTED</span></tt> isolation level.</p> +</dd> +<dt><a class="reference" href="api/public/psycopg2.extensions-module.html#ISOLATION_LEVEL_SERIALIZABLE"><tt class="docutils literal"><span class="pre">ISOLATION_LEVEL_SERIALIZABLE</span></tt></a></dt> +<dd>Transactions are run at a <tt class="docutils literal"><span class="pre">SERIALIZABLE</span></tt> isolation level.</dd> +</dl> +</div> +<div class="section" id="adaptation-of-python-values-to-sql-types"> +<h1><a name="adaptation-of-python-values-to-sql-types">Adaptation of Python values to SQL types</a></h1> +<p>psycopg2 casts Python variables to SQL literals by type. Standard Python types +are already adapted to the proper SQL literal.</p> +<p>Example: the Python function:</p> +<pre class="literal-block"> +curs.execute("""INSERT INTO atable (anint, adate, astring) + VALUES (%s, %s, %s)""", + (10, datetime.date(2005, 11, 18), "O'Reilly")) +</pre> +<p>is converted into the SQL command:</p> +<pre class="literal-block"> +INSERT INTO atable (anint, adate, astring) + VALUES (10, '2005-11-18', 'O''Reilly'); +</pre> +<p>Named arguments are supported too with <tt class="docutils literal"><span class="pre">%(name)s</span></tt> placeholders. Notice that:</p> +<blockquote> +<ul class="simple"> +<li>The Python string operator <tt class="docutils literal"><span class="pre">%</span></tt> is not used: the <a class="reference" href="api/private/psycopg2._psycopg.cursor-class.html#execute"><tt class="docutils literal"><span class="pre">.execute()</span></tt></a> function +accepts the values tuple or dictionary as second parameter.</li> +<li>The variables placeholder must always be a <tt class="docutils literal"><span class="pre">%s</span></tt>, even if a different +placeholder (such as a <tt class="docutils literal"><span class="pre">%d</span></tt> for an integer) may look more appropriate.</li> +<li>For positional variables binding, the second argument must always be a +tuple, even if it contains a single variable.</li> +<li>Only variable values should be bound via this method: it shouldn't be used +to set table or field names. For these elements, ordinary string formatting +should be used before running <a class="reference" href="api/private/psycopg2._psycopg.cursor-class.html#execute"><tt class="docutils literal"><span class="pre">.execute()</span></tt></a>.</li> +</ul> +</blockquote> +<div class="section" id="adapting-new-types"> +<h2><a name="adapting-new-types">Adapting new types</a></h2> +<p>Any Python class or type can be adapted to an SQL string. Adaptation mechanism +is similar to the Object Adaptation proposed in the <a class="reference" href="http://www.python.org/peps/pep-0246.html">PEP-246</a> and is exposed +by the <a class="reference" href="api/private/psycopg2._psycopg-module.html#adapt"><tt class="docutils literal"><span class="pre">adapt()</span></tt></a> function.</p> +<p>psycopg2 <a class="reference" href="api/private/psycopg2._psycopg.cursor-class.html#execute"><tt class="docutils literal"><span class="pre">.execute()</span></tt></a> method adapts its <tt class="docutils literal"><span class="pre">vars</span></tt> arguments to the <a class="reference" href="api/private/psycopg2._psycopg.ISQLQuote-class.html"><tt class="docutils literal"><span class="pre">ISQLQuote</span></tt></a> +protocol. Objects that conform to this protocol expose a <tt class="docutils literal"><span class="pre">getquoted()</span></tt> method +returning the SQL representation of the object as a string.</p> +<p>The easiest way to adapt an object to an SQL string is to register an adapter +function via the <a class="reference" href="api/public/psycopg2.extensions-module.html#register_adapter"><tt class="docutils literal"><span class="pre">register_adapter()</span></tt></a> function. The adapter function must take +the value to be adapted as argument and return a conform object. A convenient +object is the <a class="reference" href="api/private/psycopg2._psycopg-module.html#AsIs"><tt class="docutils literal"><span class="pre">AsIs</span></tt></a> wrapper, whose <tt class="docutils literal"><span class="pre">getquoted()</span></tt> result is simply the +<tt class="docutils literal"><span class="pre">str()</span></tt>ingification of the wrapped object.</p> +<p>Example: mapping of a <tt class="docutils literal"><span class="pre">Point</span></tt> class into the <tt class="docutils literal"><span class="pre">point</span></tt> PostgreSQL geometric +type:</p> +<pre class="literal-block"> +from psycopg2.extensions import adapt, register_adapter, AsIs + +class Point(object): + def __init__(self, x=0.0, y=0.0): + self.x = x + self.y = y + +def adapt_point(point): + return AsIs("'(%s,%s)'" % (adapt(point.x), adapt(point.y))) + +register_adapter(Point, adapt_point) + +curs.execute("INSERT INTO atable (apoint) VALUES (%s)", + (Point(1.23, 4.56),)) +</pre> +<p>The above function call results in the SQL command:</p> +<pre class="literal-block"> +INSERT INTO atable (apoint) VALUES ((1.23, 4.56)); +</pre> +</div> +</div> +<div class="section" id="type-casting-of-sql-types-into-python-values"> +<h1><a name="type-casting-of-sql-types-into-python-values">Type casting of SQL types into Python values</a></h1> +<p>PostgreSQL objects read from the database can be adapted to Python objects +through an user-defined adapting function. An adapter function takes two +argments: the object string representation as returned by PostgreSQL and the +cursor currently being read, and should return a new Python object. For +example, the following function parses a PostgreSQL <tt class="docutils literal"><span class="pre">point</span></tt> into the +previously defined <tt class="docutils literal"><span class="pre">Point</span></tt> class:</p> +<pre class="literal-block"> +def cast_point(value, curs): + if value is not None: + # Convert from (f1, f2) syntax using a regular expression. + m = re.match("\((.*),(.*)\)", value) + if m: + return Point(float(m.group(1)), float(m.group(2))) +</pre> +<p>To create a mapping from the PostgreSQL type (either standard or user-defined), +its <tt class="docutils literal"><span class="pre">oid</span></tt> must be known. It can be retrieved either by the second column of +the cursor description:</p> +<pre class="literal-block"> +curs.execute("SELECT NULL::point") +point_oid = curs.description[0][1] # usually returns 600 +</pre> +<p>or by querying the system catalogs for the type name and namespace (the +namespace for system objects is <tt class="docutils literal"><span class="pre">pg_catalog</span></tt>):</p> +<pre class="literal-block"> +curs.execute(""" + SELECT pg_type.oid + FROM pg_type JOIN pg_namespace + ON typnamespace = pg_namespace.oid + WHERE typname = %(typename)s + AND nspname = %(namespace)s""", + {'typename': 'point', 'namespace': 'pg_catalog'}) + +point_oid = curs.fetchone()[0] +</pre> +<p>After you know the object <tt class="docutils literal"><span class="pre">oid</span></tt>, you must can and register the new type:</p> +<pre class="literal-block"> +POINT = psycopg2.extensions.new_type((point_oid,), "POINT", cast_point) +psycopg2.extensions.register_type(POINT) +</pre> +<p>The <a class="reference" href="api/private/psycopg2._psycopg-module.html#new_type"><tt class="docutils literal"><span class="pre">new_type()</span></tt></a> function binds the object oids (more than one can be +specified) to the adapter function. <a class="reference" href="api/private/psycopg2._psycopg-module.html#register_type"><tt class="docutils literal"><span class="pre">register_type()</span></tt></a> completes the spell. +Conversion is automatically performed when a column whose type is a registered +<tt class="docutils literal"><span class="pre">oid</span></tt> is read:</p> +<pre class="literal-block"> +curs.execute("SELECT '(10.2,20.3)'::point") +point = curs.fetchone()[0] +print type(point), point.x, point.y +# Prints: "<class '__main__.Point'> 10.2 20.3" +</pre> +</div> +<div class="section" id="working-with-times-and-dates"> +<h1><a name="working-with-times-and-dates">Working with times and dates</a></h1> +</div> +<div class="section" id="receiving-notifys"> +<h1><a name="receiving-notifys">Receiving NOTIFYs</a></h1> +</div> +<div class="section" id="using-copy-to-and-copy-from"> +<h1><a name="using-copy-to-and-copy-from">Using COPY TO and COPY FROM</a></h1> +<p>psycopg2 <a class="reference" href="api/private/psycopg2._psycopg.cursor-class.html"><tt class="docutils literal"><span class="pre">cursor</span></tt></a> object provides an interface to the efficient <a class="reference" href="http://www.postgresql.org/docs/8.1/static/sql-copy.html">PostgreSQL +COPY command</a> to move data from files to tables and back.</p> +<p>The <a class="reference" href="api/private/psycopg2._psycopg.cursor-class.html#copy_to"><tt class="docutils literal"><span class="pre">.copy_to(file,</span> <span class="pre">table)</span></tt></a> method writes the content of the table +named <tt class="docutils literal"><span class="pre">table</span></tt> <em>to</em> the file-like object <tt class="docutils literal"><span class="pre">file</span></tt>. <tt class="docutils literal"><span class="pre">file</span></tt> must have a +<tt class="docutils literal"><span class="pre">write()</span></tt> method.</p> +<p>The <a class="reference" href="api/private/psycopg2._psycopg.cursor-class.html#copy_from"><tt class="docutils literal"><span class="pre">.copy_from(file,</span> <span class="pre">table)</span></tt></a> reads data <em>from</em> the file-like object +<tt class="docutils literal"><span class="pre">file</span></tt> appending them to the table named <tt class="docutils literal"><span class="pre">table</span></tt>. <tt class="docutils literal"><span class="pre">file</span></tt> must have both +<tt class="docutils literal"><span class="pre">read()</span></tt> and <tt class="docutils literal"><span class="pre">readline()</span></tt> method.</p> +<p>Both methods accept two optional arguments: <tt class="docutils literal"><span class="pre">sep</span></tt> (defaulting to a tab) is +the columns separator and <tt class="docutils literal"><span class="pre">null</span></tt> (defaulting to <tt class="docutils literal"><span class="pre">\N</span></tt>) represents <tt class="docutils literal"><span class="pre">NULL</span></tt> +values in the file.</p> +</div> +<div class="section" id="postgresql-status-message-and-executed-query"> +<h1><a name="postgresql-status-message-and-executed-query">PostgreSQL status message and executed query</a></h1> +<p><a class="reference" href="api/private/psycopg2._psycopg.cursor-class.html"><tt class="docutils literal"><span class="pre">cursor</span></tt></a> objects have two special fields related to the last executed query:</p> +<blockquote> +<ul class="simple"> +<li><a class="reference" href="api/private/psycopg2._psycopg.cursor-class.html#query"><tt class="docutils literal"><span class="pre">.query</span></tt></a> is the textual representation (str or unicode, depending on what +was passed to <a class="reference" href="api/private/psycopg2._psycopg.cursor-class.html#execute"><tt class="docutils literal"><span class="pre">.execute()</span></tt></a> as first argument) of the query <em>after</em> argument +binding and mogrification has been applied. To put it another way, <a class="reference" href="api/private/psycopg2._psycopg.cursor-class.html#query"><tt class="docutils literal"><span class="pre">.query</span></tt></a> +is the <em>exact</em> query that was sent to the PostgreSQL backend.</li> +<li><a class="reference" href="api/private/psycopg2._psycopg.cursor-class.html#statusmessage"><tt class="docutils literal"><span class="pre">.statusmessage</span></tt></a> is the status message that the backend sent upon query +execution. It usually contains the basic type of the query (SELECT, +INSERT, UPDATE, ...) and some additional information like the number of +rows updated and so on. Refer to the PostgreSQL manual for more +information.</li> +</ul> +</blockquote> +</div> +</div> +</body> +</html> diff --git a/psycopg2/doc/extensions.rst b/psycopg2/doc/extensions.rst new file mode 100644 index 00000000..3bdc6807 --- /dev/null +++ b/psycopg2/doc/extensions.rst @@ -0,0 +1,260 @@ +======================================= + psycopg 2 extensions to the DBAPI 2.0 +======================================= + +This document is a short summary of the extensions built in psycopg 2.0.x over +the standard `Python Database API Specification 2.0`__, usually called simply +DBAPI-2.0 or even PEP-249. Before reading on this document please make sure +you already know how to program in Python using a DBAPI-2.0 compliant driver: +basic concepts like opening a connection, executing queries and commiting or +rolling back a transaction will not be explained but just used. + +.. __: http://www.python.org/peps/pep-0249.html + +Many objects and extension functions are defined in the `psycopg2.extensions` +module. + + +Connection and cursor factories +=============================== + +psycopg 2 exposes two new-style classes that can be sub-classed and expanded to +adapt them to the needs of the programmer: `cursor` and `connection`. The +`connection` class is usually sub-classed only to provide an easy way to create +customized cursors but other uses are possible. `cursor` is much more +interesting, because it is the class where query building, execution and result +type-casting into Python variables happens. + +An example of cursor subclass performing logging is:: + + import psycopg2 + import psycopg2.extensions + import logging + + class LoggingCursor(psycopg2.extensions.cursor): + def execute(self, sql, args=None): + logger = logging.getLogger('sql_debug') + logger.info(self.mogrify(sql, args)) + + try: + psycopg2.extensions.cursor.execute(self, sql, args) + except Exception, exc: + logger.error("%s: %s" % (exc.__class__.__name__, exc)) + raise + + conn = psycopg2.connect(DSN) + curs = conn.cursor(cursor_factory=LoggingCursor) + curs.execute("INSERT INTO mytable VALUES (%s, %s, %s);", + (10, 20, 30)) + + +Row factories +------------- + +tzinfo factories +---------------- + + +Setting transaction isolation levels +==================================== + +psycopg2 connection objects hold informations about the PostgreSQL `transaction +isolation level`_. The current transaction level can be read from the +`.isolation_level` attribute. The default isolation level is ``READ +COMMITTED``. A different isolation level con be set through the +`.set_isolation_level()` method. The level can be set to one of the following +constants, defined in `psycopg2.extensions`: + +`ISOLATION_LEVEL_AUTOCOMMIT` + No transaction is started when command are issued and no + `.commit()`/`.rollback()` is required. Some PostgreSQL command such as + ``CREATE DATABASE`` can't run into a transaction: to run such command use + `.set_isolation_level(ISOLATION_LEVEL_AUTOCOMMIT)`. + +`ISOLATION_LEVEL_READ_COMMITTED` + This is the default value. A new transaction is started at the first + `.execute()` command on a cursor and at each new `.execute()` after a + `.commit()` or a `.rollback()`. The transaction runs in the PostgreSQL + ``READ COMMITTED`` isolation level. + +`ISOLATION_LEVEL_SERIALIZABLE` + Transactions are run at a ``SERIALIZABLE`` isolation level. + + +.. _transaction isolation level: + http://www.postgresql.org/docs/8.1/static/transaction-iso.html + + +Adaptation of Python values to SQL types +======================================== + +psycopg2 casts Python variables to SQL literals by type. Standard Python types +are already adapted to the proper SQL literal. + +Example: the Python function:: + + curs.execute("""INSERT INTO atable (anint, adate, astring) + VALUES (%s, %s, %s)""", + (10, datetime.date(2005, 11, 18), "O'Reilly")) + +is converted into the SQL command:: + + INSERT INTO atable (anint, adate, astring) + VALUES (10, '2005-11-18', 'O''Reilly'); + +Named arguments are supported too with ``%(name)s`` placeholders. Notice that: + + - The Python string operator ``%`` is not used: the `.execute()` function + accepts the values tuple or dictionary as second parameter. + + - The variables placeholder must always be a ``%s``, even if a different + placeholder (such as a ``%d`` for an integer) may look more appropriate. + + - For positional variables binding, the second argument must always be a + tuple, even if it contains a single variable. + + - Only variable values should be bound via this method: it shouldn't be used + to set table or field names. For these elements, ordinary string formatting + should be used before running `.execute()`. + + +Adapting new types +------------------ + +Any Python class or type can be adapted to an SQL string. Adaptation mechanism +is similar to the Object Adaptation proposed in the `PEP-246`_ and is exposed +by the `adapt()` function. + +psycopg2 `.execute()` method adapts its ``vars`` arguments to the `ISQLQuote` +protocol. Objects that conform to this protocol expose a ``getquoted()`` method +returning the SQL representation of the object as a string. + +The easiest way to adapt an object to an SQL string is to register an adapter +function via the `register_adapter()` function. The adapter function must take +the value to be adapted as argument and return a conform object. A convenient +object is the `AsIs` wrapper, whose ``getquoted()`` result is simply the +``str()``\ ingification of the wrapped object. + +Example: mapping of a ``Point`` class into the ``point`` PostgreSQL geometric +type:: + + from psycopg2.extensions import adapt, register_adapter, AsIs + + class Point(object): + def __init__(self, x=0.0, y=0.0): + self.x = x + self.y = y + + def adapt_point(point): + return AsIs("'(%s,%s)'" % (adapt(point.x), adapt(point.y))) + + register_adapter(Point, adapt_point) + + curs.execute("INSERT INTO atable (apoint) VALUES (%s)", + (Point(1.23, 4.56),)) + +The above function call results in the SQL command:: + + INSERT INTO atable (apoint) VALUES ((1.23, 4.56)); + + +.. _PEP-246: http://www.python.org/peps/pep-0246.html + + +Type casting of SQL types into Python values +============================================ + +PostgreSQL objects read from the database can be adapted to Python objects +through an user-defined adapting function. An adapter function takes two +argments: the object string representation as returned by PostgreSQL and the +cursor currently being read, and should return a new Python object. For +example, the following function parses a PostgreSQL ``point`` into the +previously defined ``Point`` class:: + + def cast_point(value, curs): + if value is not None: + # Convert from (f1, f2) syntax using a regular expression. + m = re.match("\((.*),(.*)\)", value) + if m: + return Point(float(m.group(1)), float(m.group(2))) + +To create a mapping from the PostgreSQL type (either standard or user-defined), +its ``oid`` must be known. It can be retrieved either by the second column of +the cursor description:: + + curs.execute("SELECT NULL::point") + point_oid = curs.description[0][1] # usually returns 600 + +or by querying the system catalogs for the type name and namespace (the +namespace for system objects is ``pg_catalog``):: + + curs.execute(""" + SELECT pg_type.oid + FROM pg_type JOIN pg_namespace + ON typnamespace = pg_namespace.oid + WHERE typname = %(typename)s + AND nspname = %(namespace)s""", + {'typename': 'point', 'namespace': 'pg_catalog'}) + + point_oid = curs.fetchone()[0] + +After you know the object ``oid``, you must can and register the new type:: + + POINT = psycopg2.extensions.new_type((point_oid,), "POINT", cast_point) + psycopg2.extensions.register_type(POINT) + +The `new_type()` function binds the object oids (more than one can be +specified) to the adapter function. `register_type()` completes the spell. +Conversion is automatically performed when a column whose type is a registered +``oid`` is read:: + + curs.execute("SELECT '(10.2,20.3)'::point") + point = curs.fetchone()[0] + print type(point), point.x, point.y + # Prints: "<class '__main__.Point'> 10.2 20.3" + + +Working with times and dates +============================ + + +Receiving NOTIFYs +================= + + +Using COPY TO and COPY FROM +=========================== + +psycopg2 `cursor` object provides an interface to the efficient `PostgreSQL +COPY command`__ to move data from files to tables and back. + +The `.copy_to(file, table)` method writes the content of the table +named ``table`` *to* the file-like object ``file``. ``file`` must have a +``write()`` method. + +The `.copy_from(file, table)` reads data *from* the file-like object +``file`` appending them to the table named ``table``. ``file`` must have both +``read()`` and ``readline()`` method. + +Both methods accept two optional arguments: ``sep`` (defaulting to a tab) is +the columns separator and ``null`` (defaulting to ``\N``) represents ``NULL`` +values in the file. + +.. __: http://www.postgresql.org/docs/8.1/static/sql-copy.html + + +PostgreSQL status message and executed query +============================================ + +`cursor` objects have two special fields related to the last executed query: + + - `.query` is the textual representation (str or unicode, depending on what + was passed to `.execute()` as first argument) of the query *after* argument + binding and mogrification has been applied. To put it another way, `.query` + is the *exact* query that was sent to the PostgreSQL backend. + + - `.statusmessage` is the status message that the backend sent upon query + execution. It usually contains the basic type of the query (SELECT, + INSERT, UPDATE, ...) and some additional information like the number of + rows updated and so on. Refer to the PostgreSQL manual for more + information. diff --git a/psycopg2/examples/binary.py b/psycopg2/examples/binary.py new file mode 100644 index 00000000..eaa8f1e7 --- /dev/null +++ b/psycopg2/examples/binary.py @@ -0,0 +1,89 @@ +# binary.py - working with binary data +# +# Copyright (C) 2001-2004 Federico Di Gregorio <fog@debian.org> +# +# 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 the +# Free Software Foundation; either version 2, or (at your option) any later +# version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. + +## put in DSN your DSN string + +DSN = 'dbname=test' + +## don't modify anything below tis line (except for experimenting) + +import sys +import psycopg2 + +if len(sys.argv) > 1: + DSN = sys.argv[1] + +print "Opening connection using dns:", DSN +conn = psycopg2.connect(DSN) +print "Encoding for this connection is", conn.encoding + +curs = conn.cursor() +try: + curs.execute("CREATE TABLE test_binary (id int4, name text, img bytea)") +except: + conn.rollback() + curs.execute("DROP TABLE test_binary") + curs.execute("CREATE TABLE test_binary (id int4, name text, img bytea)") +conn.commit() + +# first we try two inserts, one with an explicit Binary call and the other +# using a buffer on a file object. + +data1 = {'id':1, 'name':'somehackers.jpg', + 'img':psycopg2.Binary(open('somehackers.jpg').read())} +data2 = {'id':2, 'name':'whereareyou.jpg', + 'img':buffer(open('whereareyou.jpg').read())} + +curs.execute("""INSERT INTO test_binary + VALUES (%(id)s, %(name)s, %(img)s)""", data1) +curs.execute("""INSERT INTO test_binary + VALUES (%(id)s, %(name)s, %(img)s)""", data2) + +# now we try to extract the images as simple text strings + +print "Extracting the images as strings..." +curs.execute("SELECT * FROM test_binary") + +for row in curs.fetchall(): + name, ext = row[1].split('.') + new_name = name + '_S.' + ext + print " writing %s to %s ..." % (name+'.'+ext, new_name), + open(new_name, 'wb').write(row[2]) + print "done" + print " python type of image data is", type(row[2]) + +# extract exactly the same data but using a binary cursor + +print "Extracting the images using a binary cursor:" + +curs.execute("""DECLARE zot CURSOR FOR + SELECT img, name FROM test_binary FOR READ ONLY""") +curs.execute("""FETCH ALL FROM zot""") + +for row in curs.fetchall(): + name, ext = row[1].split('.') + new_name = name + '_B.' + ext + print " writing %s to %s ..." % (name+'.'+ext, new_name), + open(new_name, 'wb').write(row[0]) + print "done" + print " python type of image data is", type(row[0]) + +# this rollback is requires because we can't drop a table with a binary cusor +# declared and still open +conn.rollback() + +curs.execute("DROP TABLE test_binary") +conn.commit() + +print "\nNow try to load the new images, to check it worked!" diff --git a/psycopg2/examples/copy_from.py b/psycopg2/examples/copy_from.py new file mode 100644 index 00000000..edd32948 --- /dev/null +++ b/psycopg2/examples/copy_from.py @@ -0,0 +1,178 @@ +# copy_from.py -- example about copy_from +# +# Copyright (C) 2002 Tom Jenkins <tjenkins@devis.com> +# Copyright (C) 2005 Federico Di Gregorio <fog@initd.org> +# +# 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 the +# Free Software Foundation; either version 2, or (at your option) any later +# version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# + +## put in DSN your DSN string + +DSN = 'dbname=test' + +## don't modify anything below tis line (except for experimenting) + +import sys +import os +import StringIO +import psycopg2 + +if len(sys.argv) > 1: + DSN = sys.argv[1] + +print "Opening connection using dns:", DSN +conn = psycopg2.connect(DSN) +print "Encoding for this connection is", conn.encoding + +curs = conn.cursor() +try: + curs.execute("CREATE TABLE test_copy (fld1 text, fld2 text, fld3 int4)") +except: + conn.rollback() + curs.execute("DROP TABLE test_copy") + curs.execute("CREATE TABLE test_copy (fld1 text, fld2 text, fld3 int4)") +conn.commit() + +# copy_from with default arguments, from open file + +io = open('copy_from.txt', 'wr') +data = ['Tom\tJenkins\t37\n', + 'Madonna\t\N\t45\n', + 'Federico\tDi Gregorio\t\N\n'] +io.writelines(data) +io.close() + +io = open('copy_from.txt', 'r') +curs.copy_from(io, 'test_copy') +print "1) Copy %d records from file object " % len(data) + \ + "using defaults (sep: \\t and null = \\N)" +io.close() + +curs.execute("SELECT * FROM test_copy") +rows = curs.fetchall() +print " Select returned %d rows" % len(rows) + +for r in rows: + print " %s %s\t%s" % (r[0], r[1], r[2]) +curs.execute("delete from test_copy") +conn.commit() + +# copy_from using custom separator, from open file + +io = open('copy_from.txt', 'wr') +data = ['Tom:Jenkins:37\n', + 'Madonna:\N:45\n', + 'Federico:Di Gregorio:\N\n'] +io.writelines(data) +io.close() + +io = open('copy_from.txt', 'r') +curs.copy_from(io, 'test_copy', ':') +print "2) Copy %d records from file object using sep = :" % len(data) +io.close() + +curs.execute("SELECT * FROM test_copy") +rows = curs.fetchall() +print " Select returned %d rows" % len(rows) + +for r in rows: + print " %s %s\t%s" % (r[0], r[1], r[2]) +curs.execute("delete from test_copy") +conn.commit() + +# copy_from using custom null identifier, from open file + +io = open('copy_from.txt', 'wr') +data = ['Tom\tJenkins\t37\n', + 'Madonna\tNULL\t45\n', + 'Federico\tDi Gregorio\tNULL\n'] +io.writelines(data) +io.close() + +io = open('copy_from.txt', 'r') +curs.copy_from(io, 'test_copy', null='NULL') +print "3) Copy %d records from file object using null = NULL" % len(data) +io.close() + +curs.execute("SELECT * FROM test_copy") +rows = curs.fetchall() +print " Select using cursor returned %d rows" % len(rows) + +for r in rows: + print " %s %s\t%s" % (r[0], r[1], r[2]) +curs.execute("delete from test_copy") +conn.commit() + +# copy_from using custom separator and null identifier + +io = open('copy_from.txt', 'wr') +data = ['Tom:Jenkins:37\n', 'Madonna:NULL:45\n', 'Federico:Di Gregorio:NULL\n'] +io.writelines(data) +io.close() + +io = open('copy_from.txt', 'r') +curs.copy_from(io, 'test_copy', ':', 'NULL') +print "4) Copy %d records from file object " % len(data) + \ + "using sep = : and null = NULL" +io.close() + +curs.execute("SELECT * FROM test_copy") +rows = curs.fetchall() +print " Select using cursor returned %d rows" % len(rows) + +for r in rows: + print " %s %s\t%s" % (r[0], r[1], r[2]) +curs.execute("delete from test_copy") +conn.commit() + +# anything can be used as a file if it has .read() and .readline() methods + +data = StringIO.StringIO() +data.write('\n'.join(['Tom\tJenkins\t37', + 'Madonna\t\N\t45', + 'Federico\tDi Gregorio\t\N'])) +data.seek(0) + +curs.copy_from(data, 'test_copy') +print "5) Copy 3 records from StringIO object using defaults" + +curs.execute("SELECT * FROM test_copy") +rows = curs.fetchall() +print " Select using cursor returned %d rows" % len(rows) + +for r in rows: + print " %s %s\t%s" % (r[0], r[1], r[2]) +curs.execute("delete from test_copy") +conn.commit() + +# simple error test + +print "6) About to raise an error" +data = StringIO.StringIO() +data.write('\n'.join(['Tom\tJenkins\t37', + 'Madonna\t\N\t45', + 'Federico\tDi Gregorio\taaa'])) +data.seek(0) + +try: + curs.copy_from(data, 'test_copy') +except StandardError, err: + conn.rollback() + print " Catched error (as expected):\n", err + +conn.rollback() + +curs.execute("DROP TABLE test_copy") +os.unlink('copy_from.txt') +conn.commit() + + + diff --git a/psycopg2/examples/copy_to.py b/psycopg2/examples/copy_to.py new file mode 100644 index 00000000..5570fbc4 --- /dev/null +++ b/psycopg2/examples/copy_to.py @@ -0,0 +1,104 @@ +# copy_to.py -- example about copy_to +# +# Copyright (C) 2002 Tom Jenkins <tjenkins@devis.com> +# Copyright (C) 2005 Federico Di Gregorio <fog@initd.org> +# +# 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 the +# Free Software Foundation; either version 2, or (at your option) any later +# version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# + +## put in DSN your DSN string + +DSN = 'dbname=test' + +## don't modify anything below tis line (except for experimenting) + +import sys +import os +import StringIO +import psycopg2 + +if len(sys.argv) > 1: + DSN = sys.argv[1] + +print "Opening connection using dns:", DSN +conn = psycopg2.connect(DSN) +print "Encoding for this connection is", conn.encoding + +curs = conn.cursor() +try: + curs.execute("CREATE TABLE test_copy (fld1 text, fld2 text, fld3 int4)") +except: + conn.rollback() + curs.execute("DROP TABLE test_copy") + curs.execute("CREATE TABLE test_copy (fld1 text, fld2 text, fld3 int4)") +conn.commit() + +# demostrate copy_to functionality +data = [('Tom', 'Jenkins', '37'), + ('Madonna', None, '45'), + ('Federico', 'Di Gregorio', None)] +query = "INSERT INTO test_copy VALUES (%s, %s, %s)" +curs.executemany(query, data) +conn.commit() + +# copy_to using defaults +io = open('copy_to.txt', 'w') +curs.copy_to(io, 'test_copy') +print "1) Copy %d records into file object using defaults: " % len (data) + \ + "sep = \\t and null = \\N" +io.close() + +rows = open('copy_to.txt', 'r').readlines() +print " File has %d rows:" % len(rows) + +for r in rows: + print " ", r, + +# copy_to using custom separator +io = open('copy_to.txt', 'w') +curs.copy_to(io, 'test_copy', ':') +print "2) Copy %d records into file object using sep = :" % len(data) +io.close() + +rows = open('copy_to.txt', 'r').readlines() +print " File has %d rows:" % len(rows) + +for r in rows: + print " ", r, + +# copy_to using custom null identifier +io = open('copy_to.txt', 'w') +curs.copy_to(io, 'test_copy', null='NULL') +print "3) Copy %d records into file object using null = NULL" % len(data) +io.close() + +rows = open('copy_to.txt', 'r').readlines() +print " File has %d rows:" % len(rows) + +for r in rows: + print " ", r, + +# copy_to using custom separator and null identifier +io = open('copy_to.txt', 'w') +curs.copy_to(io, 'test_copy', ':', 'NULL') +print "4) Copy %d records into file object using sep = : and null ) NULL" % \ + len(data) +io.close() + +rows = open('copy_to.txt', 'r').readlines() +print " File has %d rows:" % len(rows) + +for r in rows: + print " ", r, + +curs.execute("DROP TABLE test_copy") +os.unlink('copy_to.txt') +conn.commit() diff --git a/psycopg2/examples/cursor.py b/psycopg2/examples/cursor.py new file mode 100644 index 00000000..54cb5e7d --- /dev/null +++ b/psycopg2/examples/cursor.py @@ -0,0 +1,63 @@ +# cursor.py - how to subclass the cursor type +# +# Copyright (C) 2004 Federico Di Gregorio <fog@debian.org> +# +# 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 the +# Free Software Foundation; either version 2, or (at your option) any later +# version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. + +## put in DSN your DSN string + +DSN = 'dbname=test' + +## don't modify anything below this line (except for experimenting) + +import sys +import psycopg2 +import psycopg2.extensions + +if len(sys.argv) > 1: + DSN = sys.argv[1] + +print "Opening connection using dsn:", DSN +conn = psycopg2.connect(DSN) +print "Encoding for this connection is", conn.encoding + + +class NoDataError(psycopg2.ProgrammingError): + """Exception that will be raised by our cursor.""" + pass + +class Cursor(psycopg2.extensions.cursor): + """A custom cursor.""" + + def fetchone(self): + """Like fetchone but raise an exception if no data is available. + + Note that to have .fetchmany() and .fetchall() to raise the same + exception we'll have to override them too; even if internally psycopg + uses the same function to fetch rows, the code path from Python is + different. + """ + d = psycopg2.extensions.cursor.fetchone(self) + if d is None: + raise NoDataError("no more data") + return d + +curs = conn.cursor(cursor_factory=Cursor) +curs.execute("SELECT 1 AS foo") +print "Result of fetchone():", curs.fetchone() + +# now let's raise the exception +try: + curs.fetchone() +except NoDataError, err: + print "Exception caugth:", err + +conn.rollback() diff --git a/psycopg2/examples/dialtone.py b/psycopg2/examples/dialtone.py new file mode 100644 index 00000000..3a55686d --- /dev/null +++ b/psycopg2/examples/dialtone.py @@ -0,0 +1,144 @@ +""" +This example/recipe has been contributed by Valentino Volonghi (dialtone) + +Mapping arbitrary objects to a PostgreSQL database with psycopg2 + +- Problem + +You need to store arbitrary objects in a PostgreSQL database without being +intrusive for your classes (don't want inheritance from an 'Item' or +'Persistent' object). + +- Solution +""" + +from datetime import datetime + +import psycopg2 +from psycopg2.extensions import adapt, register_adapter + +try: + sorted() +except: + def sorted(seq): + seq.sort() + return seq + +# Here is the adapter for every object that we may ever need to +# insert in the database. It receives the original object and does +# its job on that instance + +class ObjectMapper(object): + def __init__(self, orig, curs=None): + self.orig = orig + self.tmp = {} + self.items, self.fields = self._gatherState() + + def _gatherState(self): + adaptee_name = self.orig.__class__.__name__ + fields = sorted([(field, getattr(self.orig, field)) + for field in persistent_fields[adaptee_name]]) + items = [] + for item, value in fields: + items.append(item) + return items, fields + + def getTableName(self): + return self.orig.__class__.__name__ + + def getMappedValues(self): + tmp = [] + for i in self.items: + tmp.append("%%(%s)s"%i) + return ", ".join(tmp) + + def getValuesDict(self): + return dict(self.fields) + + def getFields(self): + return self.items + + def generateInsert(self): + qry = "INSERT INTO" + qry += " " + self.getTableName() + " (" + qry += ", ".join(self.getFields()) + ") VALUES (" + qry += self.getMappedValues() + ")" + return qry, self.getValuesDict() + +# Here are the objects +class Album(object): + id = 0 + def __init__(self): + self.creation_time = datetime.now() + self.album_id = self.id + Album.id = Album.id + 1 + self.binary_data = buffer('12312312312121') + +class Order(object): + id = 0 + def __init__(self): + self.items = ['rice','chocolate'] + self.price = 34 + self.order_id = self.id + Order.id = Order.id + 1 + +register_adapter(Album, ObjectMapper) +register_adapter(Order, ObjectMapper) + +# Describe what is needed to save on each object +# This is actually just configuration, you can use xml with a parser if you +# like to have plenty of wasted CPU cycles ;P. + +persistent_fields = {'Album': ['album_id', 'creation_time', 'binary_data'], + 'Order': ['order_id', 'items', 'price'] + } + +print adapt(Album()).generateInsert() +print adapt(Album()).generateInsert() +print adapt(Album()).generateInsert() +print adapt(Order()).generateInsert() +print adapt(Order()).generateInsert() +print adapt(Order()).generateInsert() + +""" +- Discussion + +Psycopg 2 has a great new feature: adaptation. The big thing about +adaptation is that it enable the programmer to glue most of the +code out there without many difficulties. + +This recipe tries to focus the attention on a way to generate SQL queries to +insert completely new objects inside a database. As you can see objects do +not know anything about the code that is handling them. We specify all the +fields that we need for each object through the persistent_fields dict. + +The most important lines of this recipe are: + register_adapter(Album, ObjectMapper) + register_adapter(Order, ObjectMapper) + +In these line we notify the system that when we call adapt with an Album instance +as an argument we want it to istantiate ObjectMapper passing the Album instance +as argument (self.orig in the ObjectMapper class). + +The output is something like this (for each call to generateInsert): + +('INSERT INTO Album (album_id, binary_data, creation_time) VALUES + (%(album_id)s, %(binary_data)s, %(creation_time)s)', + + {'binary_data': <read-only buffer for 0x402de070, ...>, + 'creation_time': datetime.datetime(2004, 9, 10, 20, 48, 29, 633728), + 'album_id': 1} +) + +This is a tuple of {SQL_QUERY, FILLING_DICT}, and all the quoting/converting +stuff (from python's datetime to postgres s and from python's buffer to +postgres' blob) is handled with the same adaptation process hunder the hood +by psycopg2. + +At last, just notice that ObjectMapper is working for both Album and Order +instances without any glitches at all, and both classes could have easily been +coming from closed source libraries or C coded ones (which are not easily +modified), whereas a common pattern in todays ORMs or OODBs is to provide +a basic 'Persistent' object that already knows how to store itself in the +database. +""" diff --git a/psycopg2/examples/dict.py b/psycopg2/examples/dict.py new file mode 100644 index 00000000..37dc74a8 --- /dev/null +++ b/psycopg2/examples/dict.py @@ -0,0 +1,45 @@ +# dict.py - using DictCUrsor/DictRow +# +# Copyright (C) 2005 Federico Di Gregorio <fog@debian.org> +# +# 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 the +# Free Software Foundation; either version 2, or (at your option) any later +# version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. + +## put in DSN your DSN string + +DSN = 'dbname=test' + +## don't modify anything below this line (except for experimenting) + +import sys +import psycopg2 +import psycopg2.extras + +if len(sys.argv) > 1: + DSN = sys.argv[1] + +print "Opening connection using dsn:", DSN +conn = psycopg2.connect(DSN) +print "Encoding for this connection is", conn.encoding + + +curs = conn.cursor(cursor_factory=psycopg2.extras.DictCursor) +curs.execute("SELECT 1 AS foo, 'cip' AS bar, date(now()) as zot") + +data = curs.fetchone() +print "Some data accessed both as tuple and dict:" +print " ", data['foo'], data['bar'], data['zot'] +print " ", data[0], data[1], data[2] + +# execute another query and demostrate we can still access the row +curs.execute("SELECT 2 AS foo") +print "Some more data accessed both as tuple and dict:" +print " ", data['foo'], data['bar'], data['zot'] +print " ", data[0], data[1], data[2] diff --git a/psycopg2/examples/dt.py b/psycopg2/examples/dt.py new file mode 100644 index 00000000..76f0c781 --- /dev/null +++ b/psycopg2/examples/dt.py @@ -0,0 +1,99 @@ +# datetime.py - example of using date and time types +# +# Copyright (C) 2001-2004 Federico Di Gregorio <fog@debian.org> +# +# 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 the +# Free Software Foundation; either version 2, or (at your option) any later +# version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. + +## put in DSN your DSN string + +DSN = 'dbname=test' + +## don't modify anything below tis line (except for experimenting) + +import sys +import psycopg2 +import mx.DateTime +import datetime + +from psycopg2.extensions import adapt + +if len(sys.argv) > 1: + DSN = sys.argv[1] + +print "Opening connection using dns:", DSN +conn = psycopg2.connect(DSN) +curs = conn.cursor() + +try: + curs.execute("""CREATE TABLE test_dt ( + k int4, d date, t time, dt timestamp, z interval)""") +except: + conn.rollback() + curs.execute("DROP TABLE test_dt") + curs.execute("""CREATE TABLE test_dt ( + k int4, d date, t time, dt timestamp, z interval)""") +conn.commit() + +# build and insert some data using mx.DateTime +mx1 = ( + 1, + mx.DateTime.Date(2004, 10, 19), + mx.DateTime.Time(0, 11, 17.015), + mx.DateTime.Timestamp(2004, 10, 19, 0, 11, 17.5), + mx.DateTime.DateTimeDelta(13, 15, 17, 59.9)) + +from psycopg2.extensions import adapt +import psycopg2.extras +print adapt(mx1) + +print "Inserting mx.DateTime values..." +curs.execute("INSERT INTO test_dt VALUES (%s, %s, %s, %s, %s)", mx1) + +# build and insert some values using the datetime adapters +dt1 = ( + 2, + datetime.date(2004, 10, 19), + datetime.time(0, 11, 17, 15000), + datetime.datetime(2004, 10, 19, 0, 11, 17, 500000), + datetime.timedelta(13, 15*3600+17*60+59, 900000)) + +print "Inserting Python datetime values..." +curs.execute("INSERT INTO test_dt VALUES (%s, %s, %s, %s, %s)", dt1) + +# now extract the row from database and print them +print "Extracting values inserted with mx.DateTime wrappers:" +curs.execute("SELECT d, t, dt, z FROM test_dt WHERE k = 1") +for n, x in zip(mx1[1:], curs.fetchone()): + try: + # this will work only is psycopg has been compiled with datetime + # as the default typecaster for date/time values + s = repr(n) + "\n -> " + str(adapt(n)) + \ + "\n -> " + repr(x) + "\n -> " + x.isoformat() + except: + s = repr(n) + "\n -> " + str(adapt(n)) + \ + "\n -> " + repr(x) + "\n -> " + str(x) + print s +print + +print "Extracting values inserted with Python datetime wrappers:" +curs.execute("SELECT d, t, dt, z FROM test_dt WHERE k = 2") +for n, x in zip(dt1[1:], curs.fetchone()): + try: + # this will work only is psycopg has been compiled with datetime + # as the default typecaster for date/time values + s = repr(n) + "\n -> " + repr(x) + "\n -> " + x.isoformat() + except: + s = repr(n) + "\n -> " + repr(x) + "\n -> " + str(x) + print s +print + +curs.execute("DROP TABLE test_dt") +conn.commit() diff --git a/psycopg2/examples/encoding.py b/psycopg2/examples/encoding.py new file mode 100644 index 00000000..da57bcf1 --- /dev/null +++ b/psycopg2/examples/encoding.py @@ -0,0 +1,105 @@ +# enkoding.py - show to change client enkoding (and test it works) +# -*- encoding: utf8 -*- +# +# Copyright (C) 2004 Federico Di Gregorio <fog@debian.org> +# +# 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 the +# Free Software Foundation; either version 2, or (at your option) any later +# version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. + +## put in DSN your DSN string + +DSN = 'dbname=test' + +## don't modify anything below this line (except for experimenting) + +import sys +import psycopg2 +import psycopg2.extensions + +if len(sys.argv) > 1: + DSN = sys.argv[1] + +print "Opening connection using dns:", DSN +conn = psycopg2.connect(DSN) +print "Initial encoding for this connection is", conn.encoding + +print "\n** This example is supposed to be run in a UNICODE terminal! **\n" + +print "Available encodings:" +encs = psycopg2.extensions.encodings.items() +encs.sort() +for a, b in encs: + print " ", a, "<->", b + +print "Using STRING typecaster" +print "Setting backend encoding to LATIN1 and executing queries:" +conn.set_client_encoding('LATIN1') +curs = conn.cursor() +curs.execute("SELECT %s::TEXT AS foo", ('Ã èìòù',)) +x = curs.fetchone()[0] +print " ->", unicode(x, 'latin-1').encode('utf-8'), type(x) +curs.execute("SELECT %s::TEXT AS foo", (u'Ã èìòù',)) +x = curs.fetchone()[0] +print " ->", unicode(x, 'latin-1').encode('utf-8'), type(x) + +print "Setting backend encoding to UTF8 and executing queries:" +conn.set_client_encoding('UNICODE') +curs = conn.cursor() +curs.execute("SELECT %s::TEXT AS foo", (u'Ã èìòù'.encode('utf-8'),)) +x = curs.fetchone()[0] +print " ->", x, type(x) +curs.execute("SELECT %s::TEXT AS foo", (u'Ã èìòù',)) +x = curs.fetchone()[0] +print " ->", x, type(x) + +print "Using UNICODE typecaster" +psycopg2.extensions.register_type(psycopg2.extensions.UNICODE) + +print "Setting backend encoding to LATIN1 and executing queries:" +conn.set_client_encoding('LATIN1') +curs = conn.cursor() +curs.execute("SELECT %s::TEXT AS foo", ('Ã èìòù',)) +x = curs.fetchone()[0] +print " ->", x.encode('utf-8'), ":", type(x) +curs.execute("SELECT %s::TEXT AS foo", (u'Ã èìòù',)) +x = curs.fetchone()[0] +print " ->", x.encode('utf-8'), ":", type(x) + +print "Setting backend encoding to UTF8 and executing queries:" +conn.set_client_encoding('UNICODE') +curs = conn.cursor() +curs.execute("SELECT %s::TEXT AS foo", (u'Ã èìòù'.encode('utf-8'),)) +x = curs.fetchone()[0] +print " ->", x.encode('utf-8'), ":", type(x) +curs.execute("SELECT %s::TEXT AS foo", (u'Ã èìòù',)) +x = curs.fetchone()[0] +print " ->", x.encode('utf-8'), ":", type(x) + +print "Executing full UNICODE queries" + +print "Setting backend encoding to LATIN1 and executing queries:" +conn.set_client_encoding('LATIN1') +curs = conn.cursor() +curs.execute(u"SELECT %s::TEXT AS foo", ('Ã èìòù',)) +x = curs.fetchone()[0] +print " ->", x.encode('utf-8'), ":", type(x) +curs.execute(u"SELECT %s::TEXT AS foo", (u'Ã èìòù',)) +x = curs.fetchone()[0] +print " ->", x.encode('utf-8'), ":", type(x) + +print "Setting backend encoding to UTF8 and executing queries:" +conn.set_client_encoding('UNICODE') +curs = conn.cursor() +curs.execute(u"SELECT %s::TEXT AS foo", (u'Ã èìòù'.encode('utf-8'),)) +x = curs.fetchone()[0] +print " ->", x.encode('utf-8'), ":", type(x) +curs.execute(u"SELECT %s::TEXT AS foo", (u'Ã èìòù',)) +x = curs.fetchone()[0] +print " ->", x.encode('utf-8'), ":", type(x) diff --git a/psycopg2/examples/fetch.py b/psycopg2/examples/fetch.py new file mode 100644 index 00000000..dab0a412 --- /dev/null +++ b/psycopg2/examples/fetch.py @@ -0,0 +1,81 @@ +# fetch.py -- example about declaring cursors +# +# Copyright (C) 2001-2005 Federico Di Gregorio <fog@debian.org> +# +# 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 the +# Free Software Foundation; either version 2, or (at your option) any later +# version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# + +## put in DSN your DSN string + +DSN = 'dbname=test' + +## don't modify anything below tis line (except for experimenting) + +import sys +import psycopg2 + +if len(sys.argv) > 1: + DSN = sys.argv[1] + +print "Opening connection using dns:", DSN +conn = psycopg2.connect(DSN) +print "Encoding for this connection is", conn.encoding + +curs = conn.cursor() +try: + curs.execute("CREATE TABLE test_fetch (val int4)") +except: + conn.rollback() + curs.execute("DROP TABLE test_fetch") + curs.execute("CREATE TABLE test_fetch (val int4)") +conn.commit() + +# we use this function to format the output + +def flatten(l): + """Flattens list of tuples l.""" + return map(lambda x: x[0], l) + +# insert 20 rows in the table + +for i in range(20): + curs.execute("INSERT INTO test_fetch VALUES(%s)", (i,)) +conn.commit() + +# does some nice tricks with the transaction and postgres cursors +# (remember to always commit or rollback before a DECLARE) +# +# we don't need to DECLARE ourselves, psycopg now support named +# cursors (but we leave the code here, comments, as an example of +# what psycopg is doing under the hood) +# +#curs.execute("DECLARE crs CURSOR FOR SELECT * FROM test_fetch") +#curs.execute("FETCH 10 FROM crs") +#print "First 10 rows:", flatten(curs.fetchall()) +#curs.execute("MOVE -5 FROM crs") +#print "Moved back cursor by 5 rows (to row 5.)" +#curs.execute("FETCH 10 FROM crs") +#print "Another 10 rows:", flatten(curs.fetchall()) +#curs.execute("FETCH 10 FROM crs") +#print "The remaining rows:", flatten(curs.fetchall()) + +ncurs = conn.cursor("crs") +ncurs.execute("SELECT * FROM test_fetch") +print "First 10 rows:", flatten(ncurs.fetchmany(10)) +ncurs.scroll(-5) +print "Moved back cursor by 5 rows (to row 5.)" +print "Another 10 rows:", flatten(ncurs.fetchmany(10)) +print "Another one:", list(ncurs.fetchone()) +print "The remaining rows:", flatten(ncurs.fetchall()) +conn.rollback() + +curs.execute("DROP TABLE test_fetch") +conn.commit() diff --git a/psycopg2/examples/lastrowid.py b/psycopg2/examples/lastrowid.py new file mode 100644 index 00000000..205ef6ce --- /dev/null +++ b/psycopg2/examples/lastrowid.py @@ -0,0 +1,59 @@ +# lastrowid.py - example of using .lastrowid attribute +# +# Copyright (C) 2001-2004 Federico Di Gregorio <fog@debian.org> +# +# 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 the +# Free Software Foundation; either version 2, or (at your option) any later +# version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. + +## put in DSN your DSN string + +DSN = 'dbname=test' + +## don't modify anything below tis line (except for experimenting) + +import sys, psycopg2 + +if len(sys.argv) > 1: + DSN = sys.argv[1] + +print "Opening connection using dns:", DSN +conn = psycopg2.connect(DSN) +curs = conn.cursor() + +try: + curs.execute("CREATE TABLE test_oid (name text, surname text)") +except: + conn.rollback() + curs.execute("DROP TABLE test_oid") + curs.execute("CREATE TABLE test_oid (name text, surname text)") +conn.commit() + +data = ({'name':'Federico', 'surname':'Di Gregorio'}, + {'name':'Pierluigi', 'surname':'Di Nunzio'}) + +curs.execute("""INSERT INTO test_oid + VALUES (%(name)s, %(surname)s)""", data[0]) + +foid = curs.lastrowid +print "Oid for %(name)s %(surname)s" % data[0], "is", foid + +curs.execute("""INSERT INTO test_oid + VALUES (%(name)s, %(surname)s)""", data[1]) +moid = curs.lastrowid +print "Oid for %(name)s %(surname)s" % data[1], "is", moid + +curs.execute("SELECT * FROM test_oid WHERE oid = %s", (foid,)) +print "Oid", foid, "selected %s %s" % curs.fetchone() + +curs.execute("SELECT * FROM test_oid WHERE oid = %s", (moid,)) +print "Oid", moid, "selected %s %s" % curs.fetchone() + +curs.execute("DROP TABLE test_oid") +conn.commit() diff --git a/psycopg2/examples/mogrify.py b/psycopg2/examples/mogrify.py new file mode 100644 index 00000000..480c4919 --- /dev/null +++ b/psycopg2/examples/mogrify.py @@ -0,0 +1,47 @@ +# mogrify.py - test all possible simple type mogrifications +# -*- encoding: latin1 -*- +# +# Copyright (C) 2004 Federico Di Gregorio <fog@debian.org> +# +# 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 the +# Free Software Foundation; either version 2, or (at your option) any later +# version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. + +## put in DSN your DSN string + +DSN = 'dbname=test' + +## don't modify anything below this line (except for experimenting) + +import sys, psycopg2 + +if len(sys.argv) > 1: + DSN = sys.argv[1] + +print "Opening connection using dns:", DSN + +conn = psycopg2.connect(DSN) +print "Encoding for this connection is", conn.encoding + +curs = conn.cursor() +curs.execute("SELECT %(foo)s AS foo", {'foo':'bar'}) +curs.execute("SELECT %(foo)s AS foo", {'foo':None}) +curs.execute("SELECT %(foo)s AS foo", {'foo':True}) +curs.execute("SELECT %(foo)s AS foo", {'foo':42}) +curs.execute("SELECT %(foo)s AS foo", {'foo':u'yatt�!'}) +curs.execute("SELECT %(foo)s AS foo", {'foo':u'bar'}) + +print curs.mogrify("SELECT %(foo)s AS foo", {'foo':'bar'}) +print curs.mogrify("SELECT %(foo)s AS foo", {'foo':None}) +print curs.mogrify("SELECT %(foo)s AS foo", {'foo':True}) +print curs.mogrify("SELECT %(foo)s AS foo", {'foo':42}) +print curs.mogrify("SELECT %(foo)s AS foo", {'foo':u'yatt�!'}) +print curs.mogrify("SELECT %(foo)s AS foo", {'foo':u'bar'}) + +conn.rollback() diff --git a/psycopg2/examples/myfirstrecipe.py b/psycopg2/examples/myfirstrecipe.py new file mode 100644 index 00000000..4ddc65e2 --- /dev/null +++ b/psycopg2/examples/myfirstrecipe.py @@ -0,0 +1,122 @@ +""" +Using a tuple as a bound variable in "SELECT ... IN (...)" clauses +in PostgreSQL using psycopg 2 + +Some time ago someone asked on the psycopg mailing list how to have a +bound variable expand to the right SQL for an SELECT IN clause: + + SELECT * FROM atable WHERE afield IN (value1, value2, value3) + +with the values to be used in the IN clause to be passed to the cursor +.execute() method in a tuple as a bound variable, i.e.: + + in_values = ("value1", "value2", "value3") + curs.execute("SELECT ... IN %s", (in_values,)) + +psycopg 1 does support typecasting from Python to PostgreSQL (and back) +only for simple types and this problem has no elegant solution (short or +writing a wrapper class returning the pre-quoted text in an __str__ +method. + +But psycopg 2 offers a simple and elegant solution by partially +implementing the Object Adaptation from PEP 246. psycopg 2 (still in +beta and currently labeled as 1.99.9) moves the type-casting logic into +external adapters and a somehow broken adapt() function. + +While the original adapt() takes 3 arguments, psycopg's one only takes +1: the bound variable to be adapted. The result is an object supporting +a not-yet well defined protocol that we can call IPsycopgSQLQuote: + + class IPsycopgSQLQuote: + + def getquoted(self): + "Returns a quoted string representing the bound variable." + + def getbinary(self): + "Returns a binary quoted string representing the bound variable." + + def getbuffer(self): + "Returns the wrapped object itself." + + __str__ = getquoted + +Then one of the functions (usually .getquoted()) is called by psycopg at +the right time to obtain the right, sql-quoted representation for the +corresponding bound variable. + +The nice part is that the default, built-in adapters, derived from +psycopg 1 tyecasting code can be overridden by the programmer, simply +replacing them in the psycopg.extensions.adapters dictionary. + +Then the solution to the original problem is now obvious: write an +adapter that adapts tuple objects into the right SQL string, by calling +recursively adapt() on each element. + +Note: psycopg 2 adapter code is still very young and will probably move +to a more 'standard' (3 arguments) implementation for the adapt() +function; as long as that does not slow down too much query execution. + +Psycopg 2 development can be tracked on the psycopg mailing list: + + http://lists.initd.org/mailman/listinfo/psycopg + +and on the psycopg 2 wiki: + + http://wiki.initd.org/Projects/Psycopg2 + +""" + +import psycopg2 +import psycopg2.extensions +from psycopg2.extensions import adapt as psycoadapt +from psycopg2.extensions import register_adapter + +class AsIs(object): + """An adapter that just return the object 'as is'. + + psycopg 1.99.9 has some optimizations that make impossible to call + adapt() without adding some basic adapters externally. This limitation + will be lifted in a future release. + """ + def __init__(self, obj): + self.__obj = obj + def getquoted(self): + return self.__obj + +class SQL_IN(object): + """Adapt a tuple to an SQL quotable object.""" + + def __init__(self, seq): + self._seq = seq + + def prepare(self, conn): + pass + + def getquoted(self): + # this is the important line: note how every object in the + # list is adapted and then how getquoted() is called on it + + qobjs = [str(psycoadapt(o).getquoted()) for o in self._seq] + + return '(' + ', '.join(qobjs) + ')' + + __str__ = getquoted + + +# add our new adapter class to psycopg list of adapters +register_adapter(tuple, SQL_IN) +register_adapter(float, AsIs) +register_adapter(int, AsIs) + +# usually we would call: +# +# conn = psycopg.connect("...") +# curs = conn.cursor() +# curs.execute("SELECT ...", (("this", "is", "the", "tuple"),)) +# +# but we have no connection to a database right now, so we just check +# the SQL_IN class by calling psycopg's adapt() directly: + +if __name__ == '__main__': + print "Note how the string will be SQL-quoted, but the number will not:" + print psycoadapt(("this is an 'sql quoted' str\\ing", 1, 2.0)) diff --git a/psycopg2/examples/notify.py b/psycopg2/examples/notify.py new file mode 100644 index 00000000..83761b9d --- /dev/null +++ b/psycopg2/examples/notify.py @@ -0,0 +1,43 @@ +# notify.py - example of getting notifies +# +# Copyright (C) 2001-2005 Federico Di Gregorio <fog@debian.org> +# +# 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 the +# Free Software Foundation; either version 2, or (at your option) any later +# version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. + +## put in DSN your DSN string + +DSN = 'dbname=test' + +## don't modify anything below tis line (except for experimenting) + +import sys +import psycopg2 +import select + +if len(sys.argv) > 1: + DSN = sys.argv[1] + +print "Opening connection using dns:", DSN +conn = psycopg2.connect(DSN) +print "Encoding for this connection is", conn.encoding + +conn.set_isolation_level(0) +curs = conn.cursor() + +curs.execute("listen test") + +print "Waiting for 'NOTIFY test'" +while 1: + if select.select([curs],[],[],5)==([],[],[]): + print "Timeout" + else: + if curs.isready(): + print "Got NOTIFY: %s" % str(curs.connection.notifies.pop()) diff --git a/psycopg2/examples/simple.py b/psycopg2/examples/simple.py new file mode 100644 index 00000000..2306be10 --- /dev/null +++ b/psycopg2/examples/simple.py @@ -0,0 +1,53 @@ +# simple.py - very simple example of plain DBAPI-2.0 usage +# currently used as test-me-stress-me script for psycopg 2.0 +# +# Copyright (C) 2001-2003 Federico Di Gregorio <fog@debian.org> +# +# 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 the +# Free Software Foundation; either version 2, or (at your option) any later +# version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. + +## put in DSN your DSN string + +DSN = 'dbname=test' + +## don't modify anything below this line (except for experimenting) + +class SimpleQuoter(object): + def sqlquote(x=None): + return "'bar'" + +import sys +import psycopg2 + +if len(sys.argv) > 1: + DSN = sys.argv[1] + +print "Opening connection using dns:", DSN +conn = psycopg2.connect(DSN) +print "Encoding for this connection is", conn.encoding + +curs = conn.cursor() +curs.execute("SELECT 1 AS foo") +print curs.fetchone() +curs.execute("SELECT 1 AS foo") +print curs.fetchmany() +curs.execute("SELECT 1 AS foo") +print curs.fetchall() + +conn.rollback() + +sys.exit(0) + +curs.execute("SELECT 1 AS foo", async=1) + +curs.execute("SELECT %(foo)s AS foo", {'foo':'bar'}) +curs.execute("SELECT %(foo)s AS foo", {'foo':None}) +curs.execute("SELECT %(foo)f AS foo", {'foo':42}) +curs.execute("SELECT %(foo)s AS foo", {'foo':SimpleQuoter()}) diff --git a/psycopg2/examples/somehackers.jpg b/psycopg2/examples/somehackers.jpg new file mode 100644 index 0000000000000000000000000000000000000000..8bb6e013f8859dbeff0e11a88c4c3ff641aa79dc GIT binary patch literal 22565 zcmb4<RZtrYz-1GH6h5R_aVt=q;;zLlxJwJcJ;AM5afhPCihFUFmH@#i?iwiW?mPd^ z&g{PKdAKuo=FWXMuM4jmfVax>O7Z|85C~8NC;|Yl%K#a`8+3FGbhI}Z7#NtCZ?Le5 zaIpXT51WjD5RZt8oQ9f;oRX53fs={$Jv%)mC9@z4I~O+}A0G{qu(%M97$+|u&;OhN zF)=Z*|HCH5!6D_Lqom{c|K{~K0RIh;9he9L;sa3dfgpU~Yaf6D005!^fq?%D3J`>f zh7Q1Z?E@&k{hx*cLd8G>VPc@7fB--g5C9dQfDVmYno!dmica*NCpf8&{?pGtlUf#= z#0<RrFt_Bh^LLDVG9fATvf7YPodS&Bsn<RL84v*aA1nV4Kok%v+G`(x0Urnipn(2Q z{O<`61s_DmO(6ZA2bECM{1fzb34jd(0#NWl_y9>j<=s5JD?b3P%P{g6TT(0<VjYRP zOSFkPSsUjKwUO9;5O~neO;gp7`@LLj9~Z6z^d$O7v9unNZLGBV>!OH9vbQDc%$?w? zb#nc=U9@T+GdF(svmMqb^w*)@%kZomax<imU$v#+8$+;s#B?L<ya4{-8Jeg*^_}C$ zSHZOe3tyd|taL*JA9|9IN{?v}bxY*W@`p2OaX_B$<8aJR7!!o#sJu|41bp;<90f1+ z9nI_$U5MCYNOlfhRpggQ{BLAueBCOC^`u`Y5lH!jlf-^ZM7_dz99}z;$Y6mcGe2PJ zY?fyDtZbXcamI3b#b`;XD4#F~fU&C@Iu)dhlYzumdjt(hp+w=lm7&`%+|?~ulPo^6 zV!)A%BNyM|?1c`}glhimR9am5B0z(R6e+v^SY;AmF3m6qIIIX=dGe@=pNE3zo#Ce% zzIL75vNjJ}0)^JrUPnk&h+7wJjn_vy3*l2E+4)jx!+jIA-c?(43SU3^kDIFH;r(cZ zHq~4pX{UEjN#@X&r{)J;b$K)H4ZW(p54ZkftexUUXPQrwuYk^{GO>iSM32>+c&leS zwvX>}i83R7v=$>T`+@05vKK?>bJ86a)O$Q>1u5YHO#(Fw=V4jZM>s|c__5}w^4Nh| z$KgAw3~)O)mPb*a&yUP%YQs3%yAf;5H`Pqk(5%l|FS!*A&C}&;nDXnjwkxlILY)yg z*4RcZ;F`{4tDZ(uaITJOesW%dl9``J#X|^EB`GO%bowEz0u!*{_96ZifLCj`&9djn zh{2whLrxJt@J5(H3q#0$Hx}_+cvUvk`4VS{UQEt39G4biy8x_sk1xf<se`T^{R%Kt z-@Vt46AJ~)*iVKLg#Mx|%iramOA2;1myW;8s))i_AzWxl1*eNE)S0YHKmXKpFm<1v zY_yFa3gJL<CYB2S;~uV%)&P6x_RW{(>h`T*B=O;=?{;z7wTubrz+w4ux$b{DEkf!D zBPm@U^G=rc!M=ufLw3u=^*Czv2_m}QzO5VizDdh3=1=8vmR_Nj)kCj<9lmBC??$S- zG1lN97z+yWJfG)D|0_T3^UecS*)(+ld*;g3m<a?px;;%-hVg9scOgl7Em4FA*DkJP zd3^#1#5&$ITw&CyL_^Mx3?bl>)#?vW$^2J9<C82U$wc3z5cG*H)$38t6QS)K*lhO- zD18Me{GFdN4jVWBq%M}FANmTA9epxOQOPk40c|Esr9ZelOID|LF?dSMHY$A0rx~t% z)_+Nx_5XD39PdXg|NNKry!TI6Wn?wk@}dBhB)KJZL26wIQ>)Yj`Dc`M8AHqUS3r1W zsxr#T9uZRxD(;KUAcK>t5Eh8BFX3?@@K`&yshgUzQb8#ArfzdM8r_p>CUz-!5wWAI zOwlIvZKlH4B^>+wjY7h<J(~(rAzI1HgdC-POOrjQTokKS=g)+Pmcz8KK9!TyO7l{Y zjQV&PnXhYXYY7fj0_z(L^Om`wu)bw=>^8>$IM~<F8{vyM`O07W3NV8+WZeu1o)+Ya z`F5DOI{HSu0?eN(<Q2R>K8f|=#Fi8r-oFd-XW@M!{U^2u>VLav#zfgOd?^$yZ~7&K zq_;x%6>t%IfXIg7J=k{_N@igLyl`H~CGzhJa0@dfSp!`IYvL@WI`<wTxC)NxX?)XX zK1MU9@}5RZ<lmKwdOwKMX!vV5s6N7xU@MG%&!&Uk$^*RUW0eGN&1=FBpU<`wgPad9 zi?4~RdN%!JCpvMTxAJDx%{{dg8YSEV<UB#~-~9KVWet^T*XeiF4~SRj2IOA><Ufi> z)X$_VWAT_C$VXV0UjgAiD>P7ev(PZfi2lbsAz3~l>3$Z7&ff!y+0&v+;x8e<4-M8| z6ScAbf~5I!{C5hdc_b_8nX_nNefpk0Q6UH1SQUVWMRUsBEh(dIY&q$5Hzj421W{8P zbdu7Ef0$xi6E0C#8K3Q2;7}!p^oRh%^JBX-1bqHViT))!d4Ec%Lcr_EnY)yd)H78{ zw#;T<{N-DMyUlp>RCgIe2xC+RHl^33IWlz#`OOKg@U=ms>RI>?;93dKzjTk)zTwHp zOUveg_RalY2*qU)F0Ow9=YtePT*ZG+d=e$lZ&zxSc|F&bMn~rBD<Cm{r}*ga^WVUI zB1h+x*)L8VM3T>tt3sP=m4mbeL}mXg!1imZXyKmZ&`s$pKm}8B6-zYg0dw=l5_<_g za)U;r^U^E>XIB@smHeaI9;n0g?QF}dF=9K=NKobAhZsqC(ktLUnm-v|-JKKi1L@AX z)5>22p6yN&@&y5#-*#(hZYiz{-5nRN0wdfbUjeIp&T-!!#Nn5Xj*^Fb&UrIbEpM9Y z^P0a2`Qvw3x~N0!EH$L)i%~&!E1CePZmpUSQIH}i^QTCa$L5Cz3m$O8aD_m7;##@r z`Uugr%AKf5;SHiUe#GGWh=3qRte5tY{}y;nGr_KTr-`EYGNvd?37sqk4`2Rte<)UY z6C@_*Pu!hK{~<IGiy*>}8C1V6N_kb0SV2mxL|cm0#YXEhPyNG@-4^|GPj^V;vRetZ zpwX8_37xliK}6`jH=CBnA;hct80F&YVRo^{smCVyu<4#uN9jBilI3EyO{AaUS#_%s z&6-QK&BMGT*j4%m`tpnU1J;j&h9@KDqJ(E57L;HqA(4A66wp8rx76GGH`rQ2w9FV7 z9a1t|T|YOc-gsatk+Qn_L^G97v`s}mtUKa5hoI71JA3a=bT`gS=c*Pf*Qafo%^DfU z1^k>N`$6ujHDmX!?yLU+MRLebiBBOP#8`r|wSe@$wRxPR{zE${%?HK83Z;aodgB0Z zF_gcEkhE%`=y+*>f(NGsKFR#pk9;n9n9GnJdIsZ61P0i`Wn@Bpe6%X!Qxhx~Pm1$5 zr-yU)&~9X+^{53~T+M$R?I!bE&;9CTW|Y0SxpWv17+_P3kzVs>N%A?B7MBcJCL0XD z+6fxa>^dd?hoEX6-ZQb76D7?uh~dI6lwOC-^WAgb%M03XcrZJk8!C6;2%4p8#8JEd zX{PuqeS#7+G)^ond=vGYt=Ia{Pva^wS6r*AZm~GVwsn5(1edJPxNDhfc(%(c^`?CV zc!AdGo+>_;=Ed+YCChX9XrKxoX93hku?)>DQ5~ht#}nUnG)q22_6#s%p!H$A_y;11 zfKdganA%UDg1Fz)boXo#QIdLyWqx%J{xcl(iGNpXTLW~k{|abkIr31Z(|{4~Wa%ZI zc`hX-PP58P5CO7)IJ}to=ouhw;EohsJ}Qz3fZqhj=;xxU$3Y)(YyW<iS8W%3aUHd$ zTlj`~eD`Z(vuguzk#g!vKVSoMn`MgOhrAaNwM2SI>}uWf#8iFt#W~c2E`(qhC{~x{ zJvQfgRgMvGC`&@k@E1!kU(iI4=Se`T6ivJ)V0J{L+NP^PpY8o}Z@;1R;0zEWFL2<O zXzSd5e!VGo^E1={a`3S<&$n?}_I8?H6=n<ILt}co`S*|WrR)Wc(2a^E)xmjJL!A~$ zhwoaURGUy(gsN6ITf!rUci=UTkL1i;U^VOoarg1so^Uo!PM@jHDjHuF_&$ghhj#QF z`gA_X;OBlj*+=k(a#_Ni6=6@GDSVl)fFZn)1!$rUD-Q_|T$04s;-jO7WZr9Yeq%Hr z%oE>}+~Qn4Phty<oc!r=$JmiUiMjm>AbYmupfo<rdj-7z{1~UMJoC1v{S|Og{0eBd zoixPteO|-3EDt;(=QDcS-68qVCW&}rzDFUsEzFsIQsncGBe_>Tb2()H`ni~fDL;_S z4Ewo6;YML!VQ>omZC%~liV(5@BBl0Vv=~XddP8{k_l?gqy`}eGN?YJb2{c+Jb7d|A z*9DLA>QA)+4v()+`Lqk!B{A=Gw~*gJu2OKi?f6VZX{k4<cxUOYq)7BULk%6<O@Y{> z5KaPlr;Td0%sM^M;O<8e02nUZ&s|#X8%a<80<lMIQ4O(Psrgtt4aMS!$h&RIA%0#> zEE}#VkZIe|4GmfiNHpaQRJ@dg(%U8#BoaYK1(iAZ0+jJ7B-@KSTS^NS)3h*2R~(_; zEVg6G!0Fova3d-;YvAhCT~g0LC5?897%BdP{wGF$Xs4rJkCCBw71M>Wq0=92m)3P{ z!;c@2lK%8mLM|nZvTBr;{Ccco5w7`Jgp9-cZ=tq)_LBnHHjDy4i#A8>^jeb4(76f2 zgx2j9NB&EwkochByqnkjwXqyopz!DPpPB_#T`dz)cj4!2E7djEjt(pK^S3>Xg2Y;V zI|!&A`#4o<0&ADNq|Svz;8Yx51;69=v3$b8_XZ9QycSILpu5SRR~*CS#ya>SSW}^# z(G-C`_Ki7zERn+6o2t%2iVFkpf|;*#f7%x{b~jSb(6mYr)i7OS-HoRL5|##742xA- zfX%|VO%!_R)Cpz(xw<_{YOB}{IeYQ#qyBy4Uj|_E1qzk|KCd!~1((3MHL%+lsC7#i zCpI@Qe5wtc`s%T3@N!rMSQ-`+xV0)b6*_GTrGGrow<zcQqESB+bI3>u4%V8c<$VV; zNE83pn9Ef|aohy(`F);0)@<76Fq(~(UDGLay)Cg6nu8${Nk;F~Jb0*<fl!u8Its}S z{*I)XOL+y@2B3We(^j^>)m&6O5h|a|Rawp$_fs={2$D2XUgE14tIwo*E}Q`{|2-#( z9JZ8=w3Hv@M}eu}+Q7elFPabY)5$=IJ&<JW`T6V4+F;vzI3G1HM>K5{$?w?^mPU<R zPLJjq%jI`luG=%j_U#xBS?)QoCmA}>9ilGfeuiKD6jJ|JEU3vCA}h@fS%5%#&Wc+s z5g*HPehY?JPmhB?W03`>JSPf;tNlIU{qnTWjZniD(-P_pkF_07UJ6%;&-KU~ST(q? z?cc?ZHpqM9P8DiT@gzK*Z8sra=Mulz?kwl7G#&o{mH&Nt_ZL@TMcyl)IO8o#QA}*y z01K$R)6b*oS9NJ<p0(MJtg8QLafBD<BB_5v_)v~>En-md0ih|n@zYZIHYhm@q1*6` zrG^Oy_#~$qWZ6#N1e<!;ZL25e&5+%2MM|w5b?|tmS)?s6UmJEzxLZJYr%@GP4kvbs zbBJ;~h+{~NU+JurCy&6lG!J*h@L&T&UIDnHuxLqdt#lh@T+D(X^-cxftSa$I$4tGo zO}Ari6Mq~Ir;-3{Z1U;zpl}hba6J*7oV|Qc+nv!78r#L*c!Sdq4W-nLJ>+u@@9e)Y z_%UBp1Scb-jkfMnqZ1E!Bv49+YzJ<Oxm3RG2;T)cU=A*C+dFq4UAPm9bvo2=`uoz( zE0st`xJ~0%f}ajm;=;Oqt~E~GFrtTsrn-c2yqjda&agTv!crt#N*Ycf&OQdTTKz}u zitCo^->qvTp3(hMqxN$DpjF_Nyc}-s?Pw?jpxhmubK<=c^txI7R)-l3D{>UrSqHz9 zT-E={NFI<Vh83-cuoj!roxlvv51wr!8C;>xB`VDOA)G3&7gn5OMav~#kPL0lVrS<s z&aUsJRU(##$#~iLPPE8QiHu-2rxtx~L~X{4Gg-7MC(EU$gia7BoZ8O3*!a$qaJmlO zcp>Q29XBCgzPghcx=qE!InL#ml6?rhSBaW$kglZcZX%gWJ}gX!G_r;NMop0yR^<61 z&kn5wb^<CNVqffJcCp^_(zK&r1yI7R*W~r4_8^x;|BS_IYb)7k%<Dxv9aJ45-)nHv zF;a=P-08Kmcde@K$-jt0^GDiaadlJV^3Xb)F<CQ_*amMgS0=5KoDViL-5q9+kiz9l zMXUPi4D~AI;8dI<_l2qD!Y#W=%FnDeD>6NO)2ZQZhD_u|QyN*;+go#xSHQr!jGFhu zfP8-1_~Trwcf1RDFH3I{<(;z)N}7*iHg^l$&B(Nmmz@($cK9>772>=6G1Z&hx^4R{ z32nL*gE2l4YjWjXe^{|T;yDIoU)4r<J)PA%*USB^LK>PPMIXMXFPd##O55HTDNl^C zYBXM>P*Ck;5UKNf?|D+yDFuldv4s<_RXU?J@sLY+&q|kL!=y-0d1;c4<GGhp^x?m- z!3i;My==Q-d(sYaS=2Ho@CInwswQiIELT8KjtEDJd;K?7_A>_UH}!rCtk|_Z$NQJ> zMXUNo2GBR(-dS@9{l^zdtvah;lOk@@+WH^lEfxv8C-tX-nm`E8sv<{qHT@7f<`<Fe zoC-GMHL3InGkNHu@W6Il|Hm?~=ws5#f#ne9x#>zmC!wSkR}aeFuSjiZeS+r4ViE%T zPhyuyqfa>;`CESx1buy}6gJgzh~|vl{Pp!rj-q%p@eC~w?xE6Hvfb7RdxY|2jwsnN zDL@25<Q>Cm^2F**Y>h{zHzS4D3IL64Ns{}$oxlrPH;pvB3e`-VF(W;xcIl!qpgn%4 zWjO$+d}0$G+#880)@;mrlcr$W1dy|9Ggx7FxKm4Q^n_+Y;)={umb~Ua_^pGx*)4OD zZ^IYAi<ry04c5$hFYzF7Snp&QlXBK*M-xI|K*T^UYzDf+t%&?+tAXiCHiO^nDOLuj zkkrl9df`caWJgD0Sc}h2$0P_P5n#UgLtMk3sun4NQo1IjOYK3Ku31WH%ONCJ1kIh} zT$2B1)LNtO{3KM8_^Xv2Ctdb0JT0eAKi+O4+>U&}4&v34bQueJgm+hRKAFefkEkSD zXdc&da(Cnwl!$mS$i$*&`4nWDadjjHVmY4hK2q00n4DOI(P}#`P%26IuX#)CzWELG zr~Y{bAYF=i5pxpUiHLzFc;BUO$Ho-G@fSmMK*@kVTV9&WhZQQhm3k?B!$m3cL?sYE zVX0buS!+&H!>0>0lZ~8DjRSLH86(lr^9+(+%4<U9bL2&|7r)1dl>NT|0HuJ=F)q#K zD;HS<xQM+jyN3;^x1f@Eto-|d-TR{pbac0@=$4<=P6pUG`%<#E7^!F_+A)_~3?4ZO zNO|pIi0;iN23WhoS9PP^?X;G@2l-H(Jg2rSZ#7eDuR@aYv|1`rCG{;dcYOi6wxC=l zVM8($&kQTjW!Xr(-Alr6Yvft}N@G&2zkOX-Y8w0{x!0ntJ2sZ6J;Oh9e|H}`{%9!_ zBD`_qd^gf@J@FpR#zw1Ut|7eD+fJw=M7)1_<SA<+rEH$8>d~14qLn$W;LSf#aWYdT z23~rnH;gByJK{OP4k15u{Lsd3tQEZY{@R5GYfZ@IX1co7bZ4njK8T4{#Ukc=1XmmR zkBD{SWO9t(kH57uE%dQ}I&CM77}@`~<kTah{<$zP)eHWN)7oJuZn5K(34@K4L)Q~+ zTRzDdG#{C!k;xDX;l;kA+Mw3WX|AwkbMWHkAV_1%1n~tZ{)!32bG`Dz{eaUa%S}Nb zFh*u*KI+V081kY-DLY)OZpx_mFz1`)uCmk+IhyYHKAO`RuWO>m-mS!Ebye<X6JfbW z;vPr@s@>cpPLWJ6DjEgEs^AS$VD(N#6ge=x<sY1?nwI#+VB=^J+j9U-cF*l3SW+Mu z96z3C%CWij*Fiq>_uV;l7;_nX|Kb$yVPNGc%$3X?UoXw_<qd+1?H5I9UiN1NV4A2y zBCJFXHE=pBSG9)%3cYTsUsIvX;6|yeL&d*)1z_#Y)Rd>0y}LOlZY<bQ;F*Yf(SgKI zuvclAC=Pir1S<mN)uBxGQ;_K&Y@Q&S05`Hs{B3H{f7vtS!#^dRobTcCcdO9x3MEZv zGu=~+9s>EgS^(h%zknTEXd*M8-{#9{tN3J=J-mHTp}AtoJKp$d$<O<^KUP&=6Xd8b zV7%ObDIvG`UuRIis^7=2EZ)^BQ|&kC$-FN3<UcaS(aiXB4NmMd5;K%yvul|c^d{lo zXGxysE(%toL_{z+%J<%20W9|lGx_R;>RV#!Qt1a=0g%;P_om4SJ!4j+gf5l~nv(&x z&TpMtdC~H4$=Ei{zBh;`saL>o-Ueb;w?n`rRY-@y=U?5#!akg;xbHz*8-@EpvwK9y zxOM_+iINijJsa0-{;c{mmH}-@p{FA*T$&T!W8okcs{0B!Kdv|NRRSr!XE7|Gb?Rx# zJ#hVJv^QUpG>~l*Q{zdf>V`~vI`|cf#O%)uTs$EKj$r)Idj)iIYx)fc=B=?GZ$)qY zV+lFsXhp>}c?C=ix7D{eKgKq(uroBYDjX{g-TGMiXxeu>o)c`ZnUI*XdCDfmOJPr^ zlBs6K9BP9w;g*94&~J~sQ)89Zf7|fg=Cod@oeQ}LFQrWejS-yP%NUYAYBVH<W3!Y} zjHf{Huk_z>%}#7nAGC+OiHpbHiy}B_yyeGqg1A%ZRZ1iUnBc73Y)U#r2jbl1qtzd` zapMx`QK4oUo!vGei8Yb(F=IM`YVL$a=WQg!Hkf*kLSLZzc$t&87^6rrCtN3f61}U1 zzm&4d=OQoi#$QJX)oLRt#PO)IdA2wwO{~k?+IRud5bvFG>|u8kM#DTJd<1UE9<p0x zvxAIk&870L*AV>hw!(h7yM?aGg<QPHWFUFB6H%W#zoGW=Pxt&>`exLqLy=RC&pK*s zLYTscVV*qdscT!Zo^~bqJMJLv>{mdFkrKlar{1ji1g67~b50HfzkdnP8AZifH_~hf zJ<*=K^sSE7>xT0b!P4aiZ^B(YDT1W#w6~91PbZY7SJ3I)ts;lct4cVluP0l#;|(p* z6fs<JBy&EjrQUM=D0@r$lI&^{JO~WV8>lelZ9Q%3B+-<Ahr<Z1r7u>?t4LQ|(U67} z8+J8~A4rOnv+^D*^cKQi#skU)?zD#{AUZzenAER;hwcsB@@S}m@6cNi*Wur}yYb9R z)9sGB9C1A%X93dT+|;q`7jO;bc2+sMpSK55z~Je`aB3W<+qt@1z<cl?DPVi9MI)R< z!X(``RGX^XL$5yN>Owvzh1;zvV8!XO6pbM6#cy^7(|;dmRM<JjrO}VqkSm*&T~TBJ zr`*~!)78KQ*{!3L2H@D22=B}D+8FN)uo?A1(nX{P<&&f!LL>Nx-@fD-QN9A2<l9Lf ziX#Js0nP|fn;f+tp3p^H9H?r=C~WGj*HXn7gxKT06Je5%^HMEQ-HO}Im{>|QWlre& zN>^_sGXZ|;_`OisFrD4r>`Yp2veCYVbQ10^Wm&rJX9|R!#CH=iPVdT`*mQzzo7=3K zg$c3}w&++_Kb-ra59`Eb)pajJCLeUa86ODYP$RY+*z4Spsj2o;+<+*sf`-?aRmmks z=5=ZGuw_!XAT8C<hZ>96Hik$qfe<!ZWE-of_d8pd;2@JwHK$0d#7jFkNSd+Mr>+ck z<7RNPX81s<z@?ZvxLTXP5m!D|2^*u>@TZs;r@PKH@#MlU|8Xkl;SzrV-L))2-oA~O zq;w;;#nb`{Q{2w%vbJ8OJ3vTqTOHg#H+atRh>-7$u(>#oawogzI_e3lb`@^NN%8LP ztSaw#6svx?sqU#$GTYAxQQn1Y8bMOCVlR5V4E<Er^}-4XQfIsXZZ!#+er~EKJn&{c z!ED{%@l0HWkIuqO=Y>1j6As$eqr-pe$SBAYD3n?_zSk?=6g3Ouk@MF<=Sv@XftE?0 z({&f6=~VsRHgRgUTcHgeF^;DbzQY1D!p_D@YN)@|WLyTKy~>J^g8zOiN4ICWvt%Qw zCHPB7kH_*p6w7SR#Zh&jyVy&|LehS}c$64DL&8t(CQWP~Syl=WLkS)>^aWPtr8#*T zq5h8-S_M0;Nsg+X>IrT}u_?nPrPxjGseD7_y6FsGl5#C#tz4!E-}nJc;>Iz>XZ_?R zy?q(daaaLK`MqWP%F6%7OGoHbTAlQGrd3)sCw+FeaU8f;<W&3&R<YEbU=~jCl3^_I zshr=%^ur97za@`t+j#zoLVTp0Yt`8mTvZ9_^X*i5?;KOK+ui2YJ~aO=k1ltLRQ}UW zyLFVOgyBfWC~pUnV}f`(Uh>aSYI02DN9Q1H9Qh<iZegl22AANTj6x&ujYr_;Vhx5^ z;!n?8P`UOHj%wN?^EmDhFBdUAy<_Od5;br$OMTxf0BfE)YENmzw_-4`_&qBGCD@>b zPoA^WIgnTP?kjU4dpaJ=UiaYnj%M8Pq(@DBW4L^XCNplnz20t8v;9qGyvV9jtJ|Tg zvybG9{12A)opc3)@0-JWDI#xMj=l7Je4&$VhN89^5rgn@+T&G|TecQ6A>?KL2!C(* zXaZ~9kRfjVSNHA<^@lCX!pY?mV(j$orG2LVC^Li)!`505ZOd%szH;%y<L=Y&zC(1N zj08UoRV91<tou0<mJ{00-SUYKlgKHzu|z91(;~d?pgm!3SH;^f+%T9{cf!{u{iRx{ zXsk~t`6TBXmevQ=x6&Y2yWM2(e;v{x`^Ks~z!olh8z=4&{W`I{@wajnhDyDx*eMEQ z6(cDxe4Pv<y+TCCes2ite3Y9XLA62?5#ufJyEfR1eoOATXt{UXw5dp$muLk}IICBW zezkY|hL_dwp&g}sp=Myah`uCyUVJ=T`k@9rgmnlXk8B{{nCxzj^c8Seb8?rzHBViW zjzzD@0GG8V%@N<_@0>LsYMZJtX0F=6@=6Cu5I0i{xAD#dwIIdhSJ)lg-VbzdT@g=S zmP)V)WXsF4Qj%z1(vVN2gq!U+Ax3PBY@JRVuPP6xE3Hsn@>t{9q3O-pi_0S5xBWc( ztnnFtP%p$CesNfCr)^bRC$p&1uPXc=+BfsmQq4`E*5B60{vFZ*{7X4gv7>w8I_To8 zJ?BA%WvrZSBYxdN{N(25ot>5__0u8>UqRXk1~oD<9O73Sv90<uufzc3kFQ6Zx6JYV zX*}ApB4zh0ALS_@9ukoanNv4RVsL4gJ_-sXuR6caQl~x^tt#@h2`d7n6w5CAG(z6j zx6|0jqkQyK7ikM$w8;i<+THkr1(>l3P_a7C@Fe3LTvHHYBVG+(6HSyLh=SH;)*4!J zCBSV$u|qgP?|5eDR6HYvWg{-0e8N>fNi@-TabVN*P%%S&*kv<NG)p_ijA|!+dTzyn zqCBFC$9RZ7Q77m7U5d&5nbp-k{0B|ad8I>#0ktf5#_u8XQ7rHCp##`XPb>s{AyLGU zeOWEBofT^>u=@AEa1%B>8{yw&D<5NUdp8;g<Hqfht}%u~MIC6WOvxx#63+PrvSXNO zEfW=|MZfOvXcgA1vLMlLE9!lDa?0o4Pt^Osim*B(dV>ulMBf()g8Ptjn9HNnPyBNA z)qS6&%W#Z5$*N#G)9N`nw%=g+WG;@NE;C^x_P-|-B$~Jz>-XeSg$}sn6NiH2^th@n z+06pNV>SUF$9_t+tCl~q%g=^u>&_#*qK4*mRM8)8@>s)TbJhZ^9{WAaePK3!>YJUO zerWjL4K2o{MDe%ntiDyk)3%z@r(%TVZyHd1Ex*hJRt(HPMHX(EsQp?2lE!lnxg|T8 zKvU+#vRgi48?C9^ZvOQ5cEi|IVP{kwQ7VlxUa@J4?0Y_dNrth6r^3<%x)aXs*fpuL zGp(g$hqu4%t}d5sRrW2_AoV3W`bz7=_x;3W8q*B*^S8ysL=RdBsqhN*tlt-}3@%q? zF3_-Yio3gUPTi^Fy{JdaW@^U74N8WyMWp!oQu@|XenQT0<f`bgZu_x<`<`s!GzB9m zJ1K&0Yb(C}@Ep67jW7D1lm`3#d7OIDN-Eq;?1)VJWy%liu;CdS?W$y@Wv6@Xj%yAY zoDiX7qHGdq*}u*c$Lj7bPRg&=M=I}1PNcCh%NHO3J#W=&yX<6sF~Z3tyBd{_@Wi1I zO&`#%sljqg0=pF&qOhT#tv=L^P(TLHZ%a}H&JJ5!-prMFuL3D{&lp66UyD?K9CU2u z=pREkKl}`0A&-7slbU<-UN?Xl`U*nfCtpU0*)wm`efJ-8^*MTV=(pJnzjN4PSIGkl zl<-&O-zI`F&#Ep4EIZv=XM7eE@aGiGEUzR7YCFB0V|{#&<#;n0eYjv?Id^1u9c(xE zKrZ!hSzWB2C2^du!{f5lTzM+3$<w$crbWI*Dnh>MZC`F6>xk|zCFl<nt`#n#mrXm< zSHP?irDFhft1J0}?Bc)nls%|y^M8yw=bz<_7#-rt|7{WW*xY{irs=w_<{tOags#Wl zx3?!U;o21)8D31L%y-=B`OjDPpO0S~selO`7Mby}6L3A?oy{i*Y~3eFSTDUB`TiFk z5nZHXSE-nF<~R20EgW~DBLn;15YGu#JN1Sv(ok7r6<$Za+=KBNxnM{CeRb6}-??Pl za^8vdOmR9Nk5YrEuIU}AxBJl`wEmEGMN$-;Keufj1$WTT<Uv?{!{|OZVUX{sB_H~t z83FHL6#3N*Gpxdcf{FKm&v8Z;YALG8E2AMCnAl;l@lqfRcpmG-N9FrsY!maiqvS!Z zWE%H?B|}K}(q>w_sT^%Gk8TqSC>3Iz!*expE`;p`Y=(POdtW@cU4U;w6vmsZkxhUI zDm5SiZV!|yqWC4B-%d#*w}FoC*iYg1=k#ns8Ad&)FUC3WkDg+w54g-6ta#Bc&NM5D zlLf}_Q^0Qbv^Ds*Ces3cy5QTMeCTNPfP8mdpa`BIj`&FZ4_O!^Dxybp{L4v!ODB&$ zR1<!1?*eYyOf*5^LrqC5rt<eYtasnO&d6elwowaZOLg>$u3X$a|7iY6N#FJ|gs1Bj zfW_Xf@Yyf!n~7wkXB1|GRbm;P)HsIcI_pNK-u6}Pb{@wsj19@50YfW~WW5FAZH&*C zn?{?63wTPpgBo36+-KEhHG@^pivrtn)hcP!-A&!XCvMs~+yXTMJAogHy3GUE0<3Iz zd8i@Yqmk_l1EZo(_9YuLRo^Pk>hwsh7NVD_k(4E6KCQHV9Ia=3yK<_gQoksE-Wq5P zQ&z$0;)bd1UF}O_PmAs}_;MfvC3P)ns}KeGm3IvI+TJ&vusS=8;!C-po1~<c_HCMh zg0o-GO;#AiCIUwlrk~DjGLvLJj=E@jAL&0b?n4%aY(-T*7;>zC9i)7cE*8<*&p>K& z%x?3_1JcC8XHOxBp7w_AYAE8cSAlq}8I_5Eo1ufS9hoNVMtOf~Fk0vru9e~7Lr(hd z3lApyqOc<p(h~uG@EraTre(VHMwcp~g`TP-%uLXc2cdAhbzCwao-vc`Ur{|f&D_v9 zrJcy&6|Jk4<2ep57Bf$z%ql3RC(F-GY`n108%XwN2AO?FmjF7hfVsVFTcBilT%EDO z@wkE%m;0I{o5SgSqwg^ZmO~AV5M+HN%;4g6@DW064DziMrfzJj_5L0IfCyICjj@Gg z*wT&(L>c%BNUGl1YpmJwVowW4g<;2~fht}B)!+nWRTr?FZVP(Hq-(9fX7gt(L^|Hw zli^nm?-pGBuvs4E6C9gxqsj@Y0b`6L;@P<6tSi&_WsPJFOW}NWA&&H4P+L0l@8c~m zgN4%jcBDE3aAGa|7Ft~YmeNAKb7N-bEXGW5&X<r5{B^^Nohl<Jq%-A&V};IpntlyS zIQ0I0{+;l$X$$82W`OLtdS@Zo-Mj+!aRh&svWwGVU68N7c2eqAU8BF=1~qsoB0g}a zvR{C`i*R$TW1!HQEPnkM>|-M_cz=3UC_0IxZcd6sO2>byHydxm3KjR~l@ki{yo*!R z6BadB1IP9v717mmZ6}3Oe|!%WU+fnGmAD;Mz5*UWQcLn!*|E2O{X~8%y;ESPnZC;B zrA~DHTU))A;L#|tDnj0A5Bp*L`!-0d>t}9i(Q!^Zy(XySN|Ro+AA*05PV4xa>*1@; zry;a>^qGVA^C5-{rq#bY8HlF~u@&-mG+_+`8A<`hh&=>ed(4qDgA(Yid#wu`sr|B& zHOejBc?G^fvu?3!1LfZsZwDH+4fQCWANEm5aP$eumb^7q&gLV)34W@m;pLpXwoz&Q z<=DDRfM@O#YsZv#X!4XDAP7%s@TDB7W$+*)!>GANSXVZi_SrQMH)cf+ji*x0sI=>s zh57ZKAkh4N#C?!s-GwF!L(Xe{<tPw$l+8(XwHoB4E+ju<<F9Jw*M@4zMUc`vYCYqQ zgRk>pdG^8be)m|Id;1->qULTnx55-SZKv}@r;cE*M}docY;1f*uD*9|T9iKt8tf?t zSbd!9gazum8}&n!I5~GRZ(VFR2-lG&cQ!6tC*+2Og$9)#%o3?JDF!T-?>)$+KU=26 z8)q$n<77OToLtBLI*Ns1Mh;}|9T$G<j9N}K&&!byob~od@jIx}IO(j6)(@OeR(hss z{z^yJwxwYpg>Gc1nQhaGhT(g#H4-2!?0q7h6{t|%8b}tt9=UeY3`>5eLQAcW24ca_ z#?O&*L9QC@co=Sm4PH@4#R;ZU%KvkwuyXt(ox7L?sq`4e^KvfQN*gd()R}+cGybfE zRy?YI&K^*fg}qV2n=G+UCB36YVH<#5-{-c@ljm?WJ(BrU4tK!dXwxNN!)r_hyFJV@ zS+5hSkb~+a3IbV?uK@aF2hHUdLE^OowUw<m$+(kxh5@N2Cw{L0EJOs(YRk^JQW5FA zwg{4xPU`FxV04<Xzq?WcR*AH<`>x1KLHxz@53#XiO!3De&CTi)bitX@1BsGKbf>)h z6~Wq#$yKhKlXZjT6HxGdUL4q~Aufqb_hgDy$8x9)`|o@4$=RO(hLoIeTk%XdHf3;d z?xxg-J5-hlZ7Co|lLla!=$qmQOMoSQo(<K^RRuGR=Jd31p_0c~ZQEvj-va#j@)cl& zv+KJWUAb#D1>7G+{!?>EP#k>wXg04-UJ<2BY0sm@5+Tp}RrIAX>{x-;ygfwfq<n-~ zo4j?yA3Q$9ppuc<6tI#1;$9<g*Jf$UQ6t2ESkJH}K+jgTw~lO*%al*<4{GjcfgDUn zX~gciwfues6m!7k+8P_SF7~=wxJ{c;65Z1-#BDPV|6KN1GzZF9wh)^B*RUvCJOhll zzbH)?l%W>?Yjl$pd~6_mn{h3E-49z`ZXqi>jD%7otMJ+cVrkvheHe|W7!WEVWNvrv z<9q`NW9qO!KyEkNjpUM7JhF+#5VGrYb*kd_ha(0r_=VMU)QW}2XCT0Ox2Y=8w5^bL zzbvsp(|SMf1zYWa@&29r;V7Q)@^SH!oq7A%$7uNUmY*BhY$gqb4Z8!j7n?~(jGt1} zrd`Vlad*ZX)`LY*8E9E<{po%-N|$qCUmDJ?w6D4n3qp~XqRq`LwjMXtyNo!ub$MH# zT$GB9x2lOWNsmW-rA!VvjQxn6w)7%oo*i`^`A=$iSnQ>XwKcF__~M26$#_bF%s1PJ z*Lhlvf7ryxED<#b8+R-op-2Xznw_>jOu;Tcq-NZ^-{Lh}HdX(F+a>XfLCphu@{5&$ zvl0WfpO5BySc_HG>Ey|<x3?<nVg8+$8aEfpnz)Q|j?C#>CBVh+F^!l*V}q(=`j!}5 zqy|QUPr;|3$ro=(mJ{6uW=^zeWCwO;<P422VESxihl6>WCfS|0=Zo+cv1cXhT622f z&H%jNZcfbKOSFAm!tmRS9+Wu)ic7&JP$Gz?;;{-|5A#BP>vg}ZAK&#e2m<ZqqT4^K z2OmN7tg+e?I^E-50poVs>8zDVfwcxZ2kL5(8Wejb01EEaZ5jXa)KTv6($X4VYp^Cg zR=&_3R?PQ`469cFA#sybnD4Jmb-5xt3UVpoeJO@PMH5Q=+(rN~u+5LYJ&1U>`_Uz? zPCC_Mv@$7lqGuq)<1gF$;BJMpQtUL;jKxlFDX>SM2*%OBB(eD@3yQ~YVo56rxe6O{ zPK2qvcvn)lvtQr8U+-TwFk!w;^}yrqva#QO1(fNb2pwCefDQaW67O4&U(~j<*d^kN zdqauGla&Uiv;8Y8DUV`daIaDmU$#E_Pv@T6WqZ}37yN-odBt31p8EbW5vB#Q7qW|g z;s*MB$W3~9seZ+OF6juNSL@$M)B8xrknA7l)4J1{vxxk_VJx3e&R|l=q9yu=lz+0i z?Vph~X8=uGbK(yVUc_XI+d1VScI(M9GP|K}*_EPgfe$&mbuiXJL-#P5K(!9xRJv=A zUt*>+C^Y5%)!vhNUK1tZ?`D;D>ey2R-08H%Ur-<q(xHl?XOa{_q)4oad8?4Q(HoDx zPu#&=$hD}%u6DaHzf`C8=5Hxm<jswsCPJ~#&n@XJuVX_h<zrif{1WSO?MjktTqvLD z-#AoS{1k~Cq9+r@f}1v(7__~BrxW>-@y44|R4f1M%RBz-j$baxI#t4Evb|f(oS)R} zrb?L42bxr#++A{FB2NYLu<{`6;o{o2w-bI`65F<X19|l<o8S5_$G4+d52(6m8?PMY zy;sm>T8A{(7M9|>DqaDDR~R?pL@W>fYV!V5;4E`EOxE^ob6e5e>TYQ&bZ00{cQt}q z2=3wzJgOde2HS1+!_=AB`+1hQ2`o<#nc@yT*dMrecXNgd&Oa4^X>xjUN<X8Qd{2bk zQ7(KX>L*NPHOS50dj(v1mT&p}alq70VYYzQ{+6t^8S)@MSKnD0rX_gKC9F?<vi5Dj zZt6joaWZ_eGz3p4(3UStwFowNLKAgSv&OmmOEk;Askw!PF~3u@3>6n3Jfk=cJk(Vo zYb^YUj8}*dMm_i<_P8%IY#W4vD|NPBEs_pl59q|b;8nyS*4M-~_$8;Ml>f{)Ia52x z8&0~j4n{L=dD~Fm)oOU+9`WT9)jc+)MVglk*_Fz=^3ULmrQg=e*%6BOZdEQHk^bH; zha`U9EAmk9;Up4zt@34%a}U<Rz}5D4P87ysu#ppij?YQ;aZZ}oe@Q2oOq+%;?j5K0 zKfLfiZKo{OJVtM&_=vPmEsZ<lFiRi4XL|lOeZACvZE1dNCgZ?6AXoiTjL@$7>RzoA zDQ0FjR>ZZ^7uF#iMReTkc~;eS(ZeCMYe$KBb?)GQArgU5ssRf><@oo^R{v8E^Vmm- zLGyuUz!Dq+!2(}H9x?N)^O#ymmkZ*dyc<vGD?raJs+S?bDISKSCnz@(zqxSd+3IBI zOruj>6nyK7DeBMWBY>=ZbPc8CQFJ!=_6eZ_$-k_)XRe+-3hjQnDg0wr+r?7Hb`&0h zFEK)ch2}GRX>RckT=Jl^i&Pcmb)K>WEJ5eV_`~A(T54VXHE=4yb0#9I&vSUHocgP( z-607&@fyOXE4s!%!v*q1c#^B$eDOksmEvB#+ZLH-0!nd;XpzVN&KC(nN{K@R%>z)| z2GTM3>R&36^V7c8(G;$-eX*7x6F~|W7nuWyh-~bTuZ;ZH(dU;u+=o4QNZaMVm^U1w zEMY=sRtdbOLdZ*G^6s^t(hz`{ZUlBxS~Kt<mpeZ<d^5HfWB1OnjETX9?2Labog>q3 zI)Ui^p`bN;x&0m5x0o<iNh5#%SHM-n#>|7Rso5B8+onDWJX{(WRX&ooP8>m*()77{ z=#bq=!5t@vEb6klZeS<;knKA{Ts~y(N+iUXb#^3s*30~R9Y*ZgLX82KP#gCPr9Dlx zKDCk6Sbz6g*dNERbiAg`^X)2H7U6#gw~Mv*QfKgvQEPuwd#t6r@I4mYj-vcZr?9p( z)~-Lck7l7e3^g@R_y+S{Q#T>MT>(t0VWR^fD?F>eRTuwqOVS_7`c9sqMeNkT4W^zW zxPk0g9ErdrO!h))D{Nj>X%e4AU@T<skFVa3`5FZ3r{vv8y09dRr7?kedfRxnCw!Mn z6R;hvPu_NIZ;3VI`a2X-HpS$nP`K?|*}=!g>WwoS9mtq+tPs!5^TJay4~+gKTtnD} zxtPp>RF(BG;TL<tvvHO$s=1X=YT?enipfs9gZTMqGt<Ge=@q`Zh}q+l-wEXKr)--E zHE*64&ZTagqjN=(BgEMYKfM32A?p?Ju1Ok8lKc?%J!wY@C`_RVEEkVlxFh#fgS4)w zw#4w#?4##JCrs}fz#tC?TO)4De#NuY4y5yvK!^YMSZG_L1uz`jP`?rvHH}ybbIkU_ z**RRP1wK{z9LeAD7Y!HmQ8B~@DefO#RxGjmw!<pF=-sLTz+cA_T=_7v*OT?$3No}z zrG5QKQKWcYlm>~t7)LWV2G4a0BdlC2xLQ%2;!~U18=?=HL!k<8Q$#djRugGCG+RRf zYTdOh*@S%dyOj6%=T&FJ&D+RWk0T|VW%+OWRM)fdS6jpOKR_T0H7%vMjxlsI9m1%= zXIr2I5!svko+kr2AHFnR<Dn>`u&J>z!F}yZ;_I}OYVWSuMtnK4SOy4yXlOS#ki0xC z>9i7vu(l{MfOt@BSZZZz&qQ%QsG$&8Hz!H&<cA}sDs0v*#@oeds5hOKI+W-*JD4oL z%D3Hfw{RfTNj^wQ3cnfj4w0QK^t8w2;m&r_PM|9Fd0!cYdAvPc^j;~M)a6CZ1@Y$< zV7N2VHr2|k0T^eiQTmWQx9llYlZz>(eUxiaI}vj@&<b1VZt5_cCAwsA^qFVuMVhu= zj22E;nOia!;V8Dzr#A+Mc_>ZC`z?@*DOQe<{nnB~sFlOVN48YWhdEPrLqGi&1s30w z&Pw_ZrQV(`mioJPx(+OUmP%pW<jHPO?-jt&c^Ny%{_CHabXTqan;NjHU`k8$X<3nv zb%*mf{yfardoIIOFK~M&jZl}>;QYTrXXSkcZ1<Wmd!gc0UaK2D^Y{gDx9+ah;a_A{ zv@zsAHSX0NYqsDv#Llk%T2gGfpZexJrMRVgdrE-uTU?CcW+cMR(QV|sw8hvEARwmX zwo;Fd=*@{z`Mg6)BWcC8yJEZ8Z}SdH7tz?jt-gdUtl9c!aLi`RWyFk3BDqz!PvbL= z{~}*`&DW2{ZnxyAxdJBPG$IGE7%jq4|GmE;o?n`(j(sQO9{~SCZ0?3Vvn5RF*&__j z{*XQKYG<$5^?Mj*f{SV-Idj%}4Gc$M@esB!N6M^aN)8yzijnfB8pGaj8b6F_3#xl* zAz)#!t)gTZ;_(+S9zG~KS<N(G%Hd?vZyv1p?vtz*%_<*8_UAgD$P~0f&riC+s2ec) z@t7Gs=A`dhFd%=pw$qt<U1D16cpoCyql8!Wk{2FWRdRw!^TMBSkDGA*j`EW<CBwf4 zWPH3y6KTgDW4y%_ovFg%$XU&(zt5uS479di(`g37hL0j@C%2K<v&u=;F@t?mhoEl* zIG3ny;72s|+u?CR_)cfZ2BiigK{;hgCvY+)cDID3q+o>;yuL5RPmc2?*XK}b+714_ z6swuWrw}LCXZ#hA;}n|(E)XP(Q^(8r5|BpaFY?R_Hr4>2UqGIAI-sfhUraU^F4m z{_YhJxfq49*c+lR0ZK<k4-7e|IwhzCN5*IeD$z0RK5<JQ51{#wrfQ)tM+47ENl7U* zC`tUkSO=Nk3nMrW(0e~C7rIkCF>^L8k9RS|ojlXp;(LXmB+J7Y@_rIGOG^GyfBLE_ z)cR81>NK?`&NjaW8O;h1dj(twU;OK+X$93=?}WJ&vmq%xx>KhH={9{R{KUG6cRwFp zwNx3L(>ritqTZ6Pn+m;D3@;dW+8ZemPl)ByONy+AkMWKu7_FZ&)CoQtsUxGOi(Fn9 z;Qd0s@Bqbqdl89l<$+Y?{>tU{Q}Z#V&`%|MbVqJ+|HY=PU(|fOsA>0n1;hw0-sTdg ztqjphS&|L)TOmXpMtn_|&ua*saXTJ81_Wj+_f3tULJx+2K-lZD{sk$ofJ=oT$K(gA z-z19;ae)hA2{Tx};%SnK-V7rd-a*nU2gATidLoTDXn(8Ryd8y^91E*!#lmb5m{&7B z1~KPAXO7mk)p}ZU<XjMlVi90TZ8k(aJAnMxQMRIIAr#if&>XHaLsGL?(Opo<z(UDM zZ-*}bX3wjvm~HO+v5_8{v*`?mYT%FIK-Xtx;$6Xw+E9Nyhrm>lR_~w8^nvXn7gZ;s z4)I3fP7;i+9S5HTsfkN?<#LUM;je&dXWqeYh&zY8r|?(6R?#{82$a&uF#PCK>=CQ? zR?pCgwz32rPxW8BL?MQtAioL$YAUu0ZzSes^SnTAlZzXH)o^6afYj+(MbOL>wJo8( zi!=Pz^4T_}Hj22oZ!B`t%MqqIF&ta>_9~m_A0r351wZM?JDOA)QIQ`csNssJG2RT2 zA$n4VC)>Hm6}@ype0I;~uH=Ay;~$WLlATyPuEt?HRZbtO1CDho>xdBbFwF8=%MHtm zd~fp>n;G<(!9nVEGo7zLTx>HMTBegCXSONhKeZtGro}W-)AY%k(ckl)75M%d&=w{; zj6F7LDDhDg*h$gudb8?F80Xl!(Ay>f$m!<KJ3#t?JTnrXm@yCy34~H2+!aBp&Ti5L zb$v&e3()`p+5umjGHe%;iHjtrwWArzYuco%e!DQRv3}iu$zY85-pVr5d?;H`bHI1U z5~cC5^<BdYEB@k5&e<nVVY=p{G+Rp)+EK_C1zPnHp&F&wwN)}3j}o1^dhV_gBOCQC z*4nPpj|8Mvz;y}!4%)tx{2N$14QOIhx_I$iphbaz)0gDG!Mk7+|4zT5#r~1Y==Ou1 znwtLxf#M|mHKcZFK1bu7u$_7PsfOv=DK4_#1tUK<mm^hOr3LcLuQ~mOb6yJSkBtRt z4zPX-1w>LgC@nhu-0Y4r8v(YqnmfB<+rk+;A1lQkqY+c)JE`yEJQNWCFYkE<xW{rH z)3`WanqKb|ko*MU>3nHwfGpc?@p60xyd&L8Nf``7+{v*`R_@RhvhrsAP&ynLZv66Z zrze0`=@qbP^#TuI#uM7YDT0rrK&r6@*ouG9Abd65^@6{}8^bi?U*yZ#{zC&rf!$_s zp2FPRZVp}nWOlg4TY}idJRC0%yN<EQfq2r9r)IWDMY9vBZGtK(Rxa+WgDNIlKO4w- zp|4gTp1MItoRys@j+8LjQW+x@_e0%hiveCNg`-O*rtX{$4q6pI4`}X`4PE@>v0_=3 zm1TDXHsY8FDK?=j0Cnqg98F8`Wb}R%He`&X3TAglo>yIF#XPi6m0d2(yc_tDg(*Q8 z7tX7yqabWe@#S(Y<Uda0AHS2LC1tFvhvz)+Brnp*4r{B=&%*qQmV|!a1d~$hu$?DF zvslIP(YaW{sELa@VqXDZ#+o0+h5(82Dp2h@ajveBV*rt!-L@<#nhxQLU@>0vJqaic zoeRT*BDC((JpSR!MV_PP&lUj~RPk?(cqS5tjw_u%Hp(Nd<u;YgM(wwM+;@|nmM$<& z`e<e80k9;d4}1mK>+M~^SIkyTV%4Gazo1Utx}uF91VVgxQ2$t^$+rhSdWLI1plaK0 z|0~TGGU$&TGN{$NWE^)2oEOcdHEXvzZLDm_(kMDra>pGridc1!%5;C8*%|3wOmu1T zha=-af@Ed16RyKLTzDGhxqmG>CLhOWft7U)vz~R+7*pn3Z&uOj<F&{1hC|=ba--S< z6lP}9idp$#MOV~?WvRA27F(Nyj`7~w+!L46sE>z@bNw{cZ+KS%;Pz38En-WF2mIGM zm>(m`rrNoTPI8LJ1ce8$Pd^GIHaaDq&f<Q_Vb5sWvXV&7-D)iC?LODngk!Xge4`X> zm3M5?%<S!!CvpZUQ%5j{2io|GG*4PyT<b;-ZbQsc0lNPHgP;4h`cNKi#al>(?Z}EM z@j`|bk~f&=D#1YbbEJFh^ds#g{_Vb%P+p={q7i>Io$rspS3foHPOtI5>TeN^QADIM zz}-PRii|F)f02&oOpg)(aXW#~J^-%B<A|gV?9roKaB(DYhZg1HE}@&3UA~oigH=-_ zYn9!PHYevu2W`ErsRZ5(h4{s&3K$6kX+3ehBU<r>k|vfZRH>3tAYC~2ai6K9J!q9f z+B;Tel?rSL=hA_+*wZS<I3t-f3W*|V7zcCKf=8P@nNiH`RgCPfi#{904WjlE<)8;D zM>IYa(`QM>{{Yp?UfW3*YG;p5Gr8a8S?PO-mcfOjK!PxXYN_Kok0AEu$2@`Z8T{%j z?SG4255%rGeq?~I8{Q1Lrz9_{8hCvuyJ-EWVQlvTD*hn)J0GQ@EcUixk4-O+%9Z02 zF}J2^lO%RqsP|f5;Y#t?e|s8wZESX)!bBsU931&=OX8o@H$SCzS1LO@X~F57ezg7z z>IC{q2?cD<G54SNQSv^RUrsoozc#ATBw#bJ0Oax&8O2J+xX+2Gz8<@5cwM4e*{U3B z_nh~WT-n>Ve-<)EYmPQ}f&R{a6I*fk=H|c2TUN<Ghg>>#k*W4xGN*2JKm8r>@flEi ztF6y{H@OEq{<I7K0E=4)(X1Iy-Un*)`E8t!ONL9t(8=hZ4ZM;&;XGm{Mb!$h131QV z4n=igp5v1&HB4N3FTgC6$n!kz2GFFr41C7;r}R@4Yil^5Tt^Zh@E_#V-o~_ijXMKR zO4(9LA$@4rH1u1mJB}$6SRu}4VeXOrAC7y!T3S7+uDf{dFr^BzM!+)U?x1t?6_#C7 zouZ_T?H0~*bCXEXW`DFMfwN`woZ_a3t1WEjD`NwfIz>(0k}Pfy{{RzxC?}k8Ofy@8 zHo-XgQ`Xwcs2Q}PI7A9FAF>7q^lO?d={xMiC+#Hu?Y@*n-xFb(Qdt-FWINUzlX*J$ zGM^{!?t?1<f~y`+i8UBw+W9QgC33<`nO%knW43FzT6y3KS%3hNb^vvx8txw)*02jU zxAx^lF@g?qIiH!Os4n!!x-!b@;Hg$1jCH0Bfs?qRg|`5iZMdvc9Q!!NJWf88Yi6+Y zg5=$CKzlt1r~>Dx@2v7AVkyo=NJ)!36P<-Hn;FChxbA2hKrhYDe#63mj_ul9C_8R4 zDzNmghZQrZo&BooWO;@oU^;?6JgH?Oqd|-=k;rT+EjoZsb)NYTKRkX_6?4SP0y`m| zM4GHoR?v@UV^=9y=|<b~t4b8eB7#W?14@&cSHp<*@swkd7@m7(iQuaUh~#thrLhh< zz}q;f+L-T2n>W!Wc}Jg_KcK9$tC3T05t8O8@sjQZMqV!o{JU(?iw9r^8P6}-8&@^% zy(wmx{wUh-<QdMNWRc-p<24*yxA`H}GEB6GP|o?qXK!lPNocuKkzH8b#uf$CZh84r zy(jleizr$<FxU)mFg(sH&&zpc^?0?83GomSfEx@Q{6{L^hsGSf^l@T2)ZEW1(U0N6 z2ZcEZ8cuQmKaEiZm%|2tVf5qz!9h65=}USEzL492XKizBFkv1dZ6|zVBO}i>o?5-H z9~6<3jFNJ9toCaAtrALd<88Jy^g2Xn*&9;G-yG4Rzxei*<TtGtIl6h!RMqeGeb4tz z^q`(~fBiH&XY9%RX~jTZ0==N+?MJu&09w&c^%?{1%l+A<DU3N@A#!uDEOFmcmOED; zC&;Fm#8SCI?M0+*wn67p$B*)9pC;M&kh8NKWSrLZgiqk*67Wwe1xSctk({1`>r?96 z8;&Dvx3<$6(8zM5*=!8|0IfvE=(NfDOd=d!MutU^9BKqEI-1gWQB9oCYwt&G<C%_h ziA1PFIrc)}=RX`#0!O7P=KXGAxLH)FLaH`QbO*0mpPOdMLF-eEiRIHxO1e0lMpec_ zoKc~q=(xNl2T2i?m~#g-uSvL=d&tXVH<sL}hoM@HZt{)7j1M~7jw2({?lO9u*64@h zO?MEkHZC*dH~gw;#o*i$dY*L@)nMk>IqEfh_o%9gJSEArFV7jO!tN(8SGMFBhShML zAsELhs8vPB?>h?>g-5k35Aco8<x`zJVnlL@7&bYK)0d*D(GB_Jc?v=fR>IWP#wU+U z+VOcuFo9Hjzl~>;OjWGqSy@g9-^!%!<=Vk`o#C@$vfz&89V;s*(^<=YRYa0WB=1_X zw|%=564J-nL;ae@`qLi{LUwHDopo{D#yRytApyV~&q}-EC%df~CrToayL+RrEx!uk z`M*y~>RdMxZDS1D^pTt#9{TCVY0H(}Nnj4$YP6F~N{!T?Dj@^4R9|ff^V*A)JtNI@ zF@!=*P0UDxAeL7Q{W=a+oy}T3bDau+>~Kh^xhWE9I}38!OJi&bc+aA>Ri%UEd#9ME z<<Ruq!@O(;*fmlU+9Pe;6<|Rcb{a_Q*PeVTm~2hc&XF0v+lJi#0Ce9<Wb=M1<s^iw zVD@M0M5=(Dm7vC~olDQ3xWAn}o{Ydwxpw~mlxaga@v_|9NW<BESozbX(O`&7*E)y+ zA`O;30T}|Ob#^L%fJwz&IGe+#w1_-+DYGy-_u8kq;k7Mu!7q4?vfDZ|Xxf}%#@{Mi z%R{vXr2edUh<io`EdXtuj!%7D@TW>Kze-dsxGlG>$t-$`gaOVuk(_>FoVrtCbsd^; z?^ll9+U8UQkhv;G`6TlARQJA$##wEa?j?6nrcF*s9J9-RhvQmYdQQ+5);U|7DzW9y z0=a(sZLWg0C|s_l=iyx#;kmXKF7$nPTy8g!zCx~GUr8bawzgzko@A5Ou1zN0xj+N( z@uE>vERZ$XW1q86#GlYnvx_%;M8|9>CZd|Hy^BpJY)AQ4S@_c*Qg~=FSfKr^n!Y)# zQ=eHct&iA^_QhO91dZ)ts#0S(-O#w=QUz?JUc&x=jb)u{j9hTz+F8QH^FdXQjPjkW zAUloe(}TEtDBpb4se-<cOT;H`d63jq#76gxNzeUDfM(7?j)t<!`z}fHgbixUv{1H) zX^$QPx$XUH_!Vs@&+x8}7F>h3(<S6cyXC;mbXGIE)(FADWdx2{<|{9j`?}OWA0m8d z=ohK)%`vrq8kykXu48h9uvTHu1k$F7V=%b41mjwrEm+;2(hBs&LAd~qMP@~H9M!oR zIz6mj!rJCFnjwIBVDs>&U_@&;w6e5B_!czhUJ8x;n{OZ^P7XFYs4bd)3lsY|kyw8I zL8r2MI-Cm9xypKP)}$lxAL`4m?wjdBJl~28&jxx&`O{QFXCP#fcA-Zt4zAeuNBU3} zGRT96ynN+pn4ck^)|pj&^0Gkc2vud@9NW&P^z2jf@T#!9CI<V{+3bkz8*4&Tjzk&{ zXAbsm$E$!m_oXu5K^$|XuEj~SytuKOwYHN(;~Bs?9!87kO`DBz8{cK;!F(yufpgQP zRGpQ*EM#E?o2Po<4(+fi^SZ^H?w}wmr_Q|jcU_hgdo#9AQ(lfg)ybEs5skbvRDxW8 zN6$H+!y50u`cM<>7gEmS_VMrnk)OB(TSyBJXlWQdO+`3^bU}&n+-p4l0Ig|?WCV+7 zmu!U_d@D?UtVQo7)I&rHGmWXjs9ZwmS=q~R)mICita($nP_gxeEwJ2@cO><!E!$?3 zf=inP86c@E_}18X%P&^&k`Dd<06MB6o-1+KT1zfH(UIrMvs_`-y7lK-?9Gxgb3&5s z5A%73cEx3%_C2AG5nBHM#M04x3xyevkgjX`*YMfE1RafZ@c74-CxxcF<k5kr+TORU z@r^(`9B)$C>|fE38VSRZB=w*wJtS;!c|2K1<4Z3NGrT{E`lO2PrIm&p55U%T4WvWI zXG@Q_3h=S$Fjva6(fuxu60l*Fx{u;Wskp9KD^4>7tF|YJ<2#ks2L1Hr;q;LFV%Av$ z4$lB`?E%T}%^Rbjwe_p-q!K%vQM825Z6k(gpCfUH+vP^Xe5Y#J%;xFmKt|$!)t6ZR z0NXSbdB+tvxR0;dkEx+k#c{#ktp^WUvae_fAhO{`Ihq0C3pDKR+iD~zpdem1x1^uA zFg_G(vzMekm1P~*!@7{r8-4q!eH=}>PS1tg4Ywta#-|Z>fVjs~OblRdX^kaW0{3z4 z$mf=MRbx9&UMJlaFZPAB>KbxA<J6j;@;p8xeMdiqabw%2(a4}(usnbV@UKpFBZ~HZ zE<&ib8=rj#F0_OyX+_I&11EZS!->|htakCU96Jqdzkc;Q)IDyIn94((=mXgveQP?s zBV8Y{Zz_tZQ*E)TKHwMWS10jB^>rb_;Bp={QVPrZQE)^y@B{A>?d8aRbvd3a;bXSl zD>eQv_ydz{>b)Ov@D;8MvY)L4Id3YuA_t@-{{SaR<D`Bym0V*_E?lZ2pgwfML=C1n zhwju_+ObE?U*a@SH#ntyITqtO2kBh**3-js?4xSigVtQDjs<I!H!s)OQTf+Jy|czH znElbuttEPTJ(LdNLBNBx0Z-{0f4jo|)Pkpz#YSwzG>y6Ru79epm~XKJfw;-*PG#9# zNbt!HL1GuC4PKLb2vSe<hdv^f>^Y9lL2cXm#;E}8qB48D_X8h|5|x_h!lN)A?)@=E zvK)f!WX8p5eZ$k+*Ep>!oUPN&f<@xHaI2r}8UxOFu+7wX{{Y(`Q$nH~aI}qu+>WP^ zq-lw6k&N!o`$n0FbD$~jwx9ly^rn<*cV{6EJN&7Q0rFG~9nD5dlf5JmJwe#6liC0W z!k#{C`7W-JX`o{#88m3toGBYzvH_d`yH>bHSyT6VjEk>341juM{{RD6{{WMEUkvP! zDQN*v4hXJpDJ^fE)HbftN@Ql$n)EDkN}C86-k8~${{Z3!TLg+kQo7Y)8?=WTcXj+I zwNfl5If>hl3!jxN=Aq9`uk=a@=qokQGIr9c0nFl!5_~#D%bm2a=T+p=Vtj<_-yjpd z)ljWuy&`36ryv~b3O))m_?pi<+e~~?j`QD8wfCdS0?fqh#4ncBrxe>f>p^S=ziT-= z;~eVhVjrYw{_B;P1wP3GJhv5{i;QC&)@q@k2~GnI_ZXlCfZ#HG=)N3VsKNogbKhFP zNWRW%ZVy><_|kBwJzB{ZB$gV!eJgwFG4U<iLJ&7{HWV5{d%hq6KsKy&oQ|e}wI`%Z z3@{-a+@Hd;<h?Y-O56S4#<|o6UVtAw(}I7%++^DZ0N@?#S$b#sVmDSANW-tXd;AR^ ziF7d`VsVg2!4)^A)A@Q5G@OCA(vetk4#$0|RL8Zh!ndwx9&6`PNW52W6LbBa&X{2C z;Ps1za&U^ean#VLK#GbLKm)pwfw$|L04bW9{Qm$t-=dGDIRYks&{GA@H`<FsfhI-A zerj`R#W$AH?tqTL0mh~v)k&;-PbJ=cAdFIlL<t@~G{WnJWo=yk({1n-wiB(f&(O@; z<aZ>TwvpsNj%$;jE!RgB)Fg74+dJbQl}8NTN6Fz}0|aBQUX|bLo2@3GRZPC!)Dk4* zNpf;F8wvsIWzllPbWEJ@rzVy3_LqF&Y{Gx;Fkgo=QO$J~jNgG9ZJt#V#fsd0usOy# z)kNg8D-mC8fZg?_h=TQvOQi3PxaUh<AL}2*+_;8Q?@C@mJF;_%!q(C&2jM_yeH&JI zX9^b~!O8NixLI;9L&*^ulLT@g)|Mhu98EoMhR%mpqNTSTM*jenWt3d3IjnTll(rqr z(+;2%d%}#oIJoAbx$9D-LRk_pzViWB#eb4B?lpiFP!tV@1$BP2o&=~FWAiiwh|k#r z(9jJ5ko~}#dJO*nq%KXw00LDMl5w{G0O?rfyl#~F2dMJRW2$>5*yoxgryMRCJ9*V` zbFl<uVAiw5exP;Qh!3j`LAnvWER}`q_yLrmAY^kjp4;Bxv?V=~X~s5K_SNNE*D+2q zJnBLp7~6#0e`oWiU#wemG%je<Pz*oHfCI2J1r^!VcKtDdkA+dgCvImZgK@<KC`PG* z1J7!U-c5M!q09CSa1<YKW6HG2m+CmjK~v$BAFUe;%PBzN$aBaYzBRnM!IhiI7?%JB zCnKIdb?4`IT{z801E`RB4z;%g?Vl~_E+ysc@*MitTwqz|XvPx&owH7ejDYISa(a_W z9Zj<=5#-a6BYp#K){zH@N>{M}a?4}oSo7B0Q1TMtTnvUAQl10W;P%>F0tndVw8zwE z;@T;&y_*pD8)vVDYa>0Ik~J@s1x|WZb)nlA#bsG9WK{PR*bkj@W$S!zNL4D^Md<5d z8MoVC<y&z0&y}P?3V>@?dRBTxdiI<*L}v{#&`*b2&pV~#7}QN?NalG~7U{I?-s2-1 z^`mfvHt9i-@6v$b;YXq^<8aX<W0)1sm#f-u4PMiTMc_&ND!9L~WjbkmE3@^SH6Ye> zjz^!B0WUxbGqnL7kJ>OCkLf^XCgQ;^=TiZZLuu9<8vr)P&*xcOrq`~C{Hbo-?a#;` z%9q)E1m0M&-Yj?f0-VZG^Jj|7mxfEJ76JBboPfsSl_U+RC}8G1cTugEl>BX#2N|rg z_0>E*sSY)!MmzCDD~s8am2^Du9A$jz8W$Qk;S>0Q^`MxyJ=7Vt_)sB+-)a<XyQmEF zu`cbM$u&TOmyHJEXcX<39k!<XzR~y!Q{A+m(H)qxm+v%IaGBbi1qXg~1(V6yaQk)6 z3ytyJnym8HD8_Ff>eZ5S=bGiZZ}>FbPW;H{Tky`Aa(bH+ZIU;xnHf_PwyA){6dEMy zILSPRofN-T@TiIi<0Et!$9*lTt9YHrS%~IT1p~*Oa`H{&*9)j-9y5RvXod#aL-|!s zqO97|*76&Rg^o66I(1}@Rd`+2S<OY(%%J1i9o5jvx<(>Bwj^ejULH5MpD`@OiQLyE z_0sRgkZL##VYo@a0kxA|JU%hc)x<<|+hJCSqx70kZQ%suw1oTsta%$?p|)RZS=bKx z=g+o~%$PDUT;nw7Lqq_Rj8ps~V}4Xm1r%{KnG1~f6GrqR#xU_hs!m84=U7|X;^TrN zH18vFRomlQaYD|o3k+?)=UovS2_iJh9QAJ+X{j<DF@|h~=bB?0fjz`(#nMG>DoMf4 zHmLg2*=QI5S%6~aB%0^9wf-LMAt!jp%9si4Pu&85ued6gh*JPyW~x-wX_rK-y#d;Q z<mxDboJK0FJF0B$wi$J!@daY4`O;4K?y0T69?-SB%n|pNkU-;`aH+l@S_}1!kl>7W zP@_zC_|PG?<wA_G=Rjux%bzn;Wd~5+m?0Fh@C^xAq{m&VV(0ZU(wYm6slesmCYW1X zBI<>4u!sR!^LRMDCuX1xs|MG?s0vgL^Ie=D)z8W5N}M1Asji65qdCNlQ$vuR+CK+h ztt^7ld7dTIxF??Cqc0B@dg<C*muBaT*FN1cbc~+UZ&gu!UhriG{YE*0DB}Lf<ng3V zV0TwznucOROXNr4Q<sO2tO*0z@vd6xgy~4y-$wW0zx6eA@c6?&R$Pk#u&b$z{{W=h zy|0sgRhK7?uv4QGYQsF3S10R3dPV`|SC_2!M-a~EzKi0ZWdmDz(TTbOM9Gf38k~+N zF7gHFO-_SF!qg7XV_*i=uN*Aa0Gt-;HWj)KTY&dStTG2mLZ{v+Rgezqcf!ZlopB;p zjL51;1c8CJ)z6b!9OD@7tm?lASmgLn2v~#hpd($3GM@^lnr?DS<n;om5k2pP6VM~G SZPZbcu=M(qS=U}ZKmXZ7Z^m-~ literal 0 HcmV?d00001 diff --git a/psycopg2/examples/threads.py b/psycopg2/examples/threads.py new file mode 100644 index 00000000..5477aa8c --- /dev/null +++ b/psycopg2/examples/threads.py @@ -0,0 +1,160 @@ +# threads.py -- example of multiple threads using psycopg +# -*- encoding: latin1 -*- +# +# Copyright (C) 2001-2004 Federico Di Gregorio <fog@debian.org> +# +# 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 the +# Free Software Foundation; either version 2, or (at your option) any later +# version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. + +## put in DSN your DSN string + +DSN = 'dbname=test' + +## some others parameters +INSERT_THREADS = ('A', 'B', 'C') +SELECT_THREADS = ('1', '2') + +ROWS = 1000 + +COMMIT_STEP = 20 +SELECT_SIZE = 10000 +SELECT_STEP = 500 +SELECT_DIV = 250 + +# the available modes are: +# 0 - one connection for all insert and one for all select threads +# 1 - connections generated using the connection pool + +MODE = 1 + +## don't modify anything below tis line (except for experimenting) + +import sys, psycopg2, threading +from psycopg2.pool import ThreadedConnectionPool + +if len(sys.argv) > 1: + DSN = sys.argv[1] +if len(sys.argv) > 2: + MODE = int(sys.argv[2]) + +print "Opening connection using dns:", DSN +conn = psycopg2.connect(DSN) +curs = conn.cursor() + +try: + curs.execute("""CREATE TABLE test_threads ( + name text, value1 int4, value2 float)""") +except: + conn.rollback() + curs.execute("DROP TABLE test_threads") + curs.execute("""CREATE TABLE test_threads ( + name text, value1 int4, value2 float)""") +conn.commit() + + +## this function inserts a big number of rows and creates and destroys +## a large number of cursors + +def insert_func(conn_or_pool, rows): + name = threading.currentThread().getName() + + if MODE == 0: + conn = conn_or_pool + else: + conn = conn_or_pool.getconn() + + for i in range(rows): + if divmod(i, COMMIT_STEP)[1] == 0: + conn.commit() + if MODE == 1: + conn_or_pool.putconn(conn) + s = name + ": COMMIT STEP " + str(i) + print s + if MODE == 1: + conn = conn_or_pool.getconn() + c = conn.cursor() + try: + c.execute("INSERT INTO test_threads VALUES (%s, %s, %s)", + (str(i), i, float(i))) + except psycopg2.ProgrammingError, err: + print name, ": an error occurred; skipping this insert" + print err + conn.commit() + +## a nice select function that prints the current number of rows in the +## database (and transefer them, putting some pressure on the network) + +def select_func(conn_or_pool, z): + name = threading.currentThread().getName() + + if MODE == 0: + conn = conn_or_pool + conn.set_isolation_level(0) + + for i in range(SELECT_SIZE): + if divmod(i, SELECT_STEP)[1] == 0: + try: + if MODE == 1: + conn = conn_or_pool.getconn() + conn.set_isolation_level(0) + c = conn.cursor() + c.execute("SELECT * FROM test_threads WHERE value2 < %s", + (int(i/z),)) + l = c.fetchall() + if MODE == 1: + conn_or_pool.putconn(conn) + s = name + ": number of rows fetched: " + str(len(l)) + print s + except psycopg2.ProgrammingError, err: + print name, ": an error occurred; skipping this select" + print err + +## create the connection pool or the connections +if MODE == 0: + conn_insert = psycopg2.connect(DSN) + conn_select = psycopg2.connect(DSN) +else: + m = len(INSERT_THREADS) + len(SELECT_THREADS) + n = m/2 + conn_insert = conn_select = ThreadedConnectionPool(n, m, DSN) + +## create the threads +threads = [] + +print "Creating INSERT threads:" +for name in INSERT_THREADS: + t = threading.Thread(None, insert_func, 'Thread-'+name, + (conn_insert, ROWS)) + t.setDaemon(0) + threads.append(t) + +print "Creating SELECT threads:" +for name in SELECT_THREADS: + t = threading.Thread(None, select_func, 'Thread-'+name, + (conn_select, SELECT_DIV)) + t.setDaemon(0) + threads.append(t) + +## really start the threads now +for t in threads: + t.start() + +# and wait for them to finish +for t in threads: + t.join() + print t.getName(), "exited OK" + + +conn.commit() +curs.execute("SELECT count(name) FROM test_threads") +print "Inserted", curs.fetchone()[0], "rows." + +curs.execute("DROP TABLE test_threads") +conn.commit() diff --git a/psycopg2/examples/tz.py b/psycopg2/examples/tz.py new file mode 100644 index 00000000..c27bf302 --- /dev/null +++ b/psycopg2/examples/tz.py @@ -0,0 +1,69 @@ +# tz.py - example of datetime objects with time zones +# -*- encoding: utf8 -*- +# +# Copyright (C) 2004 Federico Di Gregorio <fog@debian.org> +# +# 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 the +# Free Software Foundation; either version 2, or (at your option) any later +# version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. + +## put in DSN your DSN string + +DSN = 'dbname=test' + +## don't modify anything below this line (except for experimenting) + +import sys +import psycopg2 +import datetime + +from psycopg2.tz import ZERO, LOCAL, FixedOffsetTimezone + +if len(sys.argv) > 1: + DSN = sys.argv[1] + +print "Opening connection using dns:", DSN +conn = psycopg2.connect(DSN) +curs = conn.cursor() + +try: + curs.execute("CREATE TABLE test_tz (t timestamp with time zone)") +except: + conn.rollback() + curs.execute("DROP TABLE test_tz") + curs.execute("CREATE TABLE test_tz (t timestamp with time zone)") +conn.commit() + +d = datetime.datetime(1971, 10, 19, 22, 30, 0, tzinfo=LOCAL) +curs.execute("INSERT INTO test_tz VALUES (%s)", (d,)) +print "Inserted timestamp with timezone:", d +print "Time zone:", d.tzinfo.tzname(d), "offset:", d.tzinfo.utcoffset(d) + +tz = FixedOffsetTimezone(-5*60, "EST") +d = datetime.datetime(1971, 10, 19, 22, 30, 0, tzinfo=tz) +curs.execute("INSERT INTO test_tz VALUES (%s)", (d,)) +print "Inserted timestamp with timezone:", d +print "Time zone:", d.tzinfo.tzname(d), "offset:", d.tzinfo.utcoffset(d) + +curs.execute("SELECT * FROM test_tz") +d = curs.fetchone()[0] +curs.execute("INSERT INTO test_tz VALUES (%s)", (d,)) +print "Inserted SELECTed timestamp:", d +print "Time zone:", d.tzinfo.tzname(d), "offset:", d.tzinfo.utcoffset(d) + +curs.execute("SELECT * FROM test_tz") +for d in curs: + u = d[0].utcoffset() or ZERO + print "UTC time: ", d[0] - u + print "Local time:", d[0] + print "Time zone:", d[0].tzinfo.tzname(d[0]), d[0].tzinfo.utcoffset(d[0]) + + +curs.execute("DROP TABLE test_tz") +conn.commit() diff --git a/psycopg2/examples/usercast.py b/psycopg2/examples/usercast.py new file mode 100644 index 00000000..5c8031f0 --- /dev/null +++ b/psycopg2/examples/usercast.py @@ -0,0 +1,126 @@ +# usercast.py -- example of user defined typecasters +# -*- encoding: latin-1 -*- +# +# Copyright (C) 2001-2005 Federico Di Gregorio <fog@debian.org> +# +# 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 the +# Free Software Foundation; either version 2, or (at your option) any later +# version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. + +## put in DSN your DSN string + +DSN = 'dbname=test' + +## don't modify anything below tis line (except for experimenting) + +import sys +import psycopg2 +import psycopg2.extensions +import whrandom + +# importing psycopg.extras will give us a nice tuple adapter: this is wrong +# because the adapter is meant to be used in SQL IN clauses while we use +# tuples to represent points but it works and the example is about Rect, not +# "Point" +import psycopg2.extras + +if len(sys.argv) > 1: + DSN = sys.argv[1] + +print "Opening connection using dns:", DSN +conn = psycopg2.connect(DSN) +print "Initial encoding for this connection is", conn.encoding + +curs = conn.cursor() +try: + curs.execute("CREATE TABLE test_cast (p1 point, p2 point, b box)") +except: + conn.rollback() + curs.execute("DROP TABLE test_cast") + curs.execute("CREATE TABLE test_cast (p1 point, p2 point, b box)") +conn.commit() + +# this is the callable object we use as a typecast (the typecast is +# usually a function, but we use a class, just to demonstrate the +# flexibility of the psycopg casting system + +class Rect(object): + """Very simple rectangle. + + Note that we use this type as a data holder, as an adapter of itself for + the ISQLQuote protocol used by psycopg's adapt() (see __confrom__ below) + and eventually as a type-caster for the data extracted from the database + (that's why __init__ takes the curs argument.) + """ + + def __init__(self, s=None, curs=None): + """Init the rectangle from the optional string s.""" + self.x = self.y = self.width = self.height = 0.0 + if s: self.from_string(s) + + def __conform__(self, proto): + """This is a terrible hack, just ignore proto and return self.""" + if proto == psycopg2.extensions.ISQLQuote: + return self + + def from_points(self, x0, y0, x1, y1): + """Init the rectangle from points.""" + if x0 > x1: (x0, x1) = (x1, x0) + if y0 > y1: (y0, y1) = (y1, y0) + self.x = x0 + self.y = y0 + self.width = x1 - x0 + self.height = y1 - y0 + + def from_string(self, s): + """Init the rectangle from a string.""" + seq = eval(s) + self.from_points(seq[0][0], seq[0][1], seq[1][0], seq[1][1]) + + def getquoted(self): + """Format self as a string usable by the db to represent a box.""" + s = "'((%d,%d),(%d,%d))'" % ( + self.x, self.y, self.x + self.width, self.y + self.height) + return s + + def show(self): + """Format a description of the box.""" + s = "X: %d\tY: %d\tWidth: %d\tHeight: %d" % ( + self.x, self.y, self.width, self.height) + return s + +# here we select from the empty table, just to grab the description +curs.execute("SELECT b FROM test_cast WHERE 0=1") +boxoid = curs.description[0][1] +print "Oid for the box datatype is", boxoid + +# and build the user cast object +BOX = psycopg2.extensions.new_type((boxoid,), "BOX", Rect) +psycopg2.extensions.register_type(BOX) + +# now insert 100 random data (2 points and a box in each row) +for i in range(100): + p1 = (whrandom.randint(0,100), whrandom.randint(0,100)) + p2 = (whrandom.randint(0,100), whrandom.randint(0,100)) + b = Rect() + b.from_points(whrandom.randint(0,100), whrandom.randint(0,100), + whrandom.randint(0,100), whrandom.randint(0,100)) + curs.execute("INSERT INTO test_cast VALUES ('%(p1)s', '%(p2)s', %(box)s)", + {'box':b, 'p1':p1, 'p2':p2}) +print "Added 100 boxed to the database" + +# select and print all boxes with at least one point inside +curs.execute("SELECT b FROM test_cast WHERE p1 @ b OR p2 @ b") +boxes = curs.fetchall() +print "Found %d boxes with at least a point inside:" % len(boxes) +for box in boxes: + print " ", box[0].show() + +curs.execute("DROP TABLE test_cast") +conn.commit() diff --git a/psycopg2/examples/whereareyou.jpg b/psycopg2/examples/whereareyou.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f508c0ba11e52031d7ce839da4f149a3f86a4b47 GIT binary patch literal 34980 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%0AVDH#;1_qnC>;7 zlNn;Mx~{WpFBC(>S0l0)YDthyPW5(nZyO4%TZdG%J=3S+724sGRKEGY&NpYe@O#mJ zg%`8WsCm&x&(eOld(qGQ#HXKe9~}!*KWhi2zY9{&qr`(anf(H}v+dD`PGJm@%caa5 zZy->oJ~=-ReQm8)H=xUB8RS~D-A=^X+oV#G9Fhkre5Caww2icxpqf^luG6fI(*bbn zf)8jr`zV){<2iMGPF8()P%H=O*+;8ym1hpCh-V}KDv9OnVp|Dv!;6H_Pi@<d-5b0L z3|wQ$pf2-PfL|TT%Fas^0m_m_$8YCTjrQnX9$Q<Bbcz6YgiFK4j21b`CYUlo!V~wi z?w~9vS+*Nc6W}1^92x`HfoDcnUSogbO3n{yLv3woZWcAmk>xfwKDt=JZM~~~`znbQ zVh-C<G<XBKEz9Lhimznq^&2@kak-560;K$fFe^~OwnhDU5FZi5Gw#i2<mfn!!Q++R zy@{@@XAG*0cGUzq5-FS5`8TG5AEZvUy1kt2aEUVU9_7vtyELreZPr=IzL7D4paJNt zD&p%1dbDK5;oE;n$oSS+eTqUw<GJJ8gs9>5oS&5`{j>i7hBhV6^{EH|Dihjh2oe-$ zn+j!K=O9s_15iQ;kaNZ<1yJsSL(PUj@TM4lq#L9$Tf>qzW@Gz1e8oRqjk$ELUCSQR zR#GY^gGQ0Qpq?5H6GaZYq1=6EO}CUB@x~9jxH6iq%r4^l<l;l<sI4&|gUHn_^Vu?d zMRs9#jBw>Ol`Ott`A1Ulx`_KxzlA&4&+&(S5pVRHtN6nw{Y0wIxX<IG>VKqz_mAOf zS@d|bu5mN^1#{;)Z-bF((#tmuvW9b#RY1w{uB#Z<l{5`e=4)GP8K#*}mhq`0&_9o| zqyCnXZ5L3nxM=TeCqohmWQeH;gFMf0@uKBE36I(`D_e`}h_9!(irgfK;c#*lNWcJc z7}$C!mSV5FbcMZbLhf6Fpc!Om$97E+hX_XwK;P3q2Xx$Uykl&PW5%AscD_szuX2iD zbaYVmT(Xb`cBCFFs-X>pz}RA(pQ1t$latKvNX53?9-0F5!QPQ2#hz3eaVc`#@yeAC zolbF{RKZ@ebvB)2*TWEy@r7<9fPnquMY@|4n)gk)d)+=MT?#oKR@lk!9tMg2&Wp#9 z>G)7Yx~2q4G36ZTzi{Hm&Wm+61m8-rtRSvPR&n8h&a=y$p!nh^(VFdyswGdNn9`@f zrXNIn>On1z#)7V|q}@HmzMpq4?JctLp7VjfzOl+KQ?LY2#9Lx(n%`Xi0P6k*hl#CH zcHgZm!@v@8?!{M&T+u~D#x-2>JnLc*?b$>Krg*vFQV)hy@Zg_CJ(8=i8ZH(D6Uvun z0xmABE-}NkGTWN;x2@Eryt#|Yh61pHJp}Fl00}<2Ez!upzCo)BiKJ-pP#y=MpJy~1 z!$5RSgx(2sm4u%vCM)XZJ~hYXn#t4Ryfl|Ptz_uNGwwKbC{O#v_}52<{{US${M=+u zd$ysfc)V}yJU`y8Y~_{9aOa{8pQPPT_rWLQN_qDY@zXU=J|Escg{fuIv1X({ZvKH> z`F7t29n-Jn({JFsfPo}U#JT0@uE@ux>Mx}YV7f^x7ObnuRxA_i=TmWmX8M29jCP{n zw@2*U+>mE3?#5C%ad8uxon!RDKD!@CwJ?!suCh$Pa6;e(9)K!6b@bZEuc6bTFLA{f zQUS`Hs-i`wN_5h{r9beRH$Q6h%k;WCyL-l2VQ|2MoKw<z;d~px86T=B10p??!ofg! zGY+M{YibGP18PRPO!)^m+<+;-^hi{AQKH)9ej$K2q&7As2@Xl$Jic^^StBIVID>_C zD!?#2!4!>5j1n^5q3Nbiq&zYB_EIvt`)<EZk{{OX@f-Z9WzY*No4aEnI3~%79o$3t z8qddflo@p6jj_#lGJMB01r92LF&&zKx+vOdk|gt_V5^?<u%%14UrRA-ZEqZ7?Bh`w z@LXV4RcoBfEvgvU2P?57w2XY~o6nE++*TsE0$QRCl^6l&$MUPfY6`oAGUKp{&^(Oe zDBQ<yg&?zpF8=xrSh!;^0_-u}&Vo)=Ql*Gi^-(q%%~wzs_ID2fBgyhxvnOHiHBhMp zmdR<+i(WPRN#|Ku5#A0zvyXj8lkwWTf0GT;jUEdj9o@0Sa<NuIc^-RsbE)xXZw-8y zNz7(Q6}uF8MIiG6gMC3f%?8l)LipQijS)UffO|*%>kl;JZ9G?(MwIc#n&htBX$;@% z(4OfB#<uW&oWJDF-IHFQ^Nyr{V1Lv~>Cd+;Ht2JIq^&^r!6)KMGx&cUJ5=Wv?;pa{ zvgq+<WIt^FfmmhRY%2$#^lH$mT<VQ0f-)`Q82<o?zCe2Gdz6Uvy|rtnXonmcNFCf# zHAnvdXa4}w>wOZzpF9zuJb)VtUbptCl>Igx9@6ytYna@1d`rG@PGLv1Z!awLole!o z%og)8U5h9uJ(Tjtgg6|L2rg!WK4X>7pyIK0PGe2c_mA>$PA{|)6vwrze0p<dHBW7b zOLSH^+Z9M&BnoMPD%l{=6v|6DLA@$aR7wT`=Sb3+4kf|m*+4)8+uKiNp%KR0VEIJS z8W>#lQ~>PT;7}fcw*068q>#Mo0P+FnL9AiLzh`9uOrd;~AQPP8j=_9U#!^@rO7&!> zI}UgDZ(RNyY|89joN9QwvQVEbNenT#BE1O8sm?_(rcKQ-u0ChcK;+j%0kx|jMnIWc zaoltArI$iF;JQ|Wg!x$=*!k8A_*r?WrKX%nQe9*bfHuZk6kK=MJC6?$8OYmuS~co1 zOy4?Z48Cxno)*Gy%i%~w7YzJLJ29FKR-txnY-X4z6GnvNyJ{gh&8_s>ypieC`KCi8 zt~MM1a`&HTtJ+rT+Jj%*6hn)2K1lC9_0Qzbch)+5cxroBI@Yh2_VY2b7?5FdcJzwZ z$B(Q=d3#dI(FmFY%+MZECx(M)`XZuBn~1uuBEblM)WOfcm1E}1Sm~#W3zklZ`A9L_ zisW^X+<_eMuioPX`)f}GyJ7xC<3x9-^W95-xDWiruB^LqPK^2-f6_(gj52&yjQ$+y z)b&nL{`bhz%b|~KyvGx_pjH_-#1v5A0Ha}5qxKsTZa1pZZbr7Tg2N*|s;w2RE}3r$ zb>oc=d)A(buD7+fDgcE!c5O&F-%a$C(Yi@0M}U(Kv<~c=#?D(|mjrhA6WdC&LgiUb zaoBw#s~oN;o*vwfgQf9sv>JfwWK*$Faa|bd&K$XJ7~6ECOK=q4FBgtQU#%^hL9f{k zR|vzv)as3iv$;!&KCq9(n~;5Ysk|IAfyo9&?Ws4ST+Bk?;BTJF0>Z@)nn^vhz^g)B z@naaN2~8#&t3ggeL@x-*pw-VQ3xUl0s0xwOtw{0SXaX6)9!MnmC<W3JE#i!vC_T8M zK~PwN%QT8g2Ywy*97+ap>MKheIoV#E&!!q_u-7DE=3EZ7PkB83{{R~3#_)>G@+4If zwj0w5hmyz9Kso5*2{pS+f<SDM-?91B<#-X;KBykkjoE<<wmDZjLi<Zd-qqGc1hcWp z8Ry$n7e^eH`gBnQMR<V>%l^=9jk`H=@ieug8})=;iQ1e>ODdl=hqj)B*O66A8VheB ziPkXOBL}dI)GWJMDwa~naFOE@obq1ZbvRYc?B{h`rikz?im1mJJhDf_*-@Ta;xzH$ zFElQ(arI3iVjB+Qfqf_WX0!3*y3;(kVH&#FD>RAbb3wc!fbxL)fZy~g#7AN#VdYBP zUardF^51OTo++$$)7-Edb_#_vb4p~sR{gQ@uCE-{E<ZL~$g1yq?MwO`{{YNN(=OQ= zbUgn6q-&oTWcZ3R_;aUL)cn-_@8d>Y40~l}Kb$|HS3XVgN+|LH>@~KKE*NlV23FCY zA+<2k>9MhKleI9{S*MaSQXHr0Q9t>PDKocH2Hu*>F539IVDBDvg+8t~V~qDvHNIM9 zy>L~m#==B%xhub>w(-|LmmL+1_8Qx47NbbJf_=1XI(I_bi%XamCN!4`k^3rsB-CW6 z*uprY@I0y%zBr?gCx@Q&2b;Th4(b5tRihk-4m0bd5b{uGnLhetsiZ7$qlvsZ3N#h< zM~f~=^iv3+{O$aZQBVMUPd}9aLn+}n9?C|p#uSp`Lg)_&8xfkkQ&(N5)eB2)2+Y5v zDmTa&6zHAu$aMP3OU)J=r%+~q1|)u|I3wVFRPh;Wd^ubBEDdPQ2j`sAFw!>k4%!Zi zOC7!2-pjaw09E~GW3cxV>a4t%Sg#Csbm(?nDruxkTZ>f+`v*hj_?-4vJ~{g~&&TTl zYC8Jq(zGoBZl)!2z>rBe*m&+e_0fhKbKJD9%ccu>sUOsiBqc#Ju5rHP9$bxG@oVW% zCjJYt>4uekvRlZk4meK^PThkvvhiF*%2OzH3mcilaR*s9*o<Rr`YJVIlA36ux`Ahz zBaMk8E!|UT$!|>raz)iCS5ky*LC7^a41Y~;Z4%AxvBfL-P66A8xcBCZb;9w-b8dA7 z*IB1eEQ!_iayJ$`M?Cv0Ea&!VhvPzALN%swClW;-I<h;@Gvi$t;UgTfw4(2$mvI8o zaLm3NA7xgHWYa?|E>c8fZsr)IdsXV7-e<;u`!ocR46-b0Jf<N>q|(aj9Ok<2k!&q& zQAWX304vX&-Mf04RjJ&iy}QXHaHt!aa&DGaQ)B?<bw9K#woON$ZtlQc?RBZQ`=GwF zBL4sbPcFnT=ziZw(}UX-zbaY$In%7_U!zan6lKuIwoc&wa{hr>W!r2^bP4b0)5Bc` zM?=HI&tb^c+n1!?&!W1KHo!iSM!@JbK_8zQ`)J$;7Cj(=3g$U~s44Io%MEVMa5t15 z=8Wx2L5ccKy3*&hf=F&+mh?XeSlfuI;F3-`4TrXtUOc<e<D8dUa|tyVAzU+ntZ|Ox zQ|oI_c{?oCbqKB_jU#1j6OuXA;f<G;eq80~v0k-cxm?rOZ@K|=(nmd?G1iCnfIqua zlCgBC_*7s3Dio89jM51}GJFL9RFbM7T!P24h)OZWc%8H0DVyE9DF@w#fUW}U81e<S zpd}$7^TFrJfTk%QiOPg5akCD1{{X#QO<LD81;NB;_co`p2Ym}(+sPFETDlZGJ;sfP z6x1!=*5*rT6bT|?hs1+gM1yZIRR|Jey(5OYM2ZpO1o5<}#AC5lhxe-wKjPQL`8S$9 zu)DkB8=|Hg(0}b%c;=e<Z^o78fp&L6;7w~I6$TA9<oQtBNPJKlt=L+X70`6B{bE_g z8~(Iog!@Gv`F_jRDp|CR5=qQ!$8jd?xhzTXCzUL`pZuz)j^3Hu%g4F5dz-n_uIoCu zqDA|-&UXI*8+cYW`}Erx{C$b&%rnab_s=woY%-{!unsx5tCzN~#V(QMvfV~sR@B}u zr6dh3@_B5hnK;|{)au)7P3lO7y3yF^BH2@hS<jRS$sPXy!i*=jTQ4TC$5EKKzPz@N zh8YJ4z`;;!r+RY;U3UFI1!8YX(d;z`{!nSHi(T48>y3f_br;Fbw5f?~km<Jv$+IZk zy<C{BI7ZPr3^IO=rcCnA7<{PF`#nyF-`o-{z<hU%QqcApr*uP6u-0w<ziwkp84%|o zvA52!^W9^oM}|vw-LVly6m|;a)}2<e9VM0SA}R^s4T3xCqsNaMa`|)TO06X8Be!$R z@RM84oWS)1hrB(FGB2<(KM_Uj%sL?7=^fAOM=1AF&*A)ay+r+ze(?CwmqQ-eJCpg; zo~pwx+d|D7rIKi@0Je(bC(9QR0>8-mD^1D8f^vHYNh7>zXTC^dB#s!Nh$sUc-^R4V z$L&9?Mp<jMQ)|{kB0B^=EOGFyXZYW?SIYsNazIN$kw$zMIQG_)!HiAv(ARp!_1NK_ z?pI#LE^+LwW-@gVa<{fuq!YJS4+{~w2M3<jmz8)%e~%}fVzk3=Kv=CoFIL!48-Jr> z4!d!l%W`r3VZZqAqV#yWvYy~8I<=YGCwdCKg?GvC%@m&!j7eo4x}tm)e(ux_rU9fj zgrVe98g2T=<S80T2<4CmW@#9E+0qCeNgIVw7SDA!82CDS0R<(ol;GeLa7jItdQQbp z(|9ef?kvnQ7luO_#_Gfz6X>O*;U?*1GD&EV+DaPgMvgqN11pT@yPZ7~oojlUYZvn0 zMQ+fm;aev;U_XW`@#v{ONd#uBqBigwyR?Tm$=}ggc{BB!X@(xxO;k44w%|h+1B1Es zR~@$VU9%aC)M+&L8hwMwBdl#X0C5~-c6{q!9yYnWxlM+BI9`C!2@!LW=;V{=<_&At zY`f_n$(J_M#4RpfM=O~XxhVs%_j97rH?vR65{&{`m@>XNL*tM?d;EA*UEY^F<(-aV z>DC;8Pm}1bT(`bmbFK^TZ;Tn6gfNWpaGpoQ*Hwh&IsPS=T_wK1)cBxzZ7g0z4Q(8U zhld~>_vCY~yTsITPAjNszeN`smXj8tJj(_3%<Cp42Qgdkwm(?p5)Ui^w)xIuxYOHN zY@vRSH7=8DFOwLyv${wp!{G3P<(2UQo;dpOS?BFpE|T<0<D>e$#+xb617#d?bv%!< zuP!Fp$Wpd(#NJs4wzIigbr-EDxSY0BaPWbOym8Vps$y-+5x*+5Q>z<>OtS*ff(8vy zG}=YLLh>{4pxlyn#SnHar;_sSOUW~W0-!yLIS-$%xP00B<n%mPdSW9>(<Rrnm^A3J z70(o|KICK0KOy2pMmXDb26=kpw@RC$Hc~QiK^ohj8H}jFQQ7RTM;Rp4dDi7_-<<UF ztrBqgy<y?>W}`0bSY1%={x=QySNPQ4%x6Rx{{Zn7H|CQ56H7mWbnE(o`xO1<_|ca~ zk8G8}{OV6tVUuiG=8_2_>v(*X-_4^+_WeFda-{ALW^2;%ei6sz{GS$M+gh`DTOGKd zDrfFA0)1(?t&rp#KgzQ5^t?MG&0y6fGzE&(66JA<3AE@H>~@-oEHKj^tT%@|dvQfL z>ru&^3{+`CIEFDu*D{qxAZC(6mpt*2S`tdpAG?D{Ez08~KH4@Ofw0Fh@2FGhWK~?S zIqby%pHP3SFIOUi83YwO<WZLgAtUG-WQ6``gT*qx3Xf`fie~8ToY%A7Oj)Lx%#25q z<r9)|{yEX_OV&OA04MDF$lo$?M8%Ws50X!4qu!pOX0OrPTYU~yvqGjaX2wa*z#e`B z-BpHne3hIqCubm6R@uW14hL()AVw@Q019#0+x|IMKbx4}!DPFw9C~EDMn;X54tHVO zSYwU6Ix_O%Cd;LU=IVZ~3$kNIDhXo8nFnLbm303A<WC><#~xmN!smBdNTj)r$}3pB zw?Vs=zy~?-&Ndrjqu=dmC&95taAS6ytWj|JOxOp~d#K*SJ*afH#U^Wec}a;z8TfW$ zI|Ug`q~WF>z2weI(rC=QU0bpaOPm2w{8qI7XkUA*M{#S_Mywf+lucG1Jzdo2<d$kB z(cMztPu8HixVBrAg@cHg;4$&7Y~O4vx7mF)>F)+EwEKmV8x&<>pLIW2B~j4-0HjS9 zPmcTR(#;#(T)e|5NWnXD?Zzqk?6ytxiPBvsq$?HGjH+jacs2(tx$zyJGfLw%s&gwG zrs7!`<mbc@Q!&uFY(8_txbYdPNb74GiO@VyvjdUD2WY9jOl8%pm}QqT8`<gCA|cjB zLEB?feAudZGN%^SQa1{@0zNG8gIQ<ixp5m|;F#UhNnAx1IRRM6+Sae2%q$vPrXOo_ zu+L%+Uemv_y8IqKH(WpDc{g<$?vm>*Z_vG7@*Wc`cCW$<V+4$R>!M@J9CF=$Y13U5 z+7&qw$+mqpjl8t5E~I#j-WMMc{{ZVp(t~;=f6^=-D<|M;oYgvZ8~*^%FYhnJQF<xc zBXRz<FRHQ6w$YV@yFwN>RZ?;SADwBAGulCK0?o9M!m`UXym6hwJm@po-@f42Z}Q_f zj(<x+t<}7Z!nd~M{{Tn@SMo&qQGb%}p4skWgv$a9w2_`AQQ}7`SIdm-OfSOn=f1CL zDb^n_pylOOUS5}nWcjRGq#A-u8UkUqpqec$y1RIp2@JkaBe3(JI`)C63;Q@-j##MT z^weZ=qhvuI!+!dOBNXMKW5RH)!gJ^p$?`I1%@s*rfF5X+v=Ev_FTsp(`^^Utz&;d1 z4SL}r$>-Tj5lK0j^PPt(&m}~Z?NV<@1d3e;m;jxrP>X=dK^X^ZQ-R6#%P+~=tk4fN zTPgdeab0*_##U;t(>2NA9Z85!+r-Rv6&_2B=C2HG=>8pWg~Qry-N*c^FXW%5-@|`n zBiHRC^Q>{`BluD8jZg7q`&<51>2R`#x0zV-;RE>9OtDY#<X5Tct*Xq(rIyfnv7X-( z<5_3q*G;hT>#}=|9@b^^I2*lotml^~tK-JAx`vZInJhliKh^`6q*qQJSy<(Tg@o@~ zGhJqW*^LEFQT&=|TCa}U0?qh&??EoMxRTypu>!H-Dmc_I++&gS(W83Ek`P`bJ7dih zh)uaL03js@a-34QV}2@Ul<JsAG_8!v-s4kzSk=!iaBaNuj1DC}Bvk(Z4nGw<`7M?y zXW>%IjPH<l6teK$aZY)r`G)Z77x0zfG40D3`POoOk&oG0dw+|Uc+h<)*R?Uxi<l;e z3u#>zM;ORZ;GRdqwZqHj>nMz{{{S9yh2@0P`j)dUs1jj0;%tvCPT+yzzI`H;zu!!( z{<{Hqa`&s;>i)t<_p3|V1@u(o=^E7k07?G<O{r(nr%uOwe>Y!B{6#y`XKbCu_fm4- z#<0(}*v2ATdH$@hGLRp$nKjYknC04YwseB%>_V%=b{Jl;;~VD#J|x#oxW*sap)H=7 zY;kjO3ZB(N#@@kG?~ll@T)vL5)}hnv?yR&}?h$VgM|E*CV~GLJ3ZU3$w31JwBvnZ- zXKtpp9LbZh+O=X;t3FmSp3_))THy-wSgxcEGOHDbeF5(k0i@IXn>f5zG>N<DZle{v zZnMY~2{=?9XCojFeJeI`sJQ7=eOKntm&n<i<K0-?<ZX|N-r3vEk?QKj;E_>&@+#yX zZ9IIF>@56Na{|ZHZB<A67CtFk@Wk6j=`ORX-=qp+L>tJ;oQLtHY=Uyz!w}%|x%bvf zL5~R|kgA2YH>BMlA6Q!pcHf9B&)hTSkDXSyEv|^<RyCsjEDAyJm&z0cpn@q_5M#9< z!u0Ob%D1~-&|_ooA3EsqUx>;O=+^vdT#jb2^JUAY!;YrU!~s)rSjN;H(O8s|*;Nu2 z-Yz%eah7jzqbhR~NZ?R8VxaVdj1Uk_1Xp)<tDWlPD_Q%=EsGXq97nNs&2NOs&z;A7 z2eD8?KYMLjvZgDHVwzJKrb|_izJR$X3$wKWYUcugA~wMk0nsp^4~2;yGy%xj3L1b{ z(yN9404C>BIEG^w2O09mI&kAF8=++|Kp};QA~JZ0<@c*Ojy=I|!pnyI?(u(F54nN) zQ^-M`86kd=tvxb-(`uahIn%LToZ7Fe;wj#WcIN#c)vm0yCXU`X*l>bN=jB;t>pO3b zHqHoj1E{(QQ6`25Vg!Vd$ID?`c=3|<&n$|?sdoEGNj{qBm@>Jqj@Bs7cyfGd<}www zi5UYNg<MZBxUoPj)SDqaCb06f#0M2*x4EE_4YdLH6#=NT+SV|86jHQ>B+U~mBQlV| zfd`QsjRB$3FU7^DRK#_WfT#G^H<KM#XOAu7E<g_1=iOQ9qd9hs4dccOft`S^tTO(* zxcr#wE*fnR&87hHITGy5I}fI@%R6q{<KvpuZuIST8`SFG5!?Z~6S4GGnAwvo@VJt6 zn_X)txFKvx+bQ^(xfxeJd6}HCVpyD#d+Mn-mgk8S_lm-`5J<qJ6|o%qjR9nGc2E|P znn9fDR04e#;YjkM9Ankb-I~+Kc`D249z-Y)Fa~Q6C*<n!@rjeUIqs-aKdW7YI42n( zd+SVR=^0rKH1ezzpG{?ZYdRIy4=DCfRF6}>F_IM4nB%nNbqEBq-rmP=8OIUwnD!_c zC)5Eo(>#8?xw6jDHqs<^YxYde*(}6xjQUM!GR82t+f>B`t+^!4B!uMfN1hOUeErov z(SEf%b&-#fvq_%P0*{?fwfHp~%Pxpn>Jvk0r|UMC7i|%iMP(?FfsMF{-0$5>8RxwE zp0N2#Z}eo+&l77JE0z0;BR|5lzAq-Z;X9Isn_RX_W<hbJ2>}2I?Fq==Cy4fqwybZ9 zDgOZVq{>;)X|)|4Ex4oAWNVT)U#kFs_R^U7ewXynGtw(~VPKLZuEPh43}eu9Pt!lQ z{{Yk6oM^{R>2`<IvR~Ls)@{QiZ?N=?eCb>~vhGu!n&t}~CeSB=Ofk=II6hD<#H4t3 ziqc%CX!Vz)8!PxO6uq>{_~r*O>Z_M%vcptyoQ#TON7Et`qxlDSxQu#%CZEc2o`m8! zeG5@KBH7#X>y!HrMoNPEK6pNnY_rdehqVn(e~6ts9ohWVeP1en3U=k)CV0lK**Jay zf<{2x);Y_=r^j^)@2;kDu{qf`RsB(2ULD?8W)(;qn(2&cTxxb4>Hh%3SPA3}GDs1P z@kq;cFajwZ^@o*smS(bB+|wtyq!K~Jp8-mnRSwaQ0ZA$G_Ei$=Tc4|4EPxWHXC30B zJa-ylm#sKWX5C`TF$AvT2Rl|imA~@hTX(B1^!#x0LZz|ZH?6S7Np~6N<mPDN(^ZI~ z2Aj$wjq*93z$+X2X~nzRyWLUM)LY4h;qsVs1os}wzaBc}pO-(8P5!Aaq|m&fLq{J0 zBkvrNO>DpmH6ZAgqY);1g<)E+Cp?7!Eb|yu-x~lZ3!s^0iCs?AP$^p?q!e_8bEMt> z07Cx&gw<nt3`K)*@aLZh&1aWxtU5E1fQ;{1{WdRNcKXQ~+Zh$x;n%Hmd3Ws&^vRgQ zo#jPx<vDcYcrz{pM~ecd>C&sMFkG;C=SU*vOC8AX$9Iiw<F_7Ic`Up_n~SYB%1|r} zvba(jOmoiI2c9wLt#zJVvbu^dwY$wtlk<3hMG6)uf{nZIH$Ened|1wlEViev)R}mA z#7WN?3M)zD{{Tq$iu#FMW=q&dfs-|J68HZAN!vG9bWv{jN9!TRXqPF~9rL4zG;2$h z4%5iQ^TP@?Z**<zbbiTSBuGb#QR+4#K9A{zcYu@o=lId<3);PYk7>P-5$JRLX!V2I zscwweIP!YbJ`Mb6^d9uK^P@9DrR}8>f%izkrEpZtw$kqA!s%s=iaH!`@HL&9<y+fp zXVPn_)<#V~tVIBpNdO=n`5LK|MT+&kVRfxC8%XV@jnZ{@E(SP8bG~`!6!$fu&@Ggp z9DxFtNi3C2mscQjAc6k?5U9?s8N~<GzLf3YILb@`$BKVCGW=o3S-Ls1UqGkvG0M7B zbF81;A3Dn?MjaBo{d<`S$vwEP?;bZ9r#@G8=wNoO0YnA6`cn7-nn7SEn82n_GsJf} zpuuWCqZ@td$I7frGgz(eXb-bM5ds_|9!%g5Z7-psRy-rJiBgbby)sN4s0!tB6rA#) z1k+^9lMMEQM$Ve47#ISV0WK<VmMPkUdb_wC=A=48o*2eEs|JXNCz~HYrW9NNV{ywM z^PnrSZVOZx@%Gc8&Nj%YpdPG(TS+54of&<ii9-c$0YzcVR#x)r$DxI|l9xuy^nyGx zFz1|B{wrq;e6#4iHOg8>#QCZ-n#(WCO>w*<d#;E;bwJV(3~Jnzb}=2Nv<lzH;+@t$ zPbbJu@ZH{qxw)0Fe5|qEs`BzlbrCSOZoIaI;&ye|vN8kQ2*LMcdg)uf(!YeN@Rv9p zgKB=%wF|C>=env;42oeI1JLfLD#RZHM!=Z$OW1tNnK9f>N4}r6Ekhe#lwCq`ENLqL z0K#g$isE@?(i<zn5s8LF_g}ZrY3@||=-3h2R9aUf1sNv*b2N>Iy10Vkd#B3>X9h3^ z#CGS$VehQ+*4GcZJtyWjnCx78nx_)WwaRjb_m9S()T(Ck$EJ!4!w<?50&oj}Pj{9o za#VYy-nI8nEbiFlrn=)f@hAAw&!tCaxNO=FML&q0xnD{jI?RA`P%Au}<Iw^f00nnP zI?za}B*S>qB$$FZ&_28b0kNV{pm)v;Ub@G~yi02(z0Cpj0O-TP7MeTa<Mx(6I?sRD z{tpLXRkWlI{OOWFjCar#N({J-eC9Y5WpxCcfv|2HxtG8iSlz?Rif*m7Qc?}Q0dlt7 z=rxwW$#)tKWq|k8({F93>n$U0^%aWJ5^%mVKvywdW1Ru)U<lNX>Hx^!VMr>xJZb^u zk(wZ2kxVkl3FjLXKCP=PyLDmG)qS_AQ69X0$y>PQw()ky$<QllxU}eECjv(ix1&4J zasK0f(e9gSnw8^R%<6vA^jPLFN%aH5J$1K|+;P(^C$>oH7iL?QBlJq#AbLA$Fvm*r zWzL>ODlpj9*vTfO3+@I@TmcBC5F&u{6bG1~JjDU_C<gjgxiyQdQ?ZiV?Sr{bNARne zCgN+-9Z6!eNTP6BVVsZEs<(vW8S86SYiX_<V1r}cO=sO{(ced3hfTWu-~RwACupM) zyo3A4<3Uv{-ca<?1y^iD^W&M~6je@<=+k4Q+G`*G0FZ;<QJ+e8365<CqO0N~mGqQ< zpJwp`;aTM05+x?PoayA|p2;Be4L;-Xr?C5rx`CkAu}ReRy<2sBTs&CYIOSM*GMm#( zak|-fs5i6|$_=EPVAwC}+b_bhn)W-=&MLG$2AEGYY)8;ak={n~94ch`cE`@AK93p5 zC1g6BjS`hYHXYQk{VOP7q++cPN#C6^T8+w=C&1kw?KOD2mnYnRl}=q8?Xj|M8-5?v zVm<YpTG=vJh;tNzi6zJf!hrS(3r2v`1`)L&gzcP<3Ii3Z9<N%MaN~#v^yjv+@<#qU zz;Ne^vua7w2|mdbcC~NeoU!usS7#^Lg#A`xJ%rY|PwdWL>!S?<R^pKln7l-7+IW9} zqs`Fp&P(NHi;gxPV-RWK%q-@pVIc=9O;tkWyk!_+nl%mMOp<os(<Mc7%9g?fNbEEk zBv44=gMGqJWior!p4wYIK4qg|M3J-GLeIp{CKes`;TZ&baqp)u(lFE&EcD2&2cCSU ztHN=#+sf?({{Wk=cl*EoRX;@-hwS}l<4P5ZS-hd?po%ZwhUNbNq(2&Jk@ko}^n*=d k%j-$M^@T=#RY!1@zce0-bEHn(zoh3H?4P<TJe%VG*^Qgo2><{9 literal 0 HcmV?d00001 diff --git a/psycopg2/lib/__init__.py b/psycopg2/lib/__init__.py new file mode 100644 index 00000000..e40caa3a --- /dev/null +++ b/psycopg2/lib/__init__.py @@ -0,0 +1,72 @@ +"""A Python driver for PostgreSQL + +psycopg is a PostgreSQL_ database adapter for the Python_ programming +language. This is version 2, a complete rewrite of the original code to +provide new-style classes for connection and cursor objects and other sweet +candies. Like the original, psycopg 2 was written with the aim of being very +small and fast, and stable as a rock. + +Homepage: http://initd.org/projects/psycopg2 + +.. _PostgreSQL: http://www.postgresql.org/ +.. _Python: http://www.python.org/ + +:Groups: + * `Connections creation`: connect + * `Value objects constructors`: Binary, Date, DateFromTicks, Time, + TimeFromTicks, Timestamp, TimestampFromTicks +""" +# psycopg/__init__.py - initialization of the psycopg module +# +# Copyright (C) 2003-2004 Federico Di Gregorio <fog@debian.org> +# +# 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 the +# Free Software Foundation; either version 2, or (at your option) any later +# version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. + +# Import modules needed by _psycopg to allow tools like py2exe to do +# their work without bothering about the module dependencies. +# +# TODO: we should probably use the Warnings framework to signal a missing +# module instead of raising an exception (in case we're running a thin +# embedded Python or something even more devious.) + +import sys, warnings +if sys.version_info[0] >= 2 and sys.version_info[1] >= 3: + try: + import datetime as _psycopg_needs_datetime + except: + warnings.warn( + "can't import datetime module probably needed by _psycopg", + RuntimeWarning) +if sys.version_info[0] >= 2 and sys.version_info[1] >= 4: + try: + import decimal as _psycopg_needs_decimal + except: + warnings.warn( + "can't import decimal module probably needed by _psycopg", + RuntimeWarning) +from psycopg2 import tz +del sys, warnings + +# Import the DBAPI-2.0 stuff into top-level module. + +from _psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID + +from _psycopg import Binary, Date, Time, Timestamp +from _psycopg import DateFromTicks, TimeFromTicks, TimestampFromTicks + +from _psycopg import Error, Warning, DataError, DatabaseError, ProgrammingError +from _psycopg import IntegrityError, InterfaceError, InternalError +from _psycopg import NotSupportedError, OperationalError + +from _psycopg import connect, apilevel, threadsafety, paramstyle +from _psycopg import __version__ + +__all__ = [ k for k in locals().keys() if not k.startswith('_') ] diff --git a/psycopg2/lib/extensions.py b/psycopg2/lib/extensions.py new file mode 100644 index 00000000..9233d1d7 --- /dev/null +++ b/psycopg2/lib/extensions.py @@ -0,0 +1,69 @@ +"""psycopg extensions to the DBAPI-2.0 + +This module holds all the extensions to the DBAPI-2.0 provided by psycopg. + +- `connection` -- the new-type inheritable connection class +- `cursor` -- the new-type inheritable cursor class +- `adapt()` -- exposes the PEP-246_ compatible adapting mechanism used + by psycopg to adapt Python types to PostgreSQL ones + +.. _PEP-246: http://www.python.org/peps/pep-0246.html +""" +# psycopg/extensions.py - DBAPI-2.0 extensions specific to psycopg +# +# Copyright (C) 2003-2004 Federico Di Gregorio <fog@debian.org> +# +# 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 the +# Free Software Foundation; either version 2, or (at your option) any later +# version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. + +from _psycopg import UNICODE, INTEGER, LONGINTEGER, BOOLEAN, FLOAT +from _psycopg import TIME, DATE, INTERVAL + +from _psycopg import Boolean, QuotedString, AsIs +try: + from _psycopg import DateFromMx, TimeFromMx, TimestampFromMx + from _psycopg import IntervalFromMx +except: + pass +try: + from _psycopg import DateFromPy, TimeFromPy, TimestampFromPy + from _psycopg import IntervalFromPy +except: + pass + +from _psycopg import adapt, adapters, encodings, connection, cursor +from _psycopg import string_types, binary_types, new_type, register_type +from _psycopg import ISQLQuote + +"""Isolation level values.""" +ISOLATION_LEVEL_AUTOCOMMIT = 0 +ISOLATION_LEVEL_READ_COMMITTED = 1 +ISOLATION_LEVEL_SERIALIZABLE = 2 + +# PostgreSQL maps the the other standard values to already defined levels +ISOLATION_LEVEL_REPEATABLE_READ = ISOLATION_LEVEL_SERIALIZABLE +ISOLATION_LEVEL_READ_UNCOMMITTED = ISOLATION_LEVEL_READ_COMMITTED + +"""Transaction status values.""" +STATUS_SETUP = 0 +STATUS_READY = 1 +STATUS_BEGIN = 2 +STATUS_SYNC = 3 +STATUS_ASYNC = 4 + +# This is a usefull mnemonic to check if the connection is in a transaction +STATUS_IN_TRANSACTION = STATUS_BEGIN + + +def register_adapter(typ, callable): + """Register 'callable' as an ISQLQuote adapter for type 'typ'.""" + adapters[(typ, ISQLQuote)] = callable + +__all__ = [ k for k in locals().keys() if not k.startswith('_') ] diff --git a/psycopg2/lib/extras.py b/psycopg2/lib/extras.py new file mode 100644 index 00000000..847bdb70 --- /dev/null +++ b/psycopg2/lib/extras.py @@ -0,0 +1,235 @@ +"""Miscellaneous goodies for psycopg2 + +This module is a generic place used to hold little helper functions +and classes untill a better place in the distribution is found. +""" +# psycopg/extras.py - miscellaneous extra goodies for psycopg +# +# Copyright (C) 2003-2004 Federico Di Gregorio <fog@debian.org> +# +# 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 the +# Free Software Foundation; either version 2, or (at your option) any later +# version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. + +import os +import time + +try: + import logging +except: + logging = None + +from psycopg2.extensions import cursor as _cursor +from psycopg2.extensions import connection as _connection +from psycopg2.extensions import register_adapter as _RA +from psycopg2.extensions import adapt as _A + + +class DictConnection(_connection): + """A connection that uses DictCursor automatically.""" + def cursor(self): + return _connection.cursor(self, cursor_factory=DictCursor) + +class DictCursor(_cursor): + """A cursor that keeps a list of column name -> index mappings.""" + + __query_executed = 0 + + def execute(self, query, vars=None, async=0): + self.row_factory = DictRow + self.index = {} + self.__query_executed = 1 + return _cursor.execute(self, query, vars, async) + + def callproc(self, procname, vars=None): + self.row_factory = DictRow + self.index = {} + self.__query_executed = 1 + return _cursor.callproc(self, procname, vars) + + def _build_index(self): + if self.__query_executed == 1 and self.description: + for i in range(len(self.description)): + self.index[self.description[i][0]] = i + self.__query_executed = 0 + + def fetchone(self): + res = _cursor.fetchone(self) + if self.__query_executed: + self._build_index() + return res + + def fetchmany(self, size=None): + res = _cursor.fetchmany(self, size) + if self.__query_executed: + self._build_index() + return res + + def fetchall(self): + res = _cursor.fetchall(self) + if self.__query_executed: + self._build_index() + return res + + def next(self): + res = _cursor.fetchone(self) + if res is None: + raise StopIteration() + if self.__query_executed: + self._build_index() + return res + +class DictRow(list): + """A row object that allow by-colun-name access to data.""" + + def __init__(self, cursor): + self._index = cursor.index + self[:] = [None] * len(cursor.description) + + def __getitem__(self, x): + if type(x) != int: + x = self._index[x] + return list.__getitem__(self, x) + + def items(self): + res = [] + for n, v in self._index.items(): + res.append((n, list.__getitem__(self, v))) + return res + + def keys(self): + return self._index.keys() + + def values(self): + return tuple(self[:]) + + def has_key(self, x): + return self._index.has_key(x) + + def get(self, x, default=None): + try: + return self[x] + except: + return default + + +class SQL_IN(object): + """Adapt any iterable to an SQL quotable object.""" + + def __init__(self, seq): + self._seq = seq + + def prepare(self, conn): + self._conn = conn + + def getquoted(self): + # this is the important line: note how every object in the + # list is adapted and then how getquoted() is called on it + pobjs = [_A(o) for o in self._seq] + for obj in pobjs: + if hasattr(obj, 'prepare'): + obj.prepare(self._conn) + qobjs = [str(o.getquoted()) for o in pobjs] + return '(' + ', '.join(qobjs) + ')' + + __str__ = getquoted + +_RA(tuple, SQL_IN) + + +class LoggingConnection(_connection): + """A connection that logs all queries to a file or logger object.""" + + def initialize(self, logobj): + """Initialize the connection to log to `logobj`. + + The `logobj` parameter can be an open file object or a Logger instance + from the standard logging module. + """ + self._logobj = logobj + if logging and isinstance(logobj, logging.Logger): + self.log = self._logtologger + else: + self.log = self._logtofile + + def filter(self, msg, curs): + """Filter the query before logging it. + + This is the method to overwrite to filter unwanted queries out of the + log or to add some extra data to the output. The default implementation + just does nothing. + """ + return msg + + def _logtofile(self, msg, curs): + msg = self.filter(msg, curs) + if msg: self._logobj.write(msg + os.linesep) + + def _logtologger(self, msg, curs): + msg = self.filter(msg, curs) + if msg: self._logobj.debug(msg) + + def _check(self): + if not hasattr(self, '_logobj'): + raise self.ProgrammingError( + "LoggingConnection object has not been initialize()d") + + def cursor(self): + self._check() + return _connection.cursor(self, cursor_factory=LoggingCursor) + +class LoggingCursor(_cursor): + """A cursor that logs queries using its connection logging facilities.""" + + def execute(self, query, vars=None, async=0): + try: + return _cursor.execute(self, query, vars, async) + finally: + self.connection.log(self.query, self) + + def callproc(self, procname, vars=None): + try: + return _cursor.callproc(self, procname, vars) + finally: + self.connection.log(self.query, self) + + +class MinTimeLoggingConnection(LoggingConnection): + """A connection that logs queries based on execution time. + + This is just an example of how to sub-class LoggingConnection to provide + some extra filtering for the logged queries. Both the `.inizialize()` and + `.filter()` methods are overwritten to make sure that only queries + executing for more than `mintime` ms are logged. + + Note that this connection uses the specialized cursor MinTimeLoggingCursor. + """ + def initialize(self, logobj, mintime=0): + LoggingConnection.initialize(self, logobj) + self._mintime = mintime + + def filter(self, msg, curs): + t = (time.time() - curs.timestamp) * 1000 + if t > self._mintime: + return msg + os.linesep + " (execution time: %d ms)" % t + + def cursor(self): + self._check() + return _connection.cursor(self, cursor_factory=MinTimeLoggingCursor) + +class MinTimeLoggingCursor(LoggingCursor): + """The cursor sub-class companion to MinTimeLoggingConnection.""" + + def execute(self, query, vars=None, async=0): + self.timestamp = time.time() + return LoggingCursor.execute(self, query, vars, async) + + def callproc(self, procname, vars=None): + self.timestamp = time.time() + return LoggingCursor.execute(self, procname, var) diff --git a/psycopg2/lib/pool.py b/psycopg2/lib/pool.py new file mode 100644 index 00000000..0468db6d --- /dev/null +++ b/psycopg2/lib/pool.py @@ -0,0 +1,236 @@ +"""Connection pooling for psycopg2 + +This module implements thread-safe (and not) connection pools. +""" +# psycopg/pool.py - pooling code for psycopg +# +# Copyright (C) 2003-2004 Federico Di Gregorio <fog@debian.org> +# +# 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 the +# Free Software Foundation; either version 2, or (at your option) any later +# version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. + +import psycopg2 + +try: + import logging + # do basic initialization if the module is not already initialized + logging.basicConfig(level=logging.INFO, + format='%(asctime)s %(levelname)s %(message)s') + # create logger object for psycopg2 module and sub-modules + _logger = logging.getLogger("psycopg2") + def dbg(*args): + _logger.debug("psycopg2", ' '.join([str(x) for x in args])) + try: + import App # does this make sure that we're running in Zope? + _logger.info("installed. Logging using Python logging module") + except: + _logger.debug("installed. Logging using Python logging module") + +except ImportError: + from zLOG import LOG, DEBUG, INFO + def dbg(*args): + LOG('ZPsycopgDA', DEBUG, "", + ' '.join([str(x) for x in args])+'\n') + LOG('ZPsycopgDA', INFO, "Installed", "Logging using Zope's zLOG\n") + +except: + import sys + def dbg(*args): + sys.stderr.write(' '.join(args)+'\n') + + +class PoolError(psycopg2.Error): + pass + + +class AbstractConnectionPool(object): + """Generic key-based pooling code.""" + + def __init__(self, minconn, maxconn, *args, **kwargs): + """Initialize the connection pool. + + New 'minconn' connections are created immediately calling 'connfunc' + with given parameters. The connection pool will support a maximum of + about 'maxconn' connections. + """ + self.minconn = minconn + self.maxconn = maxconn + self.closed = False + + self._args = args + self._kwargs = kwargs + + self._pool = [] + self._used = {} + self._rused = {} # id(conn) -> key map + self._keys = 0 + + for i in range(self.minconn): + self._connect() + + def _connect(self, key=None): + """Create a new connection and assign it to 'key' if not None.""" + conn = psycopg2.connect(*self._args, **self._kwargs) + if key is not None: + self._used[key] = conn + self._rused[id(conn)] = key + else: + self._pool.append(conn) + return conn + + def _getkey(self): + """Return a new unique key.""" + self._keys += 1 + return self._keys + + def _getconn(self, key=None): + """Get a free connection and assign it to 'key' if not None.""" + if self.closed: raise PoolError("connection pool is closed") + if key is None: key = self._getkey() + + if self._used.has_key(key): + return self._used[key] + + if self._pool: + self._used[key] = conn = self._pool.pop() + self._rused[id(conn)] = key + return conn + else: + if len(self._used) == self.maxconn: + raise PoolError("connection pool exausted") + return self._connect(key) + + def _putconn(self, conn, key=None, close=False): + """Put away a connection.""" + if self.closed: raise PoolError("connection pool is closed") + if key is None: key = self._rused[id(conn)] + + if not key: + raise PoolError("trying to put unkeyed connection") + + if len(self._pool) < self.minconn and not close: + self._pool.append(conn) + else: + conn.close() + + # here we check for the presence of key because it can happen that a + # thread tries to put back a connection after a call to close + if not self.closed or key in self._used: + del self._used[key] + del self._rused[id(conn)] + + def _closeall(self): + """Close all connections. + + Note that this can lead to some code fail badly when trying to use + an already closed connection. If you call .closeall() make sure + your code can deal with it. + """ + if self.closed: raise PoolError("connection pool is closed") + for conn in self._pool + list(self._used.values()): + try: + print "Closing connection", conn + conn.close() + except: + pass + self.closed = True + + +class SimpleConnectionPool(AbstractConnectionPool): + """A connection pool that can't be shared across different threads.""" + + getconn = AbstractConnectionPool._getconn + putconn = AbstractConnectionPool._putconn + closeall = AbstractConnectionPool._closeall + + +class ThreadedConnectionPool(AbstractConnectionPool): + """A connection pool that works with the threading module.""" + + def __init__(self, minconn, maxconn, *args, **kwargs): + """Initialize the threading lock.""" + import threading + AbstractConnectionPool.__init__( + self, minconn, maxconn, *args, **kwargs) + self._lock = threading.Lock() + + def getconn(self, key=None): + """Get a free connection and assign it to 'key' if not None.""" + self._lock.acquire() + try: + return self._getconn(key) + finally: + self._lock.release() + + def putconn(self, conn=None, key=None, close=False): + """Put away an unused connection.""" + self._lock.acquire() + try: + self._putconn(conn, key, close) + finally: + self._lock.release() + + def closeall(self): + """Close all connections (even the one currently in use.)""" + self._lock.acquire() + try: + self._closeall() + finally: + self._lock.release() + + +class PersistentConnectionPool(AbstractConnectionPool): + """A pool that assigns persistent connections to different threads. + + Note that this connection pool generates by itself the required keys + using the current thread id. This means that untill a thread put away + a connection it will always get the same connection object by successive + .getconn() calls. This also means that a thread can't use more than one + single connection from the pool. + """ + + def __init__(self, minconn, maxconn, *args, **kwargs): + """Initialize the threading lock.""" + import threading + AbstractConnectionPool.__init__( + self, minconn, maxconn, *args, **kwargs) + self._lock = threading.Lock() + + # we we'll need the thread module, to determine thread ids, so we + # import it here and copy it in an instance variable + import thread + self.__thread = thread + + def getconn(self): + """Generate thread id and return a connection.""" + key = self.__thread.get_ident() + self._lock.acquire() + try: + return self._getconn(key) + finally: + self._lock.release() + + def putconn(self, conn=None, close=False): + """Put away an unused connection.""" + key = self.__thread.get_ident() + self._lock.acquire() + try: + if not conn: conn = self._used[key] + self._putconn(conn, key, close) + finally: + self._lock.release() + + def closeall(self): + """Close all connections (even the one currently in use.)""" + self._lock.acquire() + try: + self._closeall() + finally: + self._lock.release() diff --git a/psycopg2/lib/psycopg1.py b/psycopg2/lib/psycopg1.py new file mode 100644 index 00000000..d539888c --- /dev/null +++ b/psycopg2/lib/psycopg1.py @@ -0,0 +1,87 @@ +"""psycopg 1.1.x compatibility module + +This module uses the new style connection and cursor types to build a psycopg +1.1.1.x compatibility layer. It should be considered a temporary hack to run +old code while porting to psycopg 2. Import it as follows:: + + from psycopg2 import psycopg1 as psycopg +""" +# psycopg/psycopg1.py - psycopg 1.1.x compatibility module +# +# Copyright (C) 2003-2004 Federico Di Gregorio <fog@debian.org> +# +# 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 the +# Free Software Foundation; either version 2, or (at your option) any later +# version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. + +import _psycopg as _2psycopg +from psycopg2.extensions import cursor as _2cursor +from psycopg2.extensions import connection as _2connection + +from psycopg2 import * +del connect + + +def connect(*args, **kwargs): + """connect(dsn, ...) -> new psycopg 1.1.x compatible connection object""" + kwargs['connection_factory'] = connection + conn = _2psycopg.connect(*args, **kwargs) + conn.set_isolation_level(2) + return conn + +class connection(_2connection): + """psycopg 1.1.x connection.""" + + def cursor(self): + """cursor() -> new psycopg 1.1.x compatible cursor object""" + return _2connection.cursor(self, cursor_factory=cursor) + + def autocommit(self, on_off=1): + """autocommit(on_off=1) -> switch autocommit on (1) or off (0)""" + if on_off > 0: + self.set_isolation_level(0) + else: + self.set_isolation_level(2) + + +class cursor(_2cursor): + """psycopg 1.1.x cursor. + + Note that this cursor implements the exact procedure used by psycopg 1 to + build dictionaries out of result rows. The DictCursor in the + psycopg.extras modules implements a much better and faster algorithm. + """ + + def __build_dict(self, row): + res = {} + for i in range(len(self.description)): + res[self.description[i][0]] = row[i] + return res + + def dictfetchone(self): + row = _2cursor.fetchone(self) + if row: + return self.__build_dict(row) + else: + return row + + def dictfetchmany(self, size): + res = [] + rows = _2cursor.fetchmany(self, size) + for row in rows: + res.append(self.__build_dict(row)) + return res + + def dictfetchall(self): + res = [] + rows = _2cursor.fetchall(self) + for row in rows: + res.append(self.__build_dict(row)) + return res + diff --git a/psycopg2/lib/tz.py b/psycopg2/lib/tz.py new file mode 100644 index 00000000..e521b6dc --- /dev/null +++ b/psycopg2/lib/tz.py @@ -0,0 +1,100 @@ +"""tzinfo implementations for psycopg2 + +This module holds two different tzinfo implementations that can be used as +the 'tzinfo' argument to datetime constructors, directly passed to psycopg +functions or used to set the .tzinfo_factory attribute in cursors. +""" +# psycopg/tz.py - tzinfo implementation +# +# Copyright (C) 2003-2004 Federico Di Gregorio <fog@debian.org> +# +# 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 the +# Free Software Foundation; either version 2, or (at your option) any later +# version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. + +import datetime +import time + + +ZERO = datetime.timedelta(0) + +class FixedOffsetTimezone(datetime.tzinfo): + """Fixed offset in minutes east from UTC. + + This is exactly the implementation found in Python 2.3.x documentation, + with a small change to the __init__ method to allow for pickling and a + default name in the form 'sHH:MM' ('s' is the sign.) + """ + _name = None + _offset = ZERO + + def __init__(self, offset=None, name=None): + if offset is not None: + self._offset = datetime.timedelta(minutes = offset) + if name is not None: + self._name = name + + def utcoffset(self, dt): + return self._offset + + def tzname(self, dt): + if self._name is not None: + return self._name + else: + seconds = self._offset.seconds + self._offset.days * 86400 + hours, seconds = divmod(seconds, 3600) + minutes = seconds/60 + if minutes: + return "%+03d:%d" % (hours, minutes) + else: + return "%+03d" % hours + + def dst(self, dt): + return ZERO + + +STDOFFSET = datetime.timedelta(seconds = -time.timezone) +if time.daylight: + DSTOFFSET = datetime.timedelta(seconds = -time.altzone) +else: + DSTOFFSET = STDOFFSET +DSTDIFF = DSTOFFSET - STDOFFSET + +class LocalTimezone(datetime.tzinfo): + """Platform idea of local timezone. + + This is the exact implementation from the Pyhton 2.3 documentation. + """ + + def utcoffset(self, dt): + if self._isdst(dt): + return DSTOFFSET + else: + return STDOFFSET + + def dst(self, dt): + if self._isdst(dt): + return DSTDIFF + else: + return ZERO + + def tzname(self, dt): + return time.tzname[self._isdst(dt)] + + def _isdst(self, dt): + tt = (dt.year, dt.month, dt.day, + dt.hour, dt.minute, dt.second, + dt.weekday(), 0, -1) + stamp = time.mktime(tt) + tt = time.localtime(stamp) + return tt.tm_isdst > 0 + +LOCAL = LocalTimezone() + +# TODO: pre-generate some interesting time zones? diff --git a/psycopg2/psycopg/adapter_asis.c b/psycopg2/psycopg/adapter_asis.c new file mode 100644 index 00000000..75ee0e49 --- /dev/null +++ b/psycopg2/psycopg/adapter_asis.c @@ -0,0 +1,227 @@ +/* adapter_asis.c - adapt types as they are + * + * Copyright (C) 2003-2004 Federico Di Gregorio <fog@debian.org> + * + * This file is part of psycopg. + * + * 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 the Free Software Foundation; either version 2, + * or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include <Python.h> +#include <structmember.h> +#include <stringobject.h> +#include <string.h> + +#define PSYCOPG_MODULE +#include "psycopg/config.h" +#include "psycopg/python.h" +#include "psycopg/psycopg.h" +#include "psycopg/adapter_asis.h" +#include "psycopg/microprotocols_proto.h" + +/** the AsIs object **/ + +static PyObject * +asis_str(asisObject *self) +{ + if (self->wrapped == Py_None) { + return PyString_FromString("NULL"); + } + else { + return PyObject_Str(self->wrapped); + } +} + +PyObject * +asis_getquoted(asisObject *self, PyObject *args) +{ + if (!PyArg_ParseTuple(args, "")) return NULL; + return asis_str(self); +} + +PyObject * +asis_conform(asisObject *self, PyObject *args) +{ + PyObject *res, *proto; + + if (!PyArg_ParseTuple(args, "O", &proto)) return NULL; + + if (proto == (PyObject*)&isqlquoteType) + res = (PyObject*)self; + else + res = Py_None; + + Py_INCREF(res); + return res; +} + +/** the AsIs object */ + +/* object member list */ + +static struct PyMemberDef asisObject_members[] = { + {"adapted", T_OBJECT, offsetof(asisObject, wrapped), RO}, + {NULL} +}; + +/* object method table */ + +static PyMethodDef asisObject_methods[] = { + {"getquoted", (PyCFunction)asis_getquoted, METH_VARARGS, + "getquoted() -> wrapped object value as SQL-quoted string"}, + {"__conform__", (PyCFunction)asis_conform, METH_VARARGS, NULL}, + {NULL} /* Sentinel */ +}; + +/* initialization and finalization methods */ + +static int +asis_setup(asisObject *self, PyObject *obj) +{ + Dprintf("asis_setup: init asis object at %p, refcnt = %d", + self, ((PyObject *)self)->ob_refcnt); + + self->wrapped = obj; + Py_INCREF(self->wrapped); + + Dprintf("asis_setup: good asis object at %p, refcnt = %d", + self, ((PyObject *)self)->ob_refcnt); + return 0; +} + +static void +asis_dealloc(PyObject* obj) +{ + asisObject *self = (asisObject *)obj; + + Py_XDECREF(self->wrapped); + + Dprintf("asis_dealloc: deleted asis object at %p, refcnt = %d", + obj, obj->ob_refcnt); + + obj->ob_type->tp_free(obj); +} + +static int +asis_init(PyObject *obj, PyObject *args, PyObject *kwds) +{ + PyObject *o; + + if (!PyArg_ParseTuple(args, "O", &o)) + return -1; + + return asis_setup((asisObject *)obj, o); +} + +static PyObject * +asis_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +{ + return type->tp_alloc(type, 0); +} + +static void +asis_del(PyObject* self) +{ + PyObject_Del(self); +} + +static PyObject * +asis_repr(asisObject *self) +{ + return PyString_FromFormat("<psycopg2._psycopg.AsIs object at %p>", self); +} + + +/* object type */ + +#define asisType_doc \ +"AsIs(str) -> new AsIs adapter object" + +PyTypeObject asisType = { + PyObject_HEAD_INIT(NULL) + 0, + "psycopg2._psycopg.AsIs", + sizeof(asisObject), + 0, + asis_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + + 0, /*tp_compare*/ + + (reprfunc)asis_repr, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash */ + + 0, /*tp_call*/ + (reprfunc)asis_str, /*tp_str*/ + + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + asisType_doc, /*tp_doc*/ + + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + + /* Attribute descriptor and subclassing stuff */ + + asisObject_methods, /*tp_methods*/ + asisObject_members, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + + asis_init, /*tp_init*/ + 0, /*tp_alloc will be set to PyType_GenericAlloc in module init*/ + asis_new, /*tp_new*/ + (freefunc)asis_del, /*tp_free Low-level free-memory routine */ + 0, /*tp_is_gc For PyObject_IS_GC */ + 0, /*tp_bases*/ + 0, /*tp_mro method resolution order */ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0 /*tp_weaklist*/ +}; + + +/** module-level functions **/ + +PyObject * +psyco_AsIs(PyObject *module, PyObject *args) +{ + PyObject *obj; + + if (!PyArg_ParseTuple(args, "O", &obj)) + return NULL; + + return PyObject_CallFunction((PyObject *)&asisType, "O", obj); +} diff --git a/psycopg2/psycopg/adapter_asis.h b/psycopg2/psycopg/adapter_asis.h new file mode 100644 index 00000000..9495c581 --- /dev/null +++ b/psycopg2/psycopg/adapter_asis.h @@ -0,0 +1,51 @@ +/* adapter_asis.h - definition for the psycopg AsIs type wrapper + * + * Copyright (C) 2003-2005 Federico Di Gregorio <fog@debian.org> + * + * This file is part of psycopg. + * + * 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 the Free Software Foundation; either version 2, + * or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef PSYCOPG_ASIS_H +#define PSYCOPG_ASIS_H 1 + +#include <Python.h> + +#ifdef __cplusplus +extern "C" { +#endif + +extern PyTypeObject asisType; + +typedef struct { + PyObject HEAD; + + /* this is the real object we wrap */ + PyObject *wrapped; + +} asisObject; + +/* functions exported to psycopgmodule.c */ + +extern PyObject *psyco_AsIs(PyObject *module, PyObject *args); +#define psyco_AsIs_doc \ + "AsIs(obj) -> new AsIs wrapper object" + +#ifdef __cplusplus +} +#endif + +#endif /* !defined(PSYCOPG_ASIS_H) */ diff --git a/psycopg2/psycopg/adapter_binary.c b/psycopg2/psycopg/adapter_binary.c new file mode 100644 index 00000000..0fc8101e --- /dev/null +++ b/psycopg2/psycopg/adapter_binary.c @@ -0,0 +1,382 @@ +/* adapter_binary.c - Binary objects + * + * Copyright (C) 2003 Federico Di Gregorio <fog@debian.org> + * + * This file is part of psycopg. + * + * 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 the Free Software Foundation; either version 2, + * or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include <Python.h> +#include <structmember.h> +#include <stringobject.h> + +#include <libpq-fe.h> +#include <string.h> + +#define PSYCOPG_MODULE +#include "psycopg/config.h" +#include "psycopg/python.h" +#include "psycopg/psycopg.h" +#include "psycopg/connection.h" +#include "psycopg/adapter_binary.h" +#include "psycopg/microprotocols_proto.h" + +/** the quoting code */ + +#ifndef PSYCOPG_OWN_QUOTING +static unsigned char * +binary_escape(unsigned char *from, unsigned int from_length, + unsigned int *to_length, PGconn *conn) +{ +#if PG_MAJOR_VERSION > 8 || \ + (PG_MAJOR_VERSION == 8 && PG_MINOR_VERSION > 1) || \ + (PG_MAJOR_VERSION == 8 && PG_MINOR_VERSION == 1 && PG_PATCH_VERSION >= 4) + if (conn) + return PQescapeByteaConn(conn, from, from_length, to_length); + else +#endif + return PQescapeBytea(from, from_length, to_length); +} +#else +static unsigned char * +binary_escape(unsigned char *from, unsigned int from_length, + unsigned int *to_length, PGconn *conn) +{ + unsigneed char *quoted, *chptr, *newptr; + int i, space, new_space; + + space = from_length + 2; + + Py_BEGIN_ALLOW_THREADS; + + quoted = (unsigned char*)calloc(space, sizeof(char)); + if (quoted == NULL) return NULL; + + chptr = quoted; + + for (i=0; i < len; i++) { + if (chptr - quoted > space - 6) { + new_space = space * ((space) / (i + 1)) + 2 + 6; + if (new_space - space < 1024) space += 1024; + else space = new_space; + newptr = (unsigned char *)realloc(quoted, space); + if (newptr == NULL) { + free(quoted); + return NULL; + } + /* chptr has to be moved to the new location*/ + chptr = newptr + (chptr - quoted); + quoted = newptr; + Dprintf("binary_escape: reallocated %i bytes at %p", space,quoted); + } + if (from[i]) { + if (from[i] >= ' ' && from[i] <= '~') { + if (from[i] == '\'') { + *chptr = '\''; + chptr++; + *chptr = '\''; + chptr++; + } + else if (from[i] == '\\') { + memcpy(chptr, "\\\\\\\\", 4); + chptr += 4; + } + else { + /* leave it as it is if ascii printable */ + *chptr = from[i]; + chptr++; + } + } + else { + unsigned char c; + + /* escape to octal notation \nnn */ + *chptr++ = '\\'; + *chptr++ = '\\'; + c = from[i]; + *chptr = ((c >> 6) & 0x07) + 0x30; chptr++; + *chptr = ((c >> 3) & 0x07) + 0x30; chptr++; + *chptr = ( c & 0x07) + 0x30; chptr++; + } + } + else { + /* escape null as \\000 */ + memcpy(chptr, "\\\\000", 5); + chptr += 5; + } + } + *chptr = '\0'; + + Py_END_ALLOW_THREADS; + + *to_size = chptr - quoted + 1; + return quoted; +} +#endif + +/* binary_quote - do the quote process on plain and unicode strings */ + +static PyObject * +binary_quote(binaryObject *self) +{ + char *to; + const char *buffer; + int buffer_len; + size_t len = 0; + + /* if we got a plain string or a buffer we escape it and save the buffer */ + if (PyString_Check(self->wrapped) || PyBuffer_Check(self->wrapped)) { + /* escape and build quoted buffer */ + PyObject_AsCharBuffer(self->wrapped, &buffer, &buffer_len); + + to = (char *)binary_escape((unsigned char*)buffer, buffer_len, &len, + self->conn ? ((connectionObject*)self->conn)->pgconn : NULL); + if (to == NULL) { + PyErr_NoMemory(); + return NULL; + } + + if (len > 0) + self->buffer = PyString_FromFormat("'%s'", to); + else + self->buffer = PyString_FromString("''"); + PQfreemem(to); + } + + /* if the wrapped object is not a string or a buffer, this is an error */ + else { + PyErr_SetString(PyExc_TypeError, "can't escape non-string object"); + return NULL; + } + + return self->buffer; +} + +/* binary_str, binary_getquoted - return result of quoting */ + +static PyObject * +binary_str(binaryObject *self) +{ + if (self->buffer == NULL) { + binary_quote(self); + } + Py_XINCREF(self->buffer); + return self->buffer; +} + +PyObject * +binary_getquoted(binaryObject *self, PyObject *args) +{ + if (!PyArg_ParseTuple(args, "")) return NULL; + return binary_str(self); +} + +PyObject * +binary_prepare(binaryObject *self, PyObject *args) +{ + connectionObject *conn; + + if (!PyArg_ParseTuple(args, "O", &conn)) + return NULL; + + Py_XDECREF(self->conn); + if (conn) { + self->conn = (PyObject*)conn; + Py_INCREF(self->conn); + } + + Py_INCREF(Py_None); + return Py_None; +} + +PyObject * +binary_conform(binaryObject *self, PyObject *args) +{ + PyObject *res, *proto; + + if (!PyArg_ParseTuple(args, "O", &proto)) return NULL; + + if (proto == (PyObject*)&isqlquoteType) + res = (PyObject*)self; + else + res = Py_None; + + Py_INCREF(res); + return res; +} + +/** the Binary object **/ + +/* object member list */ + +static struct PyMemberDef binaryObject_members[] = { + {"adapted", T_OBJECT, offsetof(binaryObject, wrapped), RO}, + {"buffer", T_OBJECT, offsetof(binaryObject, buffer), RO}, + {NULL} +}; + +/* object method table */ + +static PyMethodDef binaryObject_methods[] = { + {"getquoted", (PyCFunction)binary_getquoted, METH_VARARGS, + "getquoted() -> wrapped object value as SQL-quoted binary string"}, + {"prepare", (PyCFunction)binary_prepare, METH_VARARGS, + "prepare(conn) -> prepare for binary encoding using conn"}, + {"__conform__", (PyCFunction)binary_conform, METH_VARARGS, NULL}, + {NULL} /* Sentinel */ +}; + +/* initialization and finalization methods */ + +static int +binary_setup(binaryObject *self, PyObject *str) +{ + Dprintf("binary_setup: init binary object at %p, refcnt = %d", + self, ((PyObject *)self)->ob_refcnt); + + self->buffer = NULL; + self->conn = NULL; + self->wrapped = str; + Py_INCREF(self->wrapped); + + Dprintf("binary_setup: good binary object at %p, refcnt = %d", + self, ((PyObject *)self)->ob_refcnt); + return 0; +} + +static void +binary_dealloc(PyObject* obj) +{ + binaryObject *self = (binaryObject *)obj; + + Py_XDECREF(self->wrapped); + Py_XDECREF(self->buffer); + Py_XDECREF(self->conn); + + Dprintf("binary_dealloc: deleted binary object at %p, refcnt = %d", + obj, obj->ob_refcnt); + + obj->ob_type->tp_free(obj); +} + +static int +binary_init(PyObject *obj, PyObject *args, PyObject *kwds) +{ + PyObject *str; + + if (!PyArg_ParseTuple(args, "O", &str)) + return -1; + + return binary_setup((binaryObject *)obj, str); +} + +static PyObject * +binary_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +{ + return type->tp_alloc(type, 0); +} + +static void +binary_del(PyObject* self) +{ + PyObject_Del(self); +} + +static PyObject * +binary_repr(binaryObject *self) +{ + return PyString_FromFormat("<psycopg2._psycopg.Binary object at %p>", self); +} + +/* object type */ + +#define binaryType_doc \ +"Binary(buffer) -> new binary object" + +PyTypeObject binaryType = { + PyObject_HEAD_INIT(NULL) + 0, + "psycopg2._psycopg.Binary", + sizeof(binaryObject), + 0, + binary_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + + 0, /*tp_compare*/ + (reprfunc)binary_repr, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash */ + + 0, /*tp_call*/ + (reprfunc)binary_str, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + + binaryType_doc, /*tp_doc*/ + + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + + /* Attribute descriptor and subclassing stuff */ + + binaryObject_methods, /*tp_methods*/ + binaryObject_members, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + + binary_init, /*tp_init*/ + 0, /*tp_alloc will be set to PyType_GenericAlloc in module init*/ + binary_new, /*tp_new*/ + (freefunc)binary_del, /*tp_free Low-level free-memory routine */ + 0, /*tp_is_gc For PyObject_IS_GC */ + 0, /*tp_bases*/ + 0, /*tp_mro method resolution order */ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0 /*tp_weaklist*/ +}; + + +/** module-level functions **/ + +PyObject * +psyco_Binary(PyObject *module, PyObject *args) +{ + PyObject *str; + + if (!PyArg_ParseTuple(args, "O", &str)) + return NULL; + + return PyObject_CallFunction((PyObject *)&binaryType, "O", str); +} diff --git a/psycopg2/psycopg/adapter_binary.h b/psycopg2/psycopg/adapter_binary.h new file mode 100644 index 00000000..262a72d0 --- /dev/null +++ b/psycopg2/psycopg/adapter_binary.h @@ -0,0 +1,53 @@ +/* adapter_binary.h - definition for the Binary type + * + * Copyright (C) 2003 Federico Di Gregorio <fog@debian.org> + * + * This file is part of psycopg. + * + * 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 the Free Software Foundation; either version 2, + * or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef PSYCOPG_BINARY_H +#define PSYCOPG_BINARY_H 1 + +#include <Python.h> +#include <libpq-fe.h> + +#ifdef __cplusplus +extern "C" { +#endif + +extern PyTypeObject binaryType; + +typedef struct { + PyObject HEAD; + + PyObject *wrapped; + PyObject *buffer; + PyObject *conn; +} binaryObject; + +/* functions exported to psycopgmodule.c */ + +extern PyObject *psyco_Binary(PyObject *module, PyObject *args); +#define psyco_Binary_doc \ + "Binary(buffer) -> new binary object\n\n" \ + "Build an object capable to hold a bynary string value." + +#ifdef __cplusplus +} +#endif + +#endif /* !defined(PSYCOPG_BINARY_H) */ diff --git a/psycopg2/psycopg/adapter_datetime.c b/psycopg2/psycopg/adapter_datetime.c new file mode 100644 index 00000000..6409ceff --- /dev/null +++ b/psycopg2/psycopg/adapter_datetime.c @@ -0,0 +1,461 @@ +/* adapter_datetime.c - python date/time objects + * + * Copyright (C) 2004 Federico Di Gregorio <fog@debian.org> + * + * This file is part of psycopg. + * + * 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 the Free Software Foundation; either version 2, + * or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include <Python.h> +#include <structmember.h> +#include <stringobject.h> +#include <datetime.h> + +#include <time.h> +#include <string.h> + +#define PSYCOPG_MODULE +#include "psycopg/config.h" +#include "psycopg/python.h" +#include "psycopg/psycopg.h" +#include "psycopg/adapter_datetime.h" +#include "psycopg/microprotocols_proto.h" + + +/* the pointer to the datetime module API is initialized by the module init + code, we just need to grab it */ +extern PyObject* pyDateTimeModuleP; +extern PyObject *pyDateTypeP; +extern PyObject *pyTimeTypeP; +extern PyObject *pyDateTimeTypeP; +extern PyObject *pyDeltaTypeP; + +extern PyObject *pyPsycopgTzModule; +extern PyObject *pyPsycopgTzLOCAL; + +/* datetime_str, datetime_getquoted - return result of quoting */ + +static PyObject * +pydatetime_str(pydatetimeObject *self) +{ + if (self->type <= PSYCO_DATETIME_TIMESTAMP) { + PyObject *res = NULL; + PyObject *iso = PyObject_CallMethod(self->wrapped, "isoformat", NULL); + if (iso) { + res = PyString_FromFormat("'%s'", PyString_AsString(iso)); + Py_DECREF(iso); + } + return res; + } + else { + PyDateTime_Delta *obj = (PyDateTime_Delta*)self->wrapped; + + char buffer[8]; + int i; + int a = obj->microseconds; + + for (i=0; i < 6 ; i++) { + buffer[5-i] = '0' + (a % 10); + a /= 10; + } + buffer[6] = '\0'; + + return PyString_FromFormat("'%d days %d.%s seconds'", + obj->days, obj->seconds, buffer); + } +} + +PyObject * +pydatetime_getquoted(pydatetimeObject *self, PyObject *args) +{ + if (!PyArg_ParseTuple(args, "")) return NULL; + return pydatetime_str(self); +} + +PyObject * +pydatetime_conform(pydatetimeObject *self, PyObject *args) +{ + PyObject *res, *proto; + + if (!PyArg_ParseTuple(args, "O", &proto)) return NULL; + + if (proto == (PyObject*)&isqlquoteType) + res = (PyObject*)self; + else + res = Py_None; + + Py_INCREF(res); + return res; +} + +/** the DateTime wrapper object **/ + +/* object member list */ + +static struct PyMemberDef pydatetimeObject_members[] = { + {"adapted", T_OBJECT, offsetof(pydatetimeObject, wrapped), RO}, + {"type", T_INT, offsetof(pydatetimeObject, type), RO}, + {NULL} +}; + +/* object method table */ + +static PyMethodDef pydatetimeObject_methods[] = { + {"getquoted", (PyCFunction)pydatetime_getquoted, METH_VARARGS, + "getquoted() -> wrapped object value as SQL date/time"}, + {"__conform__", (PyCFunction)pydatetime_conform, METH_VARARGS, NULL}, + {NULL} /* Sentinel */ +}; + +/* initialization and finalization methods */ + +static int +pydatetime_setup(pydatetimeObject *self, PyObject *obj, int type) +{ + Dprintf("pydatetime_setup: init datetime object at %p, refcnt = %d", + self, ((PyObject *)self)->ob_refcnt); + + self->type = type; + self->wrapped = obj; + Py_INCREF(self->wrapped); + + Dprintf("pydatetime_setup: good pydatetime object at %p, refcnt = %d", + self, ((PyObject *)self)->ob_refcnt); + return 0; +} + +static void +pydatetime_dealloc(PyObject* obj) +{ + pydatetimeObject *self = (pydatetimeObject *)obj; + + Py_XDECREF(self->wrapped); + + Dprintf("mpydatetime_dealloc: deleted pydatetime object at %p, " + "refcnt = %d", obj, obj->ob_refcnt); + + obj->ob_type->tp_free(obj); +} + +static int +pydatetime_init(PyObject *obj, PyObject *args, PyObject *kwds) +{ + PyObject *dt; + int type = -1; /* raise an error if type was not passed! */ + + if (!PyArg_ParseTuple(args, "O|i", &dt, &type)) + return -1; + + return pydatetime_setup((pydatetimeObject *)obj, dt, type); +} + +static PyObject * +pydatetime_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +{ + return type->tp_alloc(type, 0); +} + +static void +pydatetime_del(PyObject* self) +{ + PyObject_Del(self); +} + +static PyObject * +pydatetime_repr(pydatetimeObject *self) +{ + return PyString_FromFormat("<psycopg2._psycopg.datetime object at %p>", + self); +} + +/* object type */ + +#define pydatetimeType_doc \ +"datetime(datetime, type) -> new datetime wrapper object" + +PyTypeObject pydatetimeType = { + PyObject_HEAD_INIT(NULL) + 0, + "psycopg2._psycopg.datetime", + sizeof(pydatetimeObject), + 0, + pydatetime_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + + 0, /*tp_compare*/ + (reprfunc)pydatetime_repr, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash */ + + 0, /*tp_call*/ + (reprfunc)pydatetime_str, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + + pydatetimeType_doc, /*tp_doc*/ + + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + + /* Attribute descriptor and subclassing stuff */ + + pydatetimeObject_methods, /*tp_methods*/ + pydatetimeObject_members, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + + pydatetime_init, /*tp_init*/ + 0, /*tp_alloc will be set to PyType_GenericAlloc in module init*/ + pydatetime_new, /*tp_new*/ + (freefunc)pydatetime_del, /*tp_free Low-level free-memory routine */ + 0, /*tp_is_gc For PyObject_IS_GC */ + 0, /*tp_bases*/ + 0, /*tp_mro method resolution order */ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0 /*tp_weaklist*/ +}; + + +/** module-level functions **/ + +#ifdef PSYCOPG_DEFAULT_PYDATETIME + +PyObject * +psyco_Date(PyObject *self, PyObject *args) +{ + PyObject *res = NULL; + int year, month, day; + + PyObject* obj = NULL; + + if (!PyArg_ParseTuple(args, "iii", &year, &month, &day)) + return NULL; + + obj = PyObject_CallFunction(pyDateTypeP, "iii", year, month, day); + + if (obj) { + res = PyObject_CallFunction((PyObject *)&pydatetimeType, + "Oi", obj, PSYCO_DATETIME_DATE); + Py_DECREF(obj); + } + + return res; +} + +PyObject * +psyco_Time(PyObject *self, PyObject *args) +{ + PyObject *res = NULL; + PyObject *tzinfo = NULL; + int hours, minutes=0; + double micro, seconds=0.0; + + PyObject* obj = NULL; + + if (!PyArg_ParseTuple(args, "iid|O", &hours, &minutes, &seconds, + &tzinfo)) + return NULL; + + micro = (seconds - floor(seconds)) * 1000000.0; + + if (tzinfo == NULL) + obj = PyObject_CallFunction(pyTimeTypeP, "iiii", + hours, minutes, (int)round(seconds), (int)round(micro)); + else + obj = PyObject_CallFunction(pyTimeTypeP, "iiiiO", + hours, minutes, (int)round(seconds), (int)round(micro), tzinfo); + + if (obj) { + res = PyObject_CallFunction((PyObject *)&pydatetimeType, + "Oi", obj, PSYCO_DATETIME_TIME); + Py_DECREF(obj); + } + + return res; +} + +PyObject * +psyco_Timestamp(PyObject *self, PyObject *args) +{ + PyObject *res = NULL; + PyObject *tzinfo = NULL; + int year, month, day; + int hour=0, minute=0; /* default to midnight */ + double micro, second=0.0; + + PyObject* obj = NULL; + + if (!PyArg_ParseTuple(args, "lii|iidO", &year, &month, &day, + &hour, &minute, &second, &tzinfo)) + return NULL; + + micro = (second - floor(second)) * 1000000.0; + + if (tzinfo == NULL) + obj = PyObject_CallFunction(pyDateTimeTypeP, "iiiiiii", + year, month, day, hour, minute, (int)round(second), + (int)round(micro)); + else + obj = PyObject_CallFunction(pyDateTimeTypeP, "iiiiiiiO", + year, month, day, hour, minute, (int)round(second), + (int)round(micro), tzinfo); + + if (obj) { + res = PyObject_CallFunction((PyObject *)&pydatetimeType, + "Oi", obj, PSYCO_DATETIME_TIMESTAMP); + Py_DECREF(obj); + } + + return res; +} + +PyObject * +psyco_DateFromTicks(PyObject *self, PyObject *args) +{ + PyObject *res = NULL; + struct tm tm; + time_t t; + double ticks; + + if (!PyArg_ParseTuple(args, "d", &ticks)) + return NULL; + + t = (time_t)round(ticks); + if (localtime_r(&t, &tm)) { + args = Py_BuildValue("iii", tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday); + if (args) { + res = psyco_Date(self, args); + Py_DECREF(args); + } + } + return res; +} + +PyObject * +psyco_TimeFromTicks(PyObject *self, PyObject *args) +{ + PyObject *res = NULL; + struct tm tm; + time_t t; + double ticks; + + if (!PyArg_ParseTuple(args,"d", &ticks)) + return NULL; + + t = (time_t)round(ticks); + if (localtime_r(&t, &tm)) { + args = Py_BuildValue("iid", tm.tm_hour, tm.tm_min, (double)tm.tm_sec); + if (args) { + res = psyco_Time(self, args); + Py_DECREF(args); + } + } + return res; +} + +PyObject * +psyco_TimestampFromTicks(PyObject *self, PyObject *args) +{ + PyObject *res = NULL; + struct tm tm; + time_t t; + double ticks; + + if (!PyArg_ParseTuple(args,"d", &ticks)) + return NULL; + + t = (time_t)round(ticks); + if (localtime_r(&t, &tm)) { + args = Py_BuildValue("iiiiidO", + tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday, + tm.tm_hour, tm.tm_min, (double)tm.tm_sec, + pyPsycopgTzLOCAL); + if (args) { + res = psyco_Timestamp(self, args); + Py_DECREF(args); + } + } + return res; +} + +#endif + +PyObject * +psyco_DateFromPy(PyObject *self, PyObject *args) +{ + PyObject *obj; + + if (!PyArg_ParseTuple(args, "O!", pyDateTypeP, &obj)) + return NULL; + + return PyObject_CallFunction((PyObject *)&pydatetimeType, "Oi", obj, + PSYCO_DATETIME_DATE); +} + +PyObject * +psyco_TimeFromPy(PyObject *self, PyObject *args) +{ + PyObject *obj; + + if (!PyArg_ParseTuple(args, "O!", pyTimeTypeP, &obj)) + return NULL; + + return PyObject_CallFunction((PyObject *)&pydatetimeType, "Oi", obj, + PSYCO_DATETIME_TIME); +} + +PyObject * +psyco_TimestampFromPy(PyObject *self, PyObject *args) +{ + PyObject *obj; + + if (!PyArg_ParseTuple(args, "O!", pyDateTimeTypeP, &obj)) + return NULL; + + return PyObject_CallFunction((PyObject *)&pydatetimeType, "Oi", obj, + PSYCO_DATETIME_TIMESTAMP); +} + +PyObject * +psyco_IntervalFromPy(PyObject *self, PyObject *args) +{ + PyObject *obj; + + if (!PyArg_ParseTuple(args, "O!", pyDeltaTypeP, &obj)) + return NULL; + + return PyObject_CallFunction((PyObject *)&pydatetimeType, "Oi", obj, + PSYCO_DATETIME_INTERVAL); +} diff --git a/psycopg2/psycopg/adapter_datetime.h b/psycopg2/psycopg/adapter_datetime.h new file mode 100644 index 00000000..a32bb8df --- /dev/null +++ b/psycopg2/psycopg/adapter_datetime.h @@ -0,0 +1,107 @@ +/* adapter_datetime.h - definition for the python date/time types + * + * Copyright (C) 2004 Federico Di Gregorio <fog@debian.org> + * + * This file is part of psycopg. + * + * 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 the Free Software Foundation; either version 2, + * or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef PSYCOPG_DATETIME_H +#define PSYCOPG_DATETIME_H 1 + +#include <Python.h> + +#ifdef __cplusplus +extern "C" { +#endif + +extern PyTypeObject pydatetimeType; + +typedef struct { + PyObject HEAD; + + PyObject *wrapped; + int type; +#define PSYCO_DATETIME_TIME 0 +#define PSYCO_DATETIME_DATE 1 +#define PSYCO_DATETIME_TIMESTAMP 2 +#define PSYCO_DATETIME_INTERVAL 3 + +} pydatetimeObject; + + +/* functions exported to psycopgmodule.c */ +#ifdef PSYCOPG_DEFAULT_PYDATETIME + +extern PyObject *psyco_Date(PyObject *module, PyObject *args); +#define psyco_Date_doc \ + "Date(year, month, day) -> new date\n\n" \ + "Build an object holding a date value." + +extern PyObject *psyco_Time(PyObject *module, PyObject *args); +#define psyco_Time_doc \ + "Time(hour, minutes, seconds, tzinfo=None) -> new time\n\n" \ + "Build an object holding a time value." + +extern PyObject *psyco_Timestamp(PyObject *module, PyObject *args); +#define psyco_Timestamp_doc \ + "Timestamp(year, month, day, hour, minutes, seconds, tzinfo=None) -> new timestamp\n\n" \ + "Build an object holding a timestamp value." + +extern PyObject *psyco_DateFromTicks(PyObject *module, PyObject *args); +#define psyco_DateFromTicks_doc \ + "DateFromTicks(ticks) -> new date\n\n" \ + "Build an object holding a date value from the given ticks value.\n\n" \ + "Ticks are the number of seconds since the epoch; see the documentation " \ + "of the standard Python time module for details)." + +extern PyObject *psyco_TimeFromTicks(PyObject *module, PyObject *args); +#define psyco_TimeFromTicks_doc \ + "TimeFromTicks(ticks) -> new time\n\n" \ + "Build an object holding a time value from the given ticks value.\n\n" \ + "Ticks are the number of seconds since the epoch; see the documentation " \ + "of the standard Python time module for details)." + +extern PyObject *psyco_TimestampFromTicks(PyObject *module, PyObject *args); +#define psyco_TimestampFromTicks_doc \ + "TimestampFromTicks(ticks) -> new timestamp\n\n" \ + "Build an object holding a timestamp value from the given ticks value.\n\n" \ + "Ticks are the number of seconds since the epoch; see the documentation " \ + "of the standard Python time module for details)." + +#endif /* PSYCOPG_DEFAULT_PYDATETIME */ + +extern PyObject *psyco_DateFromPy(PyObject *module, PyObject *args); +#define psyco_DateFromPy_doc \ + "DateFromPy(datetime.date) -> new wrapper" + +extern PyObject *psyco_TimeFromPy(PyObject *module, PyObject *args); +#define psyco_TimeFromPy_doc \ + "TimeFromPy(datetime.time) -> new wrapper" + +extern PyObject *psyco_TimestampFromPy(PyObject *module, PyObject *args); +#define psyco_TimestampFromPy_doc \ + "TimestampFromPy(datetime.datetime) -> new wrapper" + +extern PyObject *psyco_IntervalFromPy(PyObject *module, PyObject *args); +#define psyco_IntervalFromPy_doc \ + "IntervalFromPy(datetime.timedelta) -> new wrapper" + +#ifdef __cplusplus +} +#endif + +#endif /* !defined(PSYCOPG_DATETIME_H) */ diff --git a/psycopg2/psycopg/adapter_list.c b/psycopg2/psycopg/adapter_list.c new file mode 100644 index 00000000..29ef1167 --- /dev/null +++ b/psycopg2/psycopg/adapter_list.c @@ -0,0 +1,297 @@ +/* adapter_list.c - python list objects + * + * Copyright (C) 2004-2005 Federico Di Gregorio <fog@debian.org> + * + * This file is part of psycopg. + * + * 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 the Free Software Foundation; either version 2, + * or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include <Python.h> +#include <structmember.h> +#include <stringobject.h> + +#define PSYCOPG_MODULE +#include "psycopg/config.h" +#include "psycopg/python.h" +#include "psycopg/psycopg.h" +#include "psycopg/adapter_list.h" +#include "psycopg/microprotocols.h" +#include "psycopg/microprotocols_proto.h" + + +/* list_str, list_getquoted - return result of quoting */ + +static PyObject * +list_quote(listObject *self) +{ + /* adapt the list by calling adapt() recursively and then wrapping + everything into "ARRAY[]" */ + PyObject *tmp = NULL, *str = NULL, *joined = NULL, *res = NULL; + int i, len; + + len = PyList_GET_SIZE(self->wrapped); + + /* empty arrays are converted to NULLs (still searching for a way to + insert an empty array in postgresql */ + if (len == 0) return PyString_FromString("'{}'"); + + tmp = PyTuple_New(len); + + for (i=0; i<len; i++) { + PyObject *quoted = + microprotocol_getquoted(PyList_GET_ITEM(self->wrapped, i), + (connectionObject*)self->connection); + if (quoted == NULL) goto error; + + /* here we don't loose a refcnt: SET_ITEM does not change the + reference count and we are just transferring ownership of the tmp + object to the tuple */ + PyTuple_SET_ITEM(tmp, i, quoted); + } + + /* now that we have a tuple of adapted objects we just need to join them + and put "ARRAY[] around the result */ + str = PyString_FromString(", "); + joined = PyObject_CallMethod(str, "join", "(O)", tmp); + if (joined == NULL) goto error; + + res = PyString_FromFormat("ARRAY[%s]", PyString_AsString(joined)); + + error: + Py_XDECREF(tmp); + Py_XDECREF(str); + Py_XDECREF(joined); + return res; +} + +PyObject * +list_str(listObject *self, PyObject *args) +{ + if (!PyArg_ParseTuple(args, "")) return NULL; + return list_quote(self); +} + +PyObject * +list_getquoted(listObject *self, PyObject *args) +{ + if (!PyArg_ParseTuple(args, "")) return NULL; + return list_quote(self); +} + +PyObject * +list_prepare(listObject *self, PyObject *args) +{ + connectionObject *conn; + + if (!PyArg_ParseTuple(args, "O", &conn)) + return NULL; + + /* note that we don't copy the encoding from the connection, but take a + reference to it; we'll need it during the recursive adapt() call (the + encoding is here for a future expansion that will make .getquoted() + work even without a connection to the backend. */ + Py_XDECREF(self->connection); + self->connection = (PyObject*)conn; + Py_INCREF(self->connection); + + Py_INCREF(Py_None); + return Py_None; +} + +PyObject * +list_conform(listObject *self, PyObject *args) +{ + PyObject *res, *proto; + + if (!PyArg_ParseTuple(args, "O", &proto)) return NULL; + + if (proto == (PyObject*)&isqlquoteType) + res = (PyObject*)self; + else + res = Py_None; + + Py_INCREF(res); + return res; +} + +/** the DateTime wrapper object **/ + +/* object member list */ + +static struct PyMemberDef listObject_members[] = { + {"adapted", T_OBJECT, offsetof(listObject, wrapped), RO}, + {NULL} +}; + +/* object method table */ + +static PyMethodDef listObject_methods[] = { + {"getquoted", (PyCFunction)list_getquoted, METH_VARARGS, + "getquoted() -> wrapped object value as SQL date/time"}, + {"prepare", (PyCFunction)list_prepare, METH_VARARGS, + "prepare(conn) -> set encoding to conn->encoding"}, + {"__conform__", (PyCFunction)list_conform, METH_VARARGS, NULL}, + {NULL} /* Sentinel */ +}; + +/* initialization and finalization methods */ + +static int +list_setup(listObject *self, PyObject *obj, char *enc) +{ + Dprintf("list_setup: init list object at %p, refcnt = %d", + self, ((PyObject *)self)->ob_refcnt); + + if (!PyList_Check(obj)) + return -1; + + /* FIXME: remove this orrible strdup */ + if (enc) self->encoding = strdup(enc); + + self->connection = NULL; + self->wrapped = obj; + Py_INCREF(self->wrapped); + + Dprintf("list_setup: good list object at %p, refcnt = %d", + self, ((PyObject *)self)->ob_refcnt); + return 0; +} + +static void +list_dealloc(PyObject* obj) +{ + listObject *self = (listObject *)obj; + + Py_XDECREF(self->wrapped); + Py_XDECREF(self->connection); + if (self->encoding) free(self->encoding); + + Dprintf("list_dealloc: deleted list object at %p, " + "refcnt = %d", obj, obj->ob_refcnt); + + obj->ob_type->tp_free(obj); +} + +static int +list_init(PyObject *obj, PyObject *args, PyObject *kwds) +{ + PyObject *l; + char *enc = "latin-1"; /* default encoding as in Python */ + + if (!PyArg_ParseTuple(args, "O|s", &l, &enc)) + return -1; + + return list_setup((listObject *)obj, l, enc); +} + +static PyObject * +list_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +{ + return type->tp_alloc(type, 0); +} + +static void +list_del(PyObject* self) +{ + PyObject_Del(self); +} + +static PyObject * +list_repr(listObject *self) +{ + return PyString_FromFormat("<psycopg2._psycopg.List object at %p>", self); +} + +/* object type */ + +#define listType_doc \ +"List(list) -> new list wrapper object" + +PyTypeObject listType = { + PyObject_HEAD_INIT(NULL) + 0, + "psycopg2._psycopg.List", + sizeof(listObject), + 0, + list_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + + 0, /*tp_compare*/ + (reprfunc)list_repr, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash */ + + 0, /*tp_call*/ + (reprfunc)list_str, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + + listType_doc, /*tp_doc*/ + + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + + /* Attribute descriptor and subclassing stuff */ + + listObject_methods, /*tp_methods*/ + listObject_members, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + + list_init, /*tp_init*/ + 0, /*tp_alloc will be set to PyType_GenericAlloc in module init*/ + list_new, /*tp_new*/ + (freefunc)list_del, /*tp_free Low-level free-memory routine */ + 0, /*tp_is_gc For PyObject_IS_GC */ + 0, /*tp_bases*/ + 0, /*tp_mro method resolution order */ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0 /*tp_weaklist*/ +}; + + +/** module-level functions **/ + +PyObject * +psyco_List(PyObject *module, PyObject *args) +{ + PyObject *str; + char *enc = "latin-1"; /* default encoding as in Python */ + + if (!PyArg_ParseTuple(args, "O|s", &str, &enc)) + return NULL; + + return PyObject_CallFunction((PyObject *)&listType, "Os", str, enc); +} diff --git a/psycopg2/psycopg/adapter_list.h b/psycopg2/psycopg/adapter_list.h new file mode 100644 index 00000000..71b4286c --- /dev/null +++ b/psycopg2/psycopg/adapter_list.h @@ -0,0 +1,49 @@ +/* adapter_list.h - definition for the python list types + * + * Copyright (C) 2004-2005 Federico Di Gregorio <fog@debian.org> + * + * This file is part of psycopg. + * + * 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 the Free Software Foundation; either version 2, + * or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef PSYCOPG_LIST_H +#define PSYCOPG_LIST_H 1 + +#include <Python.h> + +#ifdef __cplusplus +extern "C" { +#endif + +extern PyTypeObject listType; + +typedef struct { + PyObject HEAD; + + PyObject *wrapped; + PyObject *connection; + char *encoding; +} listObject; + +extern PyObject *psyco_List(PyObject *module, PyObject *args); +#define psyco_List_doc \ + "List(list, enc) -> new quoted list" + +#ifdef __cplusplus +} +#endif + +#endif /* !defined(PSYCOPG_LIST_H) */ diff --git a/psycopg2/psycopg/adapter_mxdatetime.c b/psycopg2/psycopg/adapter_mxdatetime.c new file mode 100644 index 00000000..3b231489 --- /dev/null +++ b/psycopg2/psycopg/adapter_mxdatetime.c @@ -0,0 +1,446 @@ +/* adapter_mxdatetime.c - mx date/time objects + * + * Copyright (C) 2003-2004 Federico Di Gregorio <fog@debian.org> + * + * This file is part of psycopg. + * + * 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 the Free Software Foundation; either version 2, + * or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include <Python.h> +#include <structmember.h> +#include <stringobject.h> +#include <mxDateTime.h> +#include <string.h> + +#define PSYCOPG_MODULE +#include "psycopg/config.h" +#include "psycopg/python.h" +#include "psycopg/psycopg.h" +#include "psycopg/adapter_mxdatetime.h" +#include "psycopg/microprotocols_proto.h" + +/* the pointer to the mxDateTime API is initialized by the module init code, + we just need to grab it */ +extern mxDateTimeModule_APIObject *mxDateTimeP; + + +/* mxdatetime_str, mxdatetime_getquoted - return result of quoting */ + +static PyObject * +mxdatetime_str(mxdatetimeObject *self) +{ + PyObject *str = NULL, *res = NULL; + + switch (self->type) { + + case PSYCO_MXDATETIME_DATE: + case PSYCO_MXDATETIME_TIMESTAMP: + str = PyObject_Str(self->wrapped); + + /* given the limitation of the mx.DateTime module that uses the same + type for both date and timestamp values we need to do some black + magic and make sure we're not using an adapt()ed timestamp as a + simple date */ + if (strncmp(&(PyString_AsString(str)[11]), "00:00:00.000", 12) == 0) { + PyObject *tmp = + PyString_FromStringAndSize(PyString_AsString(str), 10); + Py_DECREF(str); + str = tmp; + } + break; + + case PSYCO_MXDATETIME_TIME: + case PSYCO_MXDATETIME_INTERVAL: + str = PyObject_Str(self->wrapped); + + /* given the limitation of the mx.DateTime module that uses the same + type for both time and delta values we need to do some black magic + and make sure we're not using an adapt()ed interval as a simple + time */ + if (PyString_Size(str) > 8 && PyString_AsString(str)[8] == ':') { + mxDateTimeDeltaObject *obj = (mxDateTimeDeltaObject*)self->wrapped; + + char buffer[8]; + int i, j, x; + + double ss = obj->hour*3600.0 + obj->minute*60.0 + obj->second; + int us = (int)((ss - floor(ss))*1000000); + + for (i=1000000, j=0; i > 0 ; i /= 10) { + x = us/i; + us -= x*i; + buffer[j++] = '0'+x; + } + buffer[j] = '\0'; + + res = PyString_FromFormat("'%ld days %d.%s seconds'", + obj->day, (int)round(ss), buffer); + } + break; + } + + if (str != NULL && res == NULL) { + res = PyString_FromFormat("'%s'", PyString_AsString(str)); + } + Py_XDECREF(str); + + return res; +} + +PyObject * +mxdatetime_getquoted(mxdatetimeObject *self, PyObject *args) +{ + if (!PyArg_ParseTuple(args, "")) return NULL; + return mxdatetime_str(self); +} + +PyObject * +mxdatetime_conform(mxdatetimeObject *self, PyObject *args) +{ + PyObject *res, *proto; + + if (!PyArg_ParseTuple(args, "O", &proto)) return NULL; + + if (proto == (PyObject*)&isqlquoteType) + res = (PyObject*)self; + else + res = Py_None; + + Py_INCREF(res); + return res; +} + +/** the MxDateTime object **/ + +/* object member list */ + +static struct PyMemberDef mxdatetimeObject_members[] = { + {"adapted", T_OBJECT, offsetof(mxdatetimeObject, wrapped), RO}, + {"type", T_INT, offsetof(mxdatetimeObject, type), RO}, + {NULL} +}; + +/* object method table */ + +static PyMethodDef mxdatetimeObject_methods[] = { + {"getquoted", (PyCFunction)mxdatetime_getquoted, METH_VARARGS, + "getquoted() -> wrapped object value as SQL date/time"}, + {"__conform__", (PyCFunction)mxdatetime_conform, METH_VARARGS, NULL}, + {NULL} /* Sentinel */ +}; + +/* initialization and finalization methods */ + +static int +mxdatetime_setup(mxdatetimeObject *self, PyObject *obj, int type) +{ + Dprintf("mxdatetime_setup: init mxdatetime object at %p, refcnt = %d", + self, ((PyObject *)self)->ob_refcnt); + + self->type = type; + self->wrapped = obj; + Py_INCREF(self->wrapped); + + Dprintf("mxdatetime_setup: good mxdatetime object at %p, refcnt = %d", + self, ((PyObject *)self)->ob_refcnt); + return 0; +} + +static void +mxdatetime_dealloc(PyObject* obj) +{ + mxdatetimeObject *self = (mxdatetimeObject *)obj; + + Py_XDECREF(self->wrapped); + + Dprintf("mxdatetime_dealloc: deleted mxdatetime object at %p, refcnt = %d", + obj, obj->ob_refcnt); + + obj->ob_type->tp_free(obj); +} + +static int +mxdatetime_init(PyObject *obj, PyObject *args, PyObject *kwds) +{ + PyObject *mx; + int type = -1; /* raise an error if type was not passed! */ + + if (!PyArg_ParseTuple(args, "O|i", &mx, &type)) + return -1; + + return mxdatetime_setup((mxdatetimeObject *)obj, mx, type); +} + +static PyObject * +mxdatetime_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +{ + return type->tp_alloc(type, 0); +} + +static void +mxdatetime_del(PyObject* self) +{ + PyObject_Del(self); +} + +static PyObject * +mxdatetime_repr(mxdatetimeObject *self) +{ + return PyString_FromFormat("<psycopg2._psycopg.MxDateTime object at %p>", + self); +} + +/* object type */ + +#define mxdatetimeType_doc \ +"MxDateTime(mx, type) -> new mx.DateTime wrapper object" + +PyTypeObject mxdatetimeType = { + PyObject_HEAD_INIT(NULL) + 0, + "psycopg2._psycopg.MxDateTime", + sizeof(mxdatetimeObject), + 0, + mxdatetime_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + + 0, /*tp_compare*/ + (reprfunc)mxdatetime_repr, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash */ + + 0, /*tp_call*/ + (reprfunc)mxdatetime_str, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + + mxdatetimeType_doc, /*tp_doc*/ + + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + + /* Attribute descriptor and subclassing stuff */ + + mxdatetimeObject_methods, /*tp_methods*/ + mxdatetimeObject_members, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + + mxdatetime_init, /*tp_init*/ + PyType_GenericAlloc, /*tp_alloc*/ + mxdatetime_new, /*tp_new*/ + (freefunc)mxdatetime_del, /*tp_free Low-level free-memory routine */ + 0, /*tp_is_gc For PyObject_IS_GC */ + 0, /*tp_bases*/ + 0, /*tp_mro method resolution order */ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0 /*tp_weaklist*/ +}; + + +/** module-level functions **/ + +#ifdef PSYCOPG_DEFAULT_MXDATETIME + +PyObject * +psyco_Date(PyObject *self, PyObject *args) +{ + PyObject *res, *mx; + int year, month, day; + + if (!PyArg_ParseTuple(args, "iii", &year, &month, &day)) + return NULL; + + mx = mxDateTimeP->DateTime_FromDateAndTime(year, month, day, 0, 0, 0.0); + if (mx == NULL) return NULL; + + res = PyObject_CallFunction((PyObject *)&mxdatetimeType, "Oi", mx, + PSYCO_MXDATETIME_DATE); + Py_DECREF(mx); + return res; +} + +PyObject * +psyco_Time(PyObject *self, PyObject *args) +{ + PyObject *res, *mx; + int hours, minutes=0; + double seconds=0.0; + + if (!PyArg_ParseTuple(args, "iid", &hours, &minutes, &seconds)) + return NULL; + + mx = mxDateTimeP->DateTimeDelta_FromTime(hours, minutes, seconds); + if (mx == NULL) return NULL; + + res = PyObject_CallFunction((PyObject *)&mxdatetimeType, "Oi", mx, + PSYCO_MXDATETIME_TIME); + Py_DECREF(mx); + return res; +} + +PyObject * +psyco_Timestamp(PyObject *self, PyObject *args) +{ + PyObject *res, *mx; + int year, month, day; + int hour=0, minute=0; /* default to midnight */ + double second=0.0; + + if (!PyArg_ParseTuple(args, "lii|iid", &year, &month, &day, + &hour, &minute, &second)) + return NULL; + + mx = mxDateTimeP->DateTime_FromDateAndTime(year, month, day, + hour, minute, second); + if (mx == NULL) return NULL; + + res = PyObject_CallFunction((PyObject *)&mxdatetimeType, "Oi", mx, + PSYCO_MXDATETIME_TIMESTAMP); + Py_DECREF(mx); + return res; +} + +PyObject * +psyco_DateFromTicks(PyObject *self, PyObject *args) +{ + PyObject *res, *mx; + double ticks; + + if (!PyArg_ParseTuple(args,"d", &ticks)) + return NULL; + + if (!(mx = mxDateTimeP->DateTime_FromTicks(ticks))) + return NULL; + + res = PyObject_CallFunction((PyObject *)&mxdatetimeType, "Oi", mx, + PSYCO_MXDATETIME_DATE); + Py_DECREF(mx); + return res; +} + +PyObject * +psyco_TimeFromTicks(PyObject *self, PyObject *args) +{ + PyObject *res, *mx, *dt; + double ticks; + + if (!PyArg_ParseTuple(args,"d", &ticks)) + return NULL; + + if (!(dt = mxDateTimeP->DateTime_FromTicks(ticks))) + return NULL; + + if (!(mx = mxDateTimeP->DateTimeDelta_FromDaysAndSeconds( + 0, ((mxDateTimeObject*)dt)->abstime))) + { + Py_DECREF(dt); + return NULL; + } + + Py_DECREF(dt); + res = PyObject_CallFunction((PyObject *)&mxdatetimeType, "Oi", mx, + PSYCO_MXDATETIME_TIME); + Py_DECREF(mx); + return res; +} + +PyObject * +psyco_TimestampFromTicks(PyObject *self, PyObject *args) +{ + PyObject *mx, *res; + double ticks; + + if (!PyArg_ParseTuple(args, "d", &ticks)) + return NULL; + + if (!(mx = mxDateTimeP->DateTime_FromTicks(ticks))) + return NULL; + + res = PyObject_CallFunction((PyObject *)&mxdatetimeType, "Oi", mx, + PSYCO_MXDATETIME_TIMESTAMP); + Py_DECREF(mx); + return res; +} + +#endif + +PyObject * +psyco_DateFromMx(PyObject *self, PyObject *args) +{ + PyObject *mx; + + if (!PyArg_ParseTuple(args, "O!", mxDateTimeP->DateTime_Type, &mx)) + return NULL; + + return PyObject_CallFunction((PyObject *)&mxdatetimeType, "Oi", mx, + PSYCO_MXDATETIME_DATE); +} + +PyObject * +psyco_TimeFromMx(PyObject *self, PyObject *args) +{ + PyObject *mx; + + if (!PyArg_ParseTuple(args, "O!", mxDateTimeP->DateTimeDelta_Type, &mx)) + return NULL; + + return PyObject_CallFunction((PyObject *)&mxdatetimeType, "Oi", mx, + PSYCO_MXDATETIME_TIME); +} + +PyObject * +psyco_TimestampFromMx(PyObject *self, PyObject *args) +{ + PyObject *mx; + + if (!PyArg_ParseTuple(args, "O!", mxDateTimeP->DateTime_Type, &mx)) + return NULL; + + return PyObject_CallFunction((PyObject *)&mxdatetimeType, "Oi", mx, + PSYCO_MXDATETIME_TIMESTAMP); +} + +PyObject * +psyco_IntervalFromMx(PyObject *self, PyObject *args) +{ + PyObject *mx; + + if (!PyArg_ParseTuple(args, "O!", mxDateTimeP->DateTime_Type, &mx)) + return NULL; + + return PyObject_CallFunction((PyObject *)&mxdatetimeType, "Oi", mx, + PSYCO_MXDATETIME_INTERVAL); +} diff --git a/psycopg2/psycopg/adapter_mxdatetime.h b/psycopg2/psycopg/adapter_mxdatetime.h new file mode 100644 index 00000000..c4857073 --- /dev/null +++ b/psycopg2/psycopg/adapter_mxdatetime.h @@ -0,0 +1,94 @@ +/* adapter_mxdatetime.h - definition for the mx date/time types + * + * Copyright (C) 2003-2004 Federico Di Gregorio <fog@debian.org> + * + * This file is part of psycopg. + * + * 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 the Free Software Foundation; either version 2, + * or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef PSYCOPG_MXDATETIME_H +#define PSYCOPG_MXDATETIME_H 1 + +#include <Python.h> + +#ifdef __cplusplus +extern "C" { +#endif + +extern PyTypeObject mxdatetimeType; + +typedef struct { + PyObject HEAD; + + PyObject *wrapped; + int type; +#define PSYCO_MXDATETIME_TIME 0 +#define PSYCO_MXDATETIME_DATE 1 +#define PSYCO_MXDATETIME_TIMESTAMP 2 +#define PSYCO_MXDATETIME_INTERVAL 3 + +} mxdatetimeObject; + +/* functions exported to psycopgmodule.c */ +#ifdef PSYCOPG_DEFAULT_MXDATETIME + +extern PyObject *psyco_Date(PyObject *module, PyObject *args); +#define psyco_Date_doc \ + "Date(year, month, day) -> new date" + +extern PyObject *psyco_Time(PyObject *module, PyObject *args); +#define psyco_Time_doc \ + "Time(hour, minutes, seconds) -> new time" + +extern PyObject *psyco_Timestamp(PyObject *module, PyObject *args); +#define psyco_Timestamp_doc \ + "Time(year, month, day, hour, minutes, seconds) -> new timestamp" + +extern PyObject *psyco_DateFromTicks(PyObject *module, PyObject *args); +#define psyco_DateFromTicks_doc \ + "DateFromTicks(ticks) -> new date" + +extern PyObject *psyco_TimeFromTicks(PyObject *module, PyObject *args); +#define psyco_TimeFromTicks_doc \ + "TimeFromTicks(ticks) -> new time" + +extern PyObject *psyco_TimestampFromTicks(PyObject *module, PyObject *args); +#define psyco_TimestampFromTicks_doc \ + "TimestampFromTicks(ticks) -> new timestamp" + +#endif /* PSYCOPG_DEFAULT_MXDATETIME */ + +extern PyObject *psyco_DateFromMx(PyObject *module, PyObject *args); +#define psyco_DateFromMx_doc \ + "DateFromMx(mx) -> new date" + +extern PyObject *psyco_TimeFromMx(PyObject *module, PyObject *args); +#define psyco_TimeFromMx_doc \ + "TimeFromMx(mx) -> new time" + +extern PyObject *psyco_TimestampFromMx(PyObject *module, PyObject *args); +#define psyco_TimestampFromMx_doc \ + "TimestampFromMx(mx) -> new timestamp" + +extern PyObject *psyco_IntervalFromMx(PyObject *module, PyObject *args); +#define psyco_IntervalFromMx_doc \ + "IntervalFromMx(mx) -> new interval" + +#ifdef __cplusplus +} +#endif + +#endif /* !defined(PSYCOPG_MXDATETIME_H) */ diff --git a/psycopg2/psycopg/adapter_pboolean.c b/psycopg2/psycopg/adapter_pboolean.c new file mode 100644 index 00000000..fa70ad03 --- /dev/null +++ b/psycopg2/psycopg/adapter_pboolean.c @@ -0,0 +1,238 @@ +/* adapter_pboolean.c - psycopg boolean type wrapper implementation + * + * Copyright (C) 2003-2004 Federico Di Gregorio <fog@debian.org> + * + * This file is part of psycopg. + * + * 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 the Free Software Foundation; either version 2, + * or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include <Python.h> +#include <structmember.h> +#include <stringobject.h> +#include <string.h> + +#define PSYCOPG_MODULE +#include "psycopg/config.h" +#include "psycopg/python.h" +#include "psycopg/psycopg.h" +#include "psycopg/adapter_pboolean.h" +#include "psycopg/microprotocols_proto.h" + + +/** the Boolean object **/ + +static PyObject * +pboolean_str(pbooleanObject *self) +{ +#ifdef PSYCOPG_NEW_BOOLEAN + if (PyObject_IsTrue(self->wrapped)) { + return PyString_FromString("true"); + } + else { + return PyString_FromString("false"); + } +#else + if (PyObject_IsTrue(self->wrapped)) { + return PyString_FromString("'t'"); + } + else { + return PyString_FromString("'f'"); + } +#endif +} + +PyObject * +pboolean_getquoted(pbooleanObject *self, PyObject *args) +{ + if (!PyArg_ParseTuple(args, "")) return NULL; + return pboolean_str(self); +} + +PyObject * +pboolean_conform(pbooleanObject *self, PyObject *args) +{ + PyObject *res, *proto; + + if (!PyArg_ParseTuple(args, "O", &proto)) return NULL; + + if (proto == (PyObject*)&isqlquoteType) + res = (PyObject*)self; + else + res = Py_None; + + Py_INCREF(res); + return res; +} + +/** the Boolean object */ + +/* object member list */ + +static struct PyMemberDef pbooleanObject_members[] = { + {"adapted", T_OBJECT, offsetof(pbooleanObject, wrapped), RO}, + {NULL} +}; + +/* object method table */ + +static PyMethodDef pbooleanObject_methods[] = { + {"getquoted", (PyCFunction)pboolean_getquoted, METH_VARARGS, + "getquoted() -> wrapped object value as SQL-quoted string"}, + {"__conform__", (PyCFunction)pboolean_conform, METH_VARARGS, NULL}, + {NULL} /* Sentinel */ +}; + +/* initialization and finalization methods */ + +static int +pboolean_setup(pbooleanObject *self, PyObject *obj) +{ + Dprintf("pboolean_setup: init pboolean object at %p, refcnt = %d", + self, ((PyObject *)self)->ob_refcnt); + + self->wrapped = obj; + Py_INCREF(self->wrapped); + + Dprintf("pboolean_setup: good pboolean object at %p, refcnt = %d", + self, ((PyObject *)self)->ob_refcnt); + return 0; +} + +static void +pboolean_dealloc(PyObject* obj) +{ + pbooleanObject *self = (pbooleanObject *)obj; + + Py_XDECREF(self->wrapped); + + Dprintf("pboolean_dealloc: deleted pboolean object at %p, refcnt = %d", + obj, obj->ob_refcnt); + + obj->ob_type->tp_free(obj); +} + +static int +pboolean_init(PyObject *obj, PyObject *args, PyObject *kwds) +{ + PyObject *o; + + if (!PyArg_ParseTuple(args, "O", &o)) + return -1; + + return pboolean_setup((pbooleanObject *)obj, o); +} + +static PyObject * +pboolean_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +{ + return type->tp_alloc(type, 0); +} + +static void +pboolean_del(PyObject* self) +{ + PyObject_Del(self); +} + +static PyObject * +pboolean_repr(pbooleanObject *self) +{ + return PyString_FromFormat("<psycopg2._psycopg.Boolean object at %p>", + self); +} + + +/* object type */ + +#define pbooleanType_doc \ +"Boolean(str) -> new Boolean adapter object" + +PyTypeObject pbooleanType = { + PyObject_HEAD_INIT(NULL) + 0, + "psycopg2._psycopg.Boolean", + sizeof(pbooleanObject), + 0, + pboolean_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + + 0, /*tp_compare*/ + + (reprfunc)pboolean_repr, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash */ + + 0, /*tp_call*/ + (reprfunc)pboolean_str, /*tp_str*/ + + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + pbooleanType_doc, /*tp_doc*/ + + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + + /* Attribute descriptor and subclassing stuff */ + + pbooleanObject_methods, /*tp_methods*/ + pbooleanObject_members, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + + pboolean_init, /*tp_init*/ + 0, /*tp_alloc will be set to PyType_GenericAlloc in module init*/ + pboolean_new, /*tp_new*/ + (freefunc)pboolean_del, /*tp_free Low-level free-memory routine */ + 0, /*tp_is_gc For PyObject_IS_GC */ + 0, /*tp_bases*/ + 0, /*tp_mro method resolution order */ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0 /*tp_weaklist*/ +}; + + +/** module-level functions **/ + +PyObject * +psyco_Boolean(PyObject *module, PyObject *args) +{ + PyObject *obj; + + if (!PyArg_ParseTuple(args, "O", &obj)) + return NULL; + + return PyObject_CallFunction((PyObject *)&pbooleanType, "O", obj); +} diff --git a/psycopg2/psycopg/adapter_pboolean.h b/psycopg2/psycopg/adapter_pboolean.h new file mode 100644 index 00000000..efdfe56a --- /dev/null +++ b/psycopg2/psycopg/adapter_pboolean.h @@ -0,0 +1,51 @@ +/* adapter_pboolean.h - definition for the psycopg boolean type wrapper + * + * Copyright (C) 2003-2004 Federico Di Gregorio <fog@debian.org> + * + * This file is part of psycopg. + * + * 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 the Free Software Foundation; either version 2, + * or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef PSYCOPG_PBOOLEAN_H +#define PSYCOPG_PBOOLEAN_H 1 + +#include <Python.h> + +#ifdef __cplusplus +extern "C" { +#endif + +extern PyTypeObject pbooleanType; + +typedef struct { + PyObject HEAD; + + /* this is the real object we wrap */ + PyObject *wrapped; + +} pbooleanObject; + +/* functions exported to psycopgmodule.c */ + +extern PyObject *psyco_Boolean(PyObject *module, PyObject *args); +#define psyco_Boolean_doc \ + "Boolean(obj) -> new boolean value" + +#ifdef __cplusplus +} +#endif + +#endif /* !defined(PSYCOPG_PBOOLEAN_H) */ diff --git a/psycopg2/psycopg/adapter_qstring.c b/psycopg2/psycopg/adapter_qstring.c new file mode 100644 index 00000000..2eaf7f34 --- /dev/null +++ b/psycopg2/psycopg/adapter_qstring.c @@ -0,0 +1,393 @@ +/* adapter_qstring.c - QuotedString objects + * + * Copyright (C) 2003-2004 Federico Di Gregorio <fog@debian.org> + * + * This file is part of psycopg. + * + * 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 the Free Software Foundation; either version 2, + * or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include <Python.h> +#include <structmember.h> +#include <stringobject.h> + +#include <libpq-fe.h> +#include <string.h> + +#define PSYCOPG_MODULE +#include "psycopg/config.h" +#include "psycopg/python.h" +#include "psycopg/psycopg.h" +#include "psycopg/connection.h" +#include "psycopg/adapter_qstring.h" +#include "psycopg/microprotocols_proto.h" + + +/** the quoting code */ + +#ifndef PSYCOPG_OWN_QUOTING +static size_t +qstring_escape(char *to, char *from, size_t len, PGconn *conn) +{ +#if PG_MAJOR_VERSION > 8 || \ + (PG_MAJOR_VERSION == 8 && PG_MINOR_VERSION > 1) || \ + (PG_MAJOR_VERSION == 8 && PG_MINOR_VERSION == 1 && PG_PATCH_VERSION >= 4) + int err; + if (conn) + return PQescapeStringConn(conn, to, from, len, &err); + else +#endif + return PQescapeString(to, from, len); +} +#else +static size_t +qstring_escape(char *to, char *from, size_t len, PGconn *conn) +{ + int i, j; + + for (i=0, j=0; i<len; i++) { + switch(from[i]) { + + case '\'': + to[j++] = '\''; + to[j++] = '\''; + break; + + case '\\': + to[j++] = '\\'; + to[j++] = '\\'; + break; + + case '\0': + /* do nothing, embedded \0 are discarded */ + break; + + default: + to[j++] = from[i]; + } + } + to[j] = '\0'; + + Dprintf("qstring_quote: to = %s", to); + return strlen(to); +} +#endif + +/* qstring_quote - do the quote process on plain and unicode strings */ + +static PyObject * +qstring_quote(qstringObject *self) +{ + PyObject *str; + char *s, *buffer; + int len; + + /* if the wrapped object is an unicode object we can encode it to match + self->encoding but if the encoding is not specified we don't know what + to do and we raise an exception */ + + /* TODO: we need a real translation table from postgres encoding names to + python ones here */ + + if (PyUnicode_Check(self->wrapped) && self->encoding) { + PyObject *enc = PyDict_GetItemString(psycoEncodings, self->encoding); + /* note that pgenc is a borrowed reference */ + + if (enc) { + char *s = PyString_AsString(enc); + Dprintf("qstring_quote: encoding unicode object to %s", s); + str = PyUnicode_AsEncodedString(self->wrapped, s, NULL); + Dprintf("qstring_quote: got encoded object at %p", str); + if (str == NULL) return NULL; + } + else { + /* can't find the right encoder, raise exception */ + PyErr_Format(InterfaceError, + "can't encode unicode string to %s", self->encoding); + return NULL; + } + } + + /* if the wrapped object is a simple string, we don't know how to + (re)encode it, so we pass it as-is */ + else if (PyString_Check(self->wrapped)) { + str = self->wrapped; + /* INCREF to make it ref-wise identical to unicode one */ + Py_INCREF(str); + } + + /* if the wrapped object is not a string, this is an error */ + else { + PyErr_SetString(PyExc_TypeError, + "can't quote non-string object (or missing encoding)"); + return NULL; + } + + /* encode the string into buffer */ + PyString_AsStringAndSize(str, &s, &len); + + buffer = (char *)PyMem_Malloc((len*2+3) * sizeof(char)); + if (buffer == NULL) { + Py_DECREF(str); + PyErr_NoMemory(); + return NULL; + } + + Py_BEGIN_ALLOW_THREADS; + len = qstring_escape(buffer+1, s, len, + self->conn ? ((connectionObject*)self->conn)->pgconn : NULL); + buffer[0] = '\'' ; buffer[len+1] = '\''; + Py_END_ALLOW_THREADS; + + self->buffer = PyString_FromStringAndSize(buffer, len+2); + PyMem_Free(buffer); + Py_DECREF(str); + + return self->buffer; +} + +/* qstring_str, qstring_getquoted - return result of quoting */ + +static PyObject * +qstring_str(qstringObject *self) +{ + if (self->buffer == NULL) { + qstring_quote(self); + } + Py_XINCREF(self->buffer); + return self->buffer; +} + +PyObject * +qstring_getquoted(qstringObject *self, PyObject *args) +{ + if (!PyArg_ParseTuple(args, "")) return NULL; + return qstring_str(self); +} + +PyObject * +qstring_prepare(qstringObject *self, PyObject *args) +{ + connectionObject *conn; + + if (!PyArg_ParseTuple(args, "O", &conn)) + return NULL; + + /* we bother copying the encoding only if the wrapped string is unicode, + we don't need the encoding if that's not the case */ + if (PyUnicode_Check(self->wrapped)) { + if (self->encoding) free(self->encoding); + self->encoding = strdup(conn->encoding); + Dprintf("qstring_prepare: set encoding to %s", conn->encoding); + } + + Py_XDECREF(self->conn); + if (conn) { + self->conn = (PyObject*)conn; + Py_INCREF(self->conn); + } + + Py_INCREF(Py_None); + return Py_None; +} + +PyObject * +qstring_conform(qstringObject *self, PyObject *args) +{ + PyObject *res, *proto; + + if (!PyArg_ParseTuple(args, "O", &proto)) return NULL; + + if (proto == (PyObject*)&isqlquoteType) + res = (PyObject*)self; + else + res = Py_None; + + Py_INCREF(res); + return res; +} + +/** the QuotedString object **/ + +/* object member list */ + +static struct PyMemberDef qstringObject_members[] = { + {"adapted", T_OBJECT, offsetof(qstringObject, wrapped), RO}, + {"buffer", T_OBJECT, offsetof(qstringObject, buffer), RO}, + {"encoding", T_STRING, offsetof(qstringObject, encoding), RO}, + {NULL} +}; + +/* object method table */ + +static PyMethodDef qstringObject_methods[] = { + {"getquoted", (PyCFunction)qstring_getquoted, METH_VARARGS, + "getquoted() -> wrapped object value as SQL-quoted string"}, + {"prepare", (PyCFunction)qstring_prepare, METH_VARARGS, + "prepare(conn) -> set encoding to conn->encoding and store conn"}, + {"__conform__", (PyCFunction)qstring_conform, METH_VARARGS, NULL}, + {NULL} /* Sentinel */ +}; + +/* initialization and finalization methods */ + +static int +qstring_setup(qstringObject *self, PyObject *str, char *enc) +{ + Dprintf("qstring_setup: init qstring object at %p, refcnt = %d", + self, ((PyObject *)self)->ob_refcnt); + + self->buffer = NULL; + self->conn = NULL; + + /* FIXME: remove this orrible strdup */ + if (enc) self->encoding = strdup(enc); + + self->wrapped = str; + Py_INCREF(self->wrapped); + + Dprintf("qstring_setup: good qstring object at %p, refcnt = %d", + self, ((PyObject *)self)->ob_refcnt); + return 0; +} + +static void +qstring_dealloc(PyObject* obj) +{ + qstringObject *self = (qstringObject *)obj; + + Py_XDECREF(self->wrapped); + Py_XDECREF(self->buffer); + Py_XDECREF(self->conn); + + if (self->encoding) free(self->encoding); + + Dprintf("qstring_dealloc: deleted qstring object at %p, refcnt = %d", + obj, obj->ob_refcnt); + + obj->ob_type->tp_free(obj); +} + +static int +qstring_init(PyObject *obj, PyObject *args, PyObject *kwds) +{ + PyObject *str; + char *enc = "latin-1"; /* default encoding as in Python */ + + if (!PyArg_ParseTuple(args, "O|s", &str, &enc)) + return -1; + + return qstring_setup((qstringObject *)obj, str, enc); +} + +static PyObject * +qstring_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +{ + return type->tp_alloc(type, 0); +} + +static void +qstring_del(PyObject* self) +{ + PyObject_Del(self); +} + +static PyObject * +qstring_repr(qstringObject *self) +{ + return PyString_FromFormat("<psycopg2._psycopg.QuotedString object at %p>", + self); +} + +/* object type */ + +#define qstringType_doc \ +"QuotedString(str, enc) -> new quoted object with 'enc' encoding" + +PyTypeObject qstringType = { + PyObject_HEAD_INIT(NULL) + 0, + "psycopg2._psycopg.QuotedString", + sizeof(qstringObject), + 0, + qstring_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + + 0, /*tp_compare*/ + (reprfunc)qstring_repr, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash */ + + 0, /*tp_call*/ + (reprfunc)qstring_str, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + + qstringType_doc, /*tp_doc*/ + + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + + /* Attribute descriptor and subclassing stuff */ + + qstringObject_methods, /*tp_methods*/ + qstringObject_members, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + + qstring_init, /*tp_init*/ + 0, /*tp_alloc will be set to PyType_GenericAlloc in module init*/ + qstring_new, /*tp_new*/ + (freefunc)qstring_del, /*tp_free Low-level free-memory routine */ + 0, /*tp_is_gc For PyObject_IS_GC */ + 0, /*tp_bases*/ + 0, /*tp_mro method resolution order */ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0 /*tp_weaklist*/ +}; + + +/** module-level functions **/ + +PyObject * +psyco_QuotedString(PyObject *module, PyObject *args) +{ + PyObject *str; + char *enc = "latin-1"; /* default encoding as in Python */ + + if (!PyArg_ParseTuple(args, "O|s", &str, &enc)) + return NULL; + + return PyObject_CallFunction((PyObject *)&qstringType, "Os", str, enc); +} diff --git a/psycopg2/psycopg/adapter_qstring.h b/psycopg2/psycopg/adapter_qstring.h new file mode 100644 index 00000000..544b32b6 --- /dev/null +++ b/psycopg2/psycopg/adapter_qstring.h @@ -0,0 +1,53 @@ +/* adapter_qstring.h - definition for the QuotedString type + * + * Copyright (C) 2003 Federico Di Gregorio <fog@debian.org> + * + * This file is part of psycopg. + * + * 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 the Free Software Foundation; either version 2, + * or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef PSYCOPG_QSTRING_H +#define PSYCOPG_QSTRING_H 1 + +#include <Python.h> + +#ifdef __cplusplus +extern "C" { +#endif + +extern PyTypeObject qstringType; + +typedef struct { + PyObject HEAD; + + PyObject *wrapped; + PyObject *buffer; + char *encoding; + + PyObject *conn; +} qstringObject; + +/* functions exported to psycopgmodule.c */ + +extern PyObject *psyco_QuotedString(PyObject *module, PyObject *args); +#define psyco_QuotedString_doc \ + "QuotedString(str, enc) -> new quoted string" + +#ifdef __cplusplus +} +#endif + +#endif /* !defined(PSYCOPG_QSTRING_H) */ diff --git a/psycopg2/psycopg/config.h b/psycopg2/psycopg/config.h new file mode 100644 index 00000000..649fee8b --- /dev/null +++ b/psycopg2/psycopg/config.h @@ -0,0 +1,118 @@ +/* config.h - general config and Dprintf macro + * + * Copyright (C) 2003 Federico Di Gregorio <fog@debian.org> + * + * This file is part of psycopg. + * + * 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 the Free Software Foundation; either version 2, + * or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef PSYCOPG_CONFIG_H +#define PSYCOPG_CONFIG_H 1 + +/* debug printf-like function */ +#if defined( __GNUC__) && !defined(__APPLE__) +#ifdef PSYCOPG_DEBUG +#include <sys/types.h> +#include <unistd.h> +#define Dprintf(fmt, args...) \ + fprintf(stderr, "[%d] " fmt "\n", getpid() , ## args) +#else +#define Dprintf(fmt, args...) +#endif +#else /* !__GNUC__ or __APPLE__ */ +#ifdef PSYCOPG_DEBUG +#include <stdarg.h> +static void Dprintf(const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + vprintf(fmt, ap); + va_end(ap); + printf("\n"); +} +#else +static void Dprintf(const char *fmt, ...) {} +#endif +#endif + +/* pthreads work-arounds for mutilated operating systems */ +#if defined(_WIN32) || defined(__BEOS__) + +#ifdef _WIN32 +#include <winsock2.h> +#define pthread_mutex_t HANDLE +#define pthread_condvar_t HANDLE +#define pthread_mutex_lock(object) WaitForSingleObject(object, INFINITE) +#define pthread_mutex_unlock(object) ReleaseMutex(object) +#define pthread_mutex_destroy(ref) (CloseHandle(*(ref))) +/* convert pthread mutex to native mutex */ +static int pthread_mutex_init(pthread_mutex_t *mutex, void* fake) +{ + *mutex = CreateMutex(NULL, FALSE, NULL); + return 0; +} +#endif /* _WIN32 */ + +#ifdef __BEOS__ +#include <OS.h> +#define pthread_mutex_t sem_id +#define pthread_mutex_lock(object) acquire_sem(object) +#define pthread_mutex_unlock(object) release_sem(object) +#define pthread_mutex_destroy(ref) delete_sem(*ref) +static int pthread_mutex_init(pthread_mutex_t *mutex, void* fake) +{ + *mutex = create_sem(1, "psycopg_mutex"); + if (*mutex < B_OK) + return *mutex; + return 0; +} +#endif /* __BEOS__ */ + +#else /* pthread is available */ +#include <pthread.h> +#endif + +/* to work around the fact that Windows does not have a gmtime_r function, or + a proper gmtime function */ +#ifdef _WIN32 +static struct tm *gmtime_r(time_t *t, struct tm *tm) +{ + tm = gmtime(t); + return tm; +} +static struct tm *localtime_r(time_t *t, struct tm *tm) +{ + tm = localtime(t); + return tm; +} +/* remove the inline keyword, since it doesn't work unless C++ file */ +#define inline +#endif + +#if defined(__FreeBSD__) || defined(_WIN32) || defined(__sun__) +/* what's this, we have no round function either? */ +static double round(double num) +{ + return (num >= 0) ? floor(num + 0.5) : ceil(num - 0.5); +} +#endif + +/* postgresql < 7.4 does not have PQfreemem */ +#ifndef HAVE_PQFREEMEM +#define PQfreemem free +#endif + +#endif /* !defined(PSYCOPG_CONFIG_H) */ diff --git a/psycopg2/psycopg/connection.h b/psycopg2/psycopg/connection.h new file mode 100644 index 00000000..7010120d --- /dev/null +++ b/psycopg2/psycopg/connection.h @@ -0,0 +1,97 @@ +/* connection.h - definition for the psycopg connection type + * + * Copyright (C) 2003 Federico Di Gregorio <fog@debian.org> + * + * This file is part of psycopg. + * + * 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 the Free Software Foundation; either version 2, + * or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef PSYCOPG_CONNECTION_H +#define PSYCOPG_CONNECTION_H 1 + +#include <Python.h> +#include <libpq-fe.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* connection status */ +#define CONN_STATUS_READY 1 +#define CONN_STATUS_BEGIN 2 +#define CONN_STATUS_SYNC 3 +#define CONN_STATUS_ASYNC 4 + +extern PyTypeObject connectionType; + +typedef struct { + PyObject HEAD; + + pthread_mutex_t lock; /* the global connection lock */ + + char *dsn; /* data source name */ + char *critical; /* critical error on this connection */ + char *encoding; /* current backend encoding */ + + long int closed; /* 2 means connection has been closed */ + long int isolation_level; /* isolation level for this connection */ + long int mark; /* number of commits/rollbacks done so far */ + int status; /* status of the connection */ + int protocol; /* protocol version */ + + PGconn *pgconn; /* the postgresql connection */ + + PyObject *async_cursor; + + /* notice processing */ + PyObject *notice_list; + PyObject *notice_filter; + + /* notifies */ + PyObject *notifies; + + /* errors (DBAPI-2.0 extension) */ + PyObject *exc_Error; + PyObject *exc_Warning; + PyObject *exc_InterfaceError; + PyObject *exc_DatabaseError; + PyObject *exc_InternalError; + PyObject *exc_OperationalError; + PyObject *exc_ProgrammingError; + PyObject *exc_IntegrityError; + PyObject *exc_DataError; + PyObject *exc_NotSupportedError; + +} connectionObject; + +/* C-callable functions in connection_int.c and connection_ext.c */ +extern int conn_connect(connectionObject *self); +extern void conn_close(connectionObject *self); +extern int conn_commit(connectionObject *self); +extern int conn_rollback(connectionObject *self); +extern int conn_switch_isolation_level(connectionObject *self, int level); +extern int conn_set_client_encoding(connectionObject *self, char *enc); + +/* exception-raising macros */ +#define EXC_IF_CONN_CLOSED(self) if ((self)->closed > 0) { \ + PyErr_SetString(InterfaceError, "connection already closed"); \ + return NULL; } + +#ifdef __cplusplus +} +#endif + +#endif /* !defined(PSYCOPG_CONNECTION_H) */ diff --git a/psycopg2/psycopg/connection_int.c b/psycopg2/psycopg/connection_int.c new file mode 100644 index 00000000..3e61ddf1 --- /dev/null +++ b/psycopg2/psycopg/connection_int.c @@ -0,0 +1,303 @@ +/* connection_int.c - code used by the connection object + * + * Copyright (C) 2003 Federico Di Gregorio <fog@debian.org> + * + * This file is part of psycopg. + * + * 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 the Free Software Foundation; either version 2, + * or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include <Python.h> +#include <string.h> + +#define PSYCOPG_MODULE +#include "psycopg/config.h" +#include "psycopg/psycopg.h" +#include "psycopg/connection.h" +#include "psycopg/cursor.h" +#include "psycopg/pqpath.h" + +/* conn_notice_callback - process notices */ + +void +conn_notice_callback(void *args, const char *message) +{ + connectionObject *self = (connectionObject *)args; + + Dprintf("conn_notice_callback: %s", message); + + /* unfortunately the old protocl return COPY FROM errors only as notices, + so we need to filter them looking for such errors */ + if (strncmp(message, "ERROR", 5) == 0) + pq_set_critical(self, message); + else + PyList_Append(self->notice_list, PyString_FromString(message)); +} + +/* conn_connect - execute a connection to the dataabase */ + +int +conn_connect(connectionObject *self) +{ + PGconn *pgconn; + PGresult *pgres; + char *data, *tmp; + int i; + + /* we need the initial date style to be ISO, for typecasters; if the user + later change it, she must know what she's doing... */ + const char *datestyle = "SET DATESTYLE TO 'ISO'"; + const char *encoding = "SHOW client_encoding"; + const char *isolevel = "SHOW default_transaction_isolation"; + + const char *lvl1a = "read uncommitted"; + const char *lvl1b = "read committed"; + const char *lvl2a = "repeatable read"; + const char *lvl2b = "serializable"; + + Py_BEGIN_ALLOW_THREADS; + pgconn = PQconnectdb(self->dsn); + Py_END_ALLOW_THREADS; + + Dprintf("conn_connect: new postgresql connection at %p", pgconn); + + if (pgconn == NULL) + { + Dprintf("conn_connect: PQconnectdb(%s) FAILED", self->dsn); + PyErr_SetString(OperationalError, "PQconnectdb() failed"); + return -1; + } + else if (PQstatus(pgconn) == CONNECTION_BAD) + { + Dprintf("conn_connect: PQconnectdb(%s) returned BAD", self->dsn); + PyErr_SetString(OperationalError, PQerrorMessage(pgconn)); + PQfinish(pgconn); + return -1; + } + + PQsetNoticeProcessor(pgconn, conn_notice_callback, (void*)self); + + Py_BEGIN_ALLOW_THREADS; + pgres = PQexec(pgconn, datestyle); + Py_END_ALLOW_THREADS; + + if (pgres == NULL || PQresultStatus(pgres) != PGRES_COMMAND_OK ) { + PyErr_SetString(OperationalError, "can't set datestyle to ISO"); + PQfinish(pgconn); + IFCLEARPGRES(pgres); + return -1; + } + CLEARPGRES(pgres); + + Py_BEGIN_ALLOW_THREADS; + pgres = PQexec(pgconn, encoding); + Py_END_ALLOW_THREADS; + + if (pgres == NULL || PQresultStatus(pgres) != PGRES_TUPLES_OK) { + PyErr_SetString(OperationalError, "can't fetch client_encoding"); + PQfinish(pgconn); + IFCLEARPGRES(pgres); + return -1; + } + tmp = PQgetvalue(pgres, 0, 0); + self->encoding = PyMem_Malloc(strlen(tmp)+1); + if (self->encoding == NULL) { + /* exception already set by PyMem_Malloc() */ + PQfinish(pgconn); + IFCLEARPGRES(pgres); + return -1; + } + for (i=0 ; i < strlen(tmp) ; i++) + self->encoding[i] = toupper(tmp[i]); + self->encoding[i] = '\0'; + CLEARPGRES(pgres); + + Py_BEGIN_ALLOW_THREADS; + pgres = PQexec(pgconn, isolevel); + Py_END_ALLOW_THREADS; + + if (pgres == NULL || PQresultStatus(pgres) != PGRES_TUPLES_OK) { + PyErr_SetString(OperationalError, + "can't fetch default_isolation_level"); + PQfinish(pgconn); + IFCLEARPGRES(pgres); + return -1; + } + data = PQgetvalue(pgres, 0, 0); + if ((strncmp(lvl1a, data, strlen(lvl1a)) == 0) + || (strncmp(lvl1b, data, strlen(lvl1b)) == 0)) + self->isolation_level = 1; + else if ((strncmp(lvl2a, data, strlen(lvl2a)) == 0) + || (strncmp(lvl2b, data, strlen(lvl2b)) == 0)) + self->isolation_level = 2; + else + self->isolation_level = 2; + CLEARPGRES(pgres); + + if (PQsetnonblocking(pgconn, 1) != 0) { + Dprintf("conn_connect: PQsetnonblocking() FAILED"); + PyErr_SetString(OperationalError, "PQsetnonblocking() failed"); + PQfinish(pgconn); + return -1; + } + +#ifdef HAVE_PQPROTOCOL3 + self->protocol = PQprotocolVersion(pgconn); +#else + self->protocol = 2; +#endif + Dprintf("conn_connect: using protocol %d", self->protocol); + + self->pgconn = pgconn; + return 0; +} + +/* conn_close - do anything needed to shut down the connection */ + +void +conn_close(connectionObject *self) +{ + /* sets this connection as closed even for other threads; also note that + we need to check the value of pgconn, because we get called even when + the connection fails! */ + Py_BEGIN_ALLOW_THREADS; + pthread_mutex_lock(&self->lock); + + self->closed = 1; + + /* execute a forced rollback on the connection (but don't check the + result, we're going to close the pq connection anyway */ + if (self->pgconn) { + pq_abort(self); + PQfinish(self->pgconn); + Dprintf("conn_close: PQfinish called"); + self->pgconn = NULL; + } + + pthread_mutex_unlock(&self->lock); + Py_END_ALLOW_THREADS; + +} + +/* conn_commit - commit on a connection */ + +int +conn_commit(connectionObject *self) +{ + int res; + + Py_BEGIN_ALLOW_THREADS; + pthread_mutex_lock(&self->lock); + + res = pq_commit(self); + self->mark++; + + pthread_mutex_unlock(&self->lock); + Py_END_ALLOW_THREADS; + + return res; +} + +/* conn_rollback - rollback a connection */ + +int +conn_rollback(connectionObject *self) +{ + int res; + + Py_BEGIN_ALLOW_THREADS; + pthread_mutex_lock(&self->lock); + + res = pq_abort(self); + self->mark++; + + pthread_mutex_unlock(&self->lock); + Py_END_ALLOW_THREADS; + + return res; +} + +/* conn_switch_isolation_level - switch isolation level on the connection */ + +int +conn_switch_isolation_level(connectionObject *self, int level) +{ + int res = 0; + + Py_BEGIN_ALLOW_THREADS; + pthread_mutex_lock(&self->lock); + + /* if the current isolation level is > 0 we need to abort the current + transaction before changing; that all folks! */ + if (self->isolation_level != level && self->isolation_level > 0) { + res = pq_abort(self); + } + self->isolation_level = level; + self->mark++; + + Dprintf("conn_switch_isolation_level: switched to level %d", level); + + pthread_mutex_unlock(&self->lock); + Py_END_ALLOW_THREADS; + + return res; +} + +/* conn_set_client_encoding - switch client encoding on connection */ + +int +conn_set_client_encoding(connectionObject *self, char *enc) +{ + PGresult *pgres; + char query[48]; + int res = 0; + + /* TODO: check for async query here and raise error if necessary */ + + Py_BEGIN_ALLOW_THREADS; + pthread_mutex_lock(&self->lock); + + /* set encoding, no encoding string is longer than 24 bytes */ + PyOS_snprintf(query, 47, "SET client_encoding = '%s'", enc); + + /* abort the current transaction, to set the encoding ouside of + transactions */ + res = pq_abort(self); + + if (res == 0) { + pgres = PQexec(self->pgconn, query); + + if (pgres == NULL || PQresultStatus(pgres) != PGRES_COMMAND_OK ) { + res = -1; + } + else { + /* no error, we can proceeed and store the new encoding */ + if (self->encoding) free(self->encoding); + self->encoding = strdup(enc); + } + + IFCLEARPGRES(pgres); + } + + Dprintf("conn_set_client_encoding: set encoding to %s", self->encoding); + + pthread_mutex_unlock(&self->lock); + Py_END_ALLOW_THREADS; + + if (res == -1) + PyErr_Format(OperationalError, "can't set encoding to %s", enc); + + return res; +} diff --git a/psycopg2/psycopg/connection_type.c b/psycopg2/psycopg/connection_type.c new file mode 100644 index 00000000..f8cbd806 --- /dev/null +++ b/psycopg2/psycopg/connection_type.c @@ -0,0 +1,422 @@ +/* connection_type.c - python interface to connection objects + * + * Copyright (C) 2003 Federico Di Gregorio <fog@debian.org> + * + * This file is part of psycopg. + * + * 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 the Free Software Foundation; either version 2, + * or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include <Python.h> +#include <structmember.h> +#include <stringobject.h> + +#include <string.h> + +#define PSYCOPG_MODULE +#include "psycopg/config.h" +#include "psycopg/python.h" +#include "psycopg/psycopg.h" +#include "psycopg/connection.h" +#include "psycopg/cursor.h" + +/** DBAPI methods **/ + +/* cursor method - allocate a new cursor */ + +#define psyco_conn_cursor_doc \ +"cursor(cursor_factory=extensions.cursor) -- new cursor\n\n" \ +"Return a new cursor.\n\nThe ``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" \ +"`extensions.cursor`.\n\n" \ +":rtype: `extensions.cursor`" + +static PyObject * +psyco_conn_cursor(connectionObject *self, PyObject *args, PyObject *keywds) +{ + char *name = NULL; + PyObject *obj, *factory = NULL; + + static char *kwlist[] = {"name", "cursor_factory", NULL}; + + if (!PyArg_ParseTupleAndKeywords(args, keywds, "|sO", kwlist, + &name, &factory)) { + return NULL; + } + + EXC_IF_CONN_CLOSED(self); + + Dprintf("psyco_conn_cursor: new cursor for connection at %p", self); + Dprintf("psyco_conn_cursor: parameters: name = %s", name); + + if (factory == NULL) factory = (PyObject *)&cursorType; + if (name) + obj = PyObject_CallFunction(factory, "Os", self, name); + else + obj = PyObject_CallFunction(factory, "O", self); + + if (obj == NULL) return NULL; + if (PyObject_IsInstance(obj, (PyObject *)&cursorType) == 0) { + PyErr_SetString(PyExc_TypeError, + "cursor factory must be subclass of psycopg2._psycopg.cursor"); + Py_DECREF(obj); + return NULL; + } + + Dprintf("psyco_conn_cursor: new cursor at %p: refcnt = %d", + obj, obj->ob_refcnt); + return obj; +} + + +/* close method - close the connection and all related cursors */ + +#define psyco_conn_close_doc "close() -- Close the connection." + +static PyObject * +psyco_conn_close(connectionObject *self, PyObject *args) +{ + EXC_IF_CONN_CLOSED(self); + + if (!PyArg_ParseTuple(args, "")) return NULL; + + Dprintf("psyco_conn_close: closing connection at %p", self); + conn_close(self); + Dprintf("psyco_conn_close: connection at %p closed", self); + + Py_INCREF(Py_None); + return Py_None; +} + + +/* commit method - commit all changes to the database */ + +#define psyco_conn_commit_doc "commit() -- Commit all changes to database." + +static PyObject * +psyco_conn_commit(connectionObject *self, PyObject *args) +{ + EXC_IF_CONN_CLOSED(self); + + if (!PyArg_ParseTuple(args, "")) return NULL; + + /* FIXME: check return status? */ + conn_commit(self); + + Py_INCREF(Py_None); + return Py_None; +} + + +/* rollback method - roll back all changes done to the database */ + +#define psyco_conn_rollback_doc \ +"rollback() -- Roll back all changes done to database." + +static PyObject * +psyco_conn_rollback(connectionObject *self, PyObject *args) +{ + EXC_IF_CONN_CLOSED(self); + + if (!PyArg_ParseTuple(args, "")) return NULL; + + /* FIXME: check return status? */ + conn_rollback(self); + + Py_INCREF(Py_None); + return Py_None; +} + + +#ifdef PSYCOPG_EXTENSIONS +/* set_isolation_level method - switch connection isolation level */ + +#define psyco_conn_set_isolation_level_doc \ +"set_isolation_level(level) -- Switch isolation level to ``level``." + +static PyObject * +psyco_conn_set_isolation_level(connectionObject *self, PyObject *args) +{ + int level = 1; + + EXC_IF_CONN_CLOSED(self); + + if (!PyArg_ParseTuple(args, "i", &level)) return NULL; + + if (level < 0 || level > 2) { + PyErr_SetString(PyExc_ValueError, + "isolation level out of bounds (0,3)"); + return NULL; + } + + /* FIXME: check return status? */ + conn_switch_isolation_level(self, level); + + Py_INCREF(Py_None); + return Py_None; +} + + + +/* set_isolation_level method - switch connection isolation level */ + +#define psyco_conn_set_client_encoding_doc \ +"set_client_encoding(encoding) -- Set client encoding to ``encoding``." + +static PyObject * +psyco_conn_set_client_encoding(connectionObject *self, PyObject *args) +{ + char *enc = NULL; + + EXC_IF_CONN_CLOSED(self); + + if (!PyArg_ParseTuple(args, "s", &enc)) return NULL; + + if (conn_set_client_encoding(self, enc) == 0) { + Py_INCREF(Py_None); + return Py_None; + } + else { + return NULL; + } +} +#endif + + +/** the connection object **/ + + +/* object method list */ + +static struct PyMethodDef connectionObject_methods[] = { + {"cursor", (PyCFunction)psyco_conn_cursor, + METH_VARARGS|METH_KEYWORDS, psyco_conn_cursor_doc}, + {"close", (PyCFunction)psyco_conn_close, + METH_VARARGS, psyco_conn_close_doc}, + {"commit", (PyCFunction)psyco_conn_commit, + METH_VARARGS, psyco_conn_commit_doc}, + {"rollback", (PyCFunction)psyco_conn_rollback, + METH_VARARGS, psyco_conn_rollback_doc}, +#ifdef PSYCOPG_EXTENSIONS + {"set_isolation_level", (PyCFunction)psyco_conn_set_isolation_level, + METH_VARARGS, psyco_conn_set_isolation_level_doc}, + {"set_client_encoding", (PyCFunction)psyco_conn_set_client_encoding, + METH_VARARGS, psyco_conn_set_client_encoding_doc}, +#endif + {NULL} +}; + +/* object member list */ + +static struct PyMemberDef connectionObject_members[] = { + /* DBAPI-2.0 extensions (exception objects) */ + {"Error", T_OBJECT, + offsetof(connectionObject, exc_Error), RO, Error_doc}, + {"Warning", + T_OBJECT, offsetof(connectionObject, exc_Warning), RO, Warning_doc}, + {"InterfaceError", T_OBJECT, + offsetof(connectionObject, exc_InterfaceError), RO, + InterfaceError_doc}, + {"DatabaseError", T_OBJECT, + offsetof(connectionObject, exc_DatabaseError), RO, DatabaseError_doc}, + {"InternalError", T_OBJECT, + offsetof(connectionObject, exc_InternalError), RO, InternalError_doc}, + {"OperationalError", T_OBJECT, + offsetof(connectionObject, exc_OperationalError), RO, + OperationalError_doc}, + {"ProgrammingError", T_OBJECT, + offsetof(connectionObject, exc_ProgrammingError), RO, + ProgrammingError_doc}, + {"IntegrityError", T_OBJECT, + offsetof(connectionObject, exc_IntegrityError), RO, + IntegrityError_doc}, + {"DataError", T_OBJECT, + offsetof(connectionObject, exc_DataError), RO, DataError_doc}, + {"NotSupportedError", T_OBJECT, + offsetof(connectionObject, exc_NotSupportedError), RO, + NotSupportedError_doc}, +#ifdef PSYCOPG_EXTENSIONS + {"closed", T_LONG, offsetof(connectionObject, closed), RO, + "True if the connection is closed."}, + {"isolation_level", T_LONG, + offsetof(connectionObject, isolation_level), RO, + "The current isolation level."}, + {"encoding", T_STRING, offsetof(connectionObject, encoding), RO, + "The current client encoding."}, + {"notices", T_OBJECT, offsetof(connectionObject, notice_list), RO}, + {"notifies", T_OBJECT, offsetof(connectionObject, notifies), RO}, + {"dsn", T_STRING, offsetof(connectionObject, dsn), RO, + "The current connection string."}, + {"status", T_LONG, + offsetof(connectionObject, status), RO, + "The current transaction status."}, +#endif + {NULL} +}; + +/* initialization and finalization methods */ + +static int +connection_setup(connectionObject *self, char *dsn) +{ + Dprintf("connection_setup: init connection object at %p, refcnt = %d", + self, ((PyObject *)self)->ob_refcnt); + + self->dsn = strdup(dsn); + self->notice_list = PyList_New(0); + self->notifies = PyList_New(0); + self->closed = 0; + self->status = CONN_STATUS_READY; + self->critical = NULL; + self->async_cursor = NULL; + self->pgconn = NULL; + self->mark = 0; + + pthread_mutex_init(&(self->lock), NULL); + + if (conn_connect(self) != 0) { + pthread_mutex_destroy(&(self->lock)); + Dprintf("connection_init: FAILED"); + return -1; + } + + Dprintf("connection_setup: good connection object at %p, refcnt = %d", + self, ((PyObject *)self)->ob_refcnt); + return 0; +} + +static void +connection_dealloc(PyObject* obj) +{ + connectionObject *self = (connectionObject *)obj; + + if (self->closed == 0) conn_close(self); + + if (self->dsn) free(self->dsn); + if (self->encoding) PyMem_Free(self->encoding); + if (self->critical) free(self->critical); + + Py_XDECREF(self->notice_list); + Py_XDECREF(self->notifies); + Py_XDECREF(self->async_cursor); + + pthread_mutex_destroy(&(self->lock)); + + Dprintf("connection_dealloc: deleted connection object at %p, refcnt = %d", + obj, obj->ob_refcnt); + + obj->ob_type->tp_free(obj); +} + +static int +connection_init(PyObject *obj, PyObject *args, PyObject *kwds) +{ + char *dsn; + + if (!PyArg_ParseTuple(args, "s", &dsn)) + return -1; + + return connection_setup((connectionObject *)obj, dsn); +} + +static PyObject * +connection_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +{ + return type->tp_alloc(type, 0); +} + +static void +connection_del(PyObject* self) +{ + PyObject_Del(self); +} + +static PyObject * +connection_repr(connectionObject *self) +{ + return PyString_FromFormat( + "<connection object at %p; dsn: '%s', closed: %ld>", + self, self->dsn, self->closed); +} + + +/* object type */ + +#define connectionType_doc \ +"connection(dsn, ...) -> new connection object\n\n" \ +":Groups:\n" \ +" * `DBAPI-2.0 errors`: Error, Warning, InterfaceError,\n" \ +" DatabaseError, InternalError, OperationalError,\n" \ +" ProgrammingError, IntegrityError, DataError, NotSupportedError" + +PyTypeObject connectionType = { + PyObject_HEAD_INIT(NULL) + 0, + "psycopg2._psycopg.connection", + sizeof(connectionObject), + 0, + connection_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + 0, /*tp_compare*/ + (reprfunc)connection_repr, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash */ + + 0, /*tp_call*/ + (reprfunc)connection_repr, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + connectionType_doc, /*tp_doc*/ + + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + + /* Attribute descriptor and subclassing stuff */ + + connectionObject_methods, /*tp_methods*/ + connectionObject_members, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + + connection_init, /*tp_init*/ + 0, /*tp_alloc will be set to PyType_GenericAlloc in module init*/ + connection_new, /*tp_new*/ + (freefunc)connection_del, /*tp_free Low-level free-memory routine */ + 0, /*tp_is_gc For PyObject_IS_GC */ + 0, /*tp_bases*/ + 0, /*tp_mro method resolution order */ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0 /*tp_weaklist*/ +}; diff --git a/psycopg2/psycopg/cursor.h b/psycopg2/psycopg/cursor.h new file mode 100644 index 00000000..5aab172f --- /dev/null +++ b/psycopg2/psycopg/cursor.h @@ -0,0 +1,103 @@ +/* cursor.h - definition for the psycopg cursor type + * + * Copyright (C) 2003 Federico Di Gregorio <fog@debian.org> + * + * This file is part of psycopg. + * + * 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 the Free Software Foundation; either version 2, + * or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef PSYCOPG_CURSOR_H +#define PSYCOPG_CURSOR_H 1 + +#include <Python.h> +#include <libpq-fe.h> + +#include "psycopg/connection.h" + +#ifdef __cplusplus +extern "C" { +#endif + +extern PyTypeObject cursorType; + +typedef struct { + PyObject HEAD; + + connectionObject *conn; /* connection owning the cursor */ + + int closed:1; /* 1 if the cursor is closed */ + int notuples:1; /* 1 if the command was not a SELECT query */ + int needsfetch:1; /* 1 if a call to pq_fetch is pending */ + + long int rowcount; /* number of rows affected by last execute */ + long int columns; /* number of columns fetched from the db */ + long int arraysize; /* how many rows should fetchmany() return */ + long int row; /* the row counter for fetch*() operations */ + long int mark; /* transaction marker, copied from conn */ + + PyObject *description; /* read-only attribute: sequence of 7-item + sequences.*/ + + /* postgres connection stuff */ + PGresult *pgres; /* result of last query */ + PyObject *pgstatus; /* last message from the server after an execute */ + Oid lastoid; /* last oid from an insert or InvalidOid */ + + PyObject *casts; /* an array (tuple) of typecast functions */ + PyObject *caster; /* the current typecaster object */ + + PyObject *copyfile; /* file-like used during COPY TO/FROM ops */ + long int copysize; /* size of the copy buffer during COPY TO/FROM ops */ +#define DEFAULT_COPYSIZE 16384 + + PyObject *tuple_factory; /* factory for result tuples */ + PyObject *tzinfo_factory; /* factory for tzinfo objects */ + + PyObject *query; /* last query executed */ + + char *qattr; /* quoting attr, used when quoting strings */ + char *notice; /* a notice from the backend */ + char *name; /* this cursor name */ + + PyObject *string_types; /* a set of typecasters for string types */ + PyObject *binary_types; /* a set of typecasters for binary types */ + +} cursorObject; + +/* C-callable functions in cursor_int.c and cursor_ext.c */ +extern void curs_reset(cursorObject *self); + +/* exception-raising macros */ +#define EXC_IF_CURS_CLOSED(self) \ +if ((self)->closed || ((self)->conn && (self)->conn->closed)) { \ + PyErr_SetString(InterfaceError, "cursor already closed"); \ + return NULL; } + +#define EXC_IF_NO_TUPLES(self) \ +if ((self)->notuples && (self)->name == NULL) { \ + PyErr_SetString(ProgrammingError, "no results to fetch"); \ + return NULL; } + +#define EXC_IF_NO_MARK(self) \ +if ((self)->mark != (self)->conn->mark) { \ + PyErr_SetString(ProgrammingError, "named cursor isn't valid anymore"); \ + return NULL; } + +#ifdef __cplusplus +} +#endif + +#endif /* !defined(PSYCOPG_CURSOR_H) */ diff --git a/psycopg2/psycopg/cursor_int.c b/psycopg2/psycopg/cursor_int.c new file mode 100644 index 00000000..8036268b --- /dev/null +++ b/psycopg2/psycopg/cursor_int.c @@ -0,0 +1,47 @@ +/* cursor_int.c - code used by the cursor object + * + * Copyright (C) 2003 Federico Di Gregorio <fog@debian.org> + * + * This file is part of psycopg. + * + * 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 the Free Software Foundation; either version 2, + * or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include <Python.h> +#include <string.h> + +#define PSYCOPG_MODULE +#include "psycopg/config.h" +#include "psycopg/psycopg.h" +#include "psycopg/cursor.h" +#include "psycopg/pqpath.h" + +/* curs_reset - reset the cursor to a clean state */ + +void +curs_reset(cursorObject *self) +{ + /* initialize some variables to default values */ + self->notuples = 1; + self->rowcount = -1; + self->row = 0; + + Py_XDECREF(self->description); + Py_INCREF(Py_None); + self->description = Py_None; + + Py_XDECREF(self->casts); + self->casts = NULL; +} diff --git a/psycopg2/psycopg/cursor_type.c b/psycopg2/psycopg/cursor_type.c new file mode 100644 index 00000000..73e4de66 --- /dev/null +++ b/psycopg2/psycopg/cursor_type.c @@ -0,0 +1,1553 @@ +/* cursor_type.c - python interface to cursor objects + * + * Copyright (C) 2003-2004 Federico Di Gregorio <fog@debian.org> + * + * This file is part of psycopg. + * + * 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 the Free Software Foundation; either version 2, + * or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public Likcense + * along with this program; if not, write to the Free Software + * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include <Python.h> +#include <structmember.h> +#include <string.h> + +#define PSYCOPG_MODULE +#include "psycopg/config.h" +#include "psycopg/python.h" +#include "psycopg/psycopg.h" +#include "psycopg/cursor.h" +#include "psycopg/connection.h" +#include "psycopg/pqpath.h" +#include "psycopg/typecast.h" +#include "psycopg/microprotocols.h" +#include "psycopg/microprotocols_proto.h" +#include "pgversion.h" + +extern PyObject *pyPsycopgTzFixedOffsetTimezone; + + +/** DBAPI methods **/ + +/* close method - close the cursor */ + +#define psyco_curs_close_doc \ +"close() -- Close the cursor." + +static PyObject * +psyco_curs_close(cursorObject *self, PyObject *args) +{ + if (!PyArg_ParseTuple(args, "")) return NULL; + + EXC_IF_CURS_CLOSED(self); + + if (self->name != NULL) { + char buffer[128]; + + EXC_IF_NO_MARK(self); + PyOS_snprintf(buffer, 127, "CLOSE %s", self->name); + if (pq_execute(self, buffer, 0) == -1) return NULL; + } + + self->closed = 1; + Dprintf("psyco_curs_close: cursor at %p closed", self); + + Py_INCREF(Py_None); + return Py_None; +} + + +/* execute method - executes a query */ + +/* mogrify a query string and build argument array or dict */ + +static int +_mogrify(PyObject *var, PyObject *fmt, connectionObject *conn, PyObject **new) +{ + PyObject *key, *value, *n, *item; + char *d, *c; + int index = 0, force = 0; + + /* from now on we'll use n and replace its value in *new only at the end, + just before returning. we also init *new to NULL to exit with an error + if we can't complete the mogrification */ + n = *new = NULL; + c = PyString_AsString(fmt); + + while(*c) { + /* handle plain percent symbol in format string */ + if (c[0] == '%' && c[1] == '%') { + c+=2; force = 1; + } + + /* if we find '%(' then this is a dictionary, we: + 1/ find the matching ')' and extract the key name + 2/ locate the value in the dictionary (or return an error) + 3/ mogrify the value into something usefull (quoting)... + 4/ ...and add it to the new dictionary to be used as argument + */ + else if (c[0] == '%' && c[1] == '(') { + + /* let's have d point the end of the argument */ + for (d = c + 2; *d && *d != ')'; d++); + + if (*d == ')') { + key = PyString_FromStringAndSize(c+2, d-c-2); + value = PyObject_GetItem(var, key); + /* key has refcnt 1, value the original value + 1 */ + + /* if value is NULL we did not find the key (or this is not a + dictionary): let python raise a KeyError */ + if (value == NULL) { + Py_DECREF(key); /* destroy key */ + Py_XDECREF(n); /* destroy n */ + return -1; + } + + Dprintf("_mogrify: value refcnt: %d (+1)", value->ob_refcnt); + + if (n == NULL) { + n = PyDict_New(); + } + + if ((item = PyObject_GetItem(n, key)) == NULL) { + PyObject *t = NULL; + + PyErr_Clear(); + + /* None is always converted to NULL; this is an + optimization over the adapting code and can go away in + the future if somebody finds a None adapter usefull. */ + if (value == Py_None) { + t = PyString_FromString("NULL"); + PyDict_SetItem(n, key, t); + /* t is a new object, refcnt = 1, key is at 2 */ + + /* if the value is None we need to substitute the + formatting char with 's' (FIXME: this should not be + necessary if we drop support for formats other than + %s!) */ + while (*d && !isalpha(*d)) d++; + if (*d) *d = 's'; + } + else { + t = microprotocol_getquoted(value, conn); + + if (t != NULL) { + PyDict_SetItem(n, key, t); + /* both key and t refcnt +1, key is at 2 now */ + } + else { + /* no adapter found, raise a BIG exception */ + Py_XDECREF(value); + Py_DECREF(n); + return -1; + } + } + + Py_XDECREF(t); /* t dies here */ + /* after the DECREF value has the original refcnt plus 1 + if it was added to the dictionary directly; good */ + Py_XDECREF(value); + } + else { + /* we have an item with one extra refcnt here, zap! */ + Py_DECREF(item); + } + Py_DECREF(key); /* key has the original refcnt now */ + Dprintf("_mogrify: after value refcnt: %d",value->ob_refcnt); + } + c = d; + } + + else if (c[0] == '%' && c[1] != '(') { + /* this is a format that expects a tuple; it is much easier, + because we don't need to check the old/new dictionary for + keys */ + + value = PySequence_GetItem(var, index); + /* value has refcnt inc'ed by 1 here */ + + /* if value is NULL this is not a sequence or the index is wrong; + anyway we let python set its own exception */ + if (value == NULL) { + Py_XDECREF(n); + return -1; + } + + if (n == NULL) { + n = PyTuple_New(PyObject_Length(var)); + } + + /* let's have d point just after the '%' */ + d = c+1; + + if (value == Py_None) { + PyTuple_SET_ITEM(n, index, PyString_FromString("NULL")); + while (*d && !isalpha(*d)) d++; + if (*d) *d = 's'; + Py_DECREF(value); + } + else { + PyObject *t = microprotocol_getquoted(value, conn); + + if (t != NULL) { + PyTuple_SET_ITEM(n, index, t); + Py_DECREF(value); + } + else { + Py_DECREF(n); + Py_DECREF(value); + return -1; + } + } + c = d; + index += 1; + } + else { + c++; + } + } + + if (force && n == NULL) + n = PyTuple_New(0); + *new = n; + + return 0; +} + +#define psyco_curs_execute_doc \ +"execute(query, vars=None, async=0) -- Execute query with bound vars." + +static int +_psyco_curs_execute(cursorObject *self, + PyObject *operation, PyObject *vars, long int async) +{ + int res; + PyObject *fquery, *cvt = NULL, *uoperation = NULL; + + pthread_mutex_lock(&(self->conn->lock)); + if (self->conn->async_cursor != NULL + && self->conn->async_cursor != (PyObject*)self) { + pthread_mutex_unlock(&(self->conn->lock)); + psyco_set_error(ProgrammingError, (PyObject*)self, + "asynchronous query already in execution", NULL, NULL); + return 0; + } + pthread_mutex_unlock(&(self->conn->lock)); + + if (!PyObject_IsTrue(operation)) { + psyco_set_error(ProgrammingError, (PyObject*)self, + "can't execute an empty query", NULL, NULL); + return 0; + } + + if (PyUnicode_Check(operation)) { + PyObject *enc = PyDict_GetItemString(psycoEncodings, + self->conn->encoding); + /* enc is a borrowed reference, we won't decref it */ + + if (enc) { + operation = PyUnicode_AsEncodedString( + operation, PyString_AsString(enc), NULL); + + /* if there was an error during the encoding from unicode to the + target encoding we just let the exception propagate */ + if (operation == NULL) return 0; + + /* we clone operation in uoperation to be sure to free it later */ + uoperation = operation; + } + else { + PyErr_Format(InterfaceError, "can't encode unicode query to %s", + self->conn->encoding); + return 0; + } + } + else if (!PyString_Check(operation)) { + /* the operation is not unicode or string, raise an error */ + PyErr_SetString(PyExc_TypeError, + "argument 1 must be a string or unicode object"); + return 0; + } + + IFCLEARPGRES(self->pgres); + + if (self->query) { + Py_DECREF(self->query); + self->query = NULL; + } + + Dprintf("psyco_curs_execute: starting execution of new query"); + + /* here we are, and we have a sequence or a dictionary filled with + objects to be substituted (bound variables). we try to be smart and do + the right thing (i.e., what the user expects) */ + + if (vars && vars != Py_None) + { + if(_mogrify(vars, operation, self->conn, &cvt) == -1) { + Py_XDECREF(uoperation); + return 0; + } + } + + if (vars && cvt) { + /* if PyString_Format() return NULL an error occured: if the error is + a TypeError we need to check the exception.args[0] string for the + values: + + "not enough arguments for format string" + "not all arguments converted" + + and return the appropriate ProgrammingError. we do that by grabbing + the curren exception (we will later restore it if the type or the + strings do not match.) */ + + if (!(fquery = PyString_Format(operation, cvt))) { + PyObject *err, *arg, *trace; + int pe = 0; + + PyErr_Fetch(&err, &arg, &trace); + + if (err && PyErr_GivenExceptionMatches(err, PyExc_TypeError)) { + Dprintf("psyco_curs_execute: TypeError exception catched"); + PyErr_NormalizeException(&err, &arg, &trace); + + if (PyObject_HasAttrString(arg, "args")) { + PyObject *args = PyObject_GetAttrString(arg, "args"); + PyObject *str = PySequence_GetItem(args, 0); + char *s = PyString_AS_STRING(str); + + Dprintf("psyco_curs_execute: -> %s", s); + + if (!strcmp(s, "not enough arguments for format string") + || !strcmp(s, "not all arguments converted")) { + Dprintf("psyco_curs_execute: -> got a match"); + psyco_set_error(ProgrammingError, (PyObject*)self, + s, NULL, NULL); + pe = 1; + } + + Py_DECREF(args); + Py_DECREF(str); + } + } + + /* if we did not manage our own exception, restore old one */ + if (pe == 1) { + Py_XDECREF(err); Py_XDECREF(arg); Py_XDECREF(trace); + } + else { + PyErr_Restore(err, arg, trace); + } + Py_XDECREF(uoperation); + return 0; + } + + if (self->name != NULL) { + self->query = PyString_FromFormat( + "DECLARE %s CURSOR WITHOUT HOLD FOR %s", + self->name, PyString_AS_STRING(fquery)); + Py_DECREF(fquery); + } + else { + self->query = fquery; + } + + Dprintf("psyco_curs_execute: cvt->refcnt = %d", cvt->ob_refcnt); + Py_DECREF(cvt); + } + else { + if (self->name != NULL) { + self->query = PyString_FromFormat( + "DECLARE %s CURSOR WITHOUT HOLD FOR %s", + self->name, PyString_AS_STRING(operation)); + } + else { + Py_INCREF(operation); + self->query = operation; + } + } + + res = pq_execute(self, PyString_AS_STRING(self->query), async); + + Dprintf("psyco_curs_execute: res = %d, pgres = %p", res, self->pgres); + + Py_XDECREF(uoperation); + + return res == -1 ? 0 : 1; +} + +static PyObject * +psyco_curs_execute(cursorObject *self, PyObject *args, PyObject *kwargs) +{ + long int async = 0; + PyObject *vars = NULL, *operation = NULL; + + static char *kwlist[] = {"query", "vars", "async", NULL}; + + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|Oi", kwlist, + &operation, &vars, &async)) { + return NULL; + } + + if (self->name != NULL) { + if (self->query != Py_None) { + psyco_set_error(ProgrammingError, (PyObject*)self, + "can't call .execute() on named cursors more than once", + NULL, NULL); + return NULL; + } + if (self->conn->isolation_level == 0) { + psyco_set_error(ProgrammingError, (PyObject*)self, + "can't use a named cursor outside of transactions", NULL, NULL); + return NULL; + } + if (self->conn->mark != self->mark) { + psyco_set_error(ProgrammingError, (PyObject*)self, + "named cursor isn't valid anymore", NULL, NULL); + return NULL; + } + } + + EXC_IF_CURS_CLOSED(self); + + if (_psyco_curs_execute(self, operation, vars, async)) { + Py_INCREF(Py_None); + return Py_None; + } + else { + return NULL; + } +} + +#define psyco_curs_executemany_doc \ +"executemany(query, vars_list) -- Execute many queries with bound vars." + +static PyObject * +psyco_curs_executemany(cursorObject *self, PyObject *args, PyObject *kwargs) +{ + PyObject *operation = NULL, *vars = NULL; + PyObject *v, *iter = NULL; + + static char *kwlist[] = {"query", "vars_list", NULL}; + + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO", kwlist, + &operation, &vars)) { + return NULL; + } + + EXC_IF_CURS_CLOSED(self); + + if (self->name != NULL) { + psyco_set_error(ProgrammingError, (PyObject*)self, + "can't call .executemany() on named cursors", NULL, NULL); + return NULL; + } + + if (!PyIter_Check(vars)) { + vars = iter = PyObject_GetIter(vars); + if (iter == NULL) return NULL; + } + + while ((v = PyIter_Next(vars)) != NULL) { + if (_psyco_curs_execute(self, operation, v, 0) == 0) { + Py_DECREF(v); + return NULL; + } + else { + Py_DECREF(v); + } + } + Py_XDECREF(iter); + + Py_INCREF(Py_None); + return Py_None; +} + + +#ifdef PSYCOPG_EXTENSIONS +#define psyco_curs_mogrify_doc \ +"mogrify(query, vars=None) -> str -- Return query after vars binding." + +static PyObject * +psyco_curs_mogrify(cursorObject *self, PyObject *args, PyObject *kwargs) +{ + PyObject *vars = NULL, *cvt = NULL, *operation = NULL; + PyObject *fquery; + + static char *kwlist[] = {"query", "vars", NULL}; + + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|O", kwlist, + &operation, &vars)) { + return NULL; + } + + if (PyUnicode_Check(operation)) { + PyErr_SetString(NotSupportedError, + "unicode queries not yet supported"); + return NULL; + } + + EXC_IF_CURS_CLOSED(self); + IFCLEARPGRES(self->pgres); + + /* note that we don't overwrite the last query executed on the cursor, we + just *return* the new query with bound variables + + TODO: refactor the common mogrification code (see psycopg_curs_execute + for comments, the code is amost identical) */ + + if (vars) + { + if(_mogrify(vars, operation, self->conn, &cvt) == -1) return NULL; + } + + if (vars && cvt) { + if (!(fquery = PyString_Format(operation, cvt))) { + PyObject *err, *arg, *trace; + int pe = 0; + + PyErr_Fetch(&err, &arg, &trace); + + if (err && PyErr_GivenExceptionMatches(err, PyExc_TypeError)) { + Dprintf("psyco_curs_execute: TypeError exception catched"); + PyErr_NormalizeException(&err, &arg, &trace); + + if (PyObject_HasAttrString(arg, "args")) { + PyObject *args = PyObject_GetAttrString(arg, "args"); + PyObject *str = PySequence_GetItem(args, 0); + char *s = PyString_AS_STRING(str); + + Dprintf("psyco_curs_execute: -> %s", s); + + if (!strcmp(s, "not enough arguments for format string") + || !strcmp(s, "not all arguments converted")) { + Dprintf("psyco_curs_execute: -> got a match"); + psyco_set_error(ProgrammingError, (PyObject*)self, + s, NULL, NULL); + pe = 1; + } + + Py_DECREF(args); + Py_DECREF(str); + } + } + + /* if we did not manage our own exception, restore old one */ + if (pe == 1) { + Py_XDECREF(err); Py_XDECREF(arg); Py_XDECREF(trace); + } + else { + PyErr_Restore(err, arg, trace); + } + return NULL; + } + + Dprintf("psyco_curs_execute: cvt->refcnt = %d, fquery->refcnt = %d", + cvt->ob_refcnt, fquery->ob_refcnt); + Py_DECREF(cvt); + } + else { + fquery = operation; + Py_INCREF(operation); + } + + return fquery; +} +#endif + + +/* fetchone method - fetch one row of results */ + +#define psyco_curs_fetchone_doc \ +"fetchone() -> tuple or None\n\n" \ +"Return the next row of a query result set in the form of a tuple (by\n" \ +"default) or using the sequence factory previously set in the\n" \ +"`row_factory` attribute. Return `None` when no more data is available.\n" + +static int +_psyco_curs_prefetch(cursorObject *self) +{ + int i = 0; + + /* check if the fetching cursor is the one that did the asynchronous query + and raise an exception if not */ + pthread_mutex_lock(&(self->conn->lock)); + if (self->conn->async_cursor != NULL + && self->conn->async_cursor != (PyObject*)self) { + pthread_mutex_unlock(&(self->conn->lock)); + psyco_set_error(ProgrammingError, (PyObject*)self, + "asynchronous fetch by wrong cursor", NULL, NULL); + return -2; + } + pthread_mutex_unlock(&(self->conn->lock)); + + if (self->pgres == NULL || self->needsfetch) { + self->needsfetch = 0; + Dprintf("_psyco_curs_prefetch: trying to fetch data"); + do { + i = pq_fetch(self); + Dprintf("_psycopg_curs_prefetch: result = %d", i); + } while(i == 1); + } + + Dprintf("_psyco_curs_prefetch: result = %d", i); + return i; +} + +static PyObject * +_psyco_curs_buildrow_fill(cursorObject *self, PyObject *res, + int row, int n, int istuple) +{ + int i, len; + unsigned char *str; + PyObject *val; + + for (i=0; i < n; i++) { + if (PQgetisnull(self->pgres, row, i)) { + str = NULL; + len = 0; + } + else { + str = (unsigned char*)PQgetvalue(self->pgres, row, i); + len = PQgetlength(self->pgres, row, i); + } + + Dprintf("_psyco_curs_buildrow: row %ld, element %d, len %i", + self->row, i, len); + + val = typecast_cast(PyTuple_GET_ITEM(self->casts, i), (char*)str, len, + (PyObject*)self); + + if (val) { + Dprintf("_psyco_curs_buildrow: val->refcnt = %d", val->ob_refcnt); + if (istuple) { + PyTuple_SET_ITEM(res, i, val); + } + else { + PySequence_SetItem(res, i, val); + Py_DECREF(val); + } + } + else { + /* an error occurred in the type system, we return NULL to raise + an exception. the typecast code should already have set the + exception type and text */ + Py_DECREF(res); + res = NULL; + break; + } + } + return res; +} + +static PyObject * +_psyco_curs_buildrow(cursorObject *self, int row) +{ + int n; + + n = PQnfields(self->pgres); + return _psyco_curs_buildrow_fill(self, PyTuple_New(n), row, n, 1); +} + +static PyObject * +_psyco_curs_buildrow_with_factory(cursorObject *self, int row) +{ + int n; + PyObject *res; + + n = PQnfields(self->pgres); + if ((res = PyObject_CallFunction(self->tuple_factory, "O", self))== NULL) + return NULL; + + return _psyco_curs_buildrow_fill(self, res, row, n, 0); +} + +PyObject * +psyco_curs_fetchone(cursorObject *self, PyObject *args) +{ + PyObject *res; + + if (args && !PyArg_ParseTuple(args, "")) return NULL; + + EXC_IF_CURS_CLOSED(self) + if (_psyco_curs_prefetch(self) < 0) return NULL; + EXC_IF_NO_TUPLES(self); + + if (self->name != NULL) { + char buffer[128]; + + EXC_IF_NO_MARK(self); + PyOS_snprintf(buffer, 127, "FETCH FORWARD 1 FROM %s", self->name); + if (pq_execute(self, buffer, 0) == -1) return NULL; + if (_psyco_curs_prefetch(self) < 0) return NULL; + } + + Dprintf("psyco_curs_fetchone: fetching row %ld", self->row); + Dprintf("psyco_curs_fetchone: rowcount = %ld", self->rowcount); + + if (self->row >= self->rowcount) { + /* we exausted available data: return None */ + Py_INCREF(Py_None); + return Py_None; + } + + if (self->tuple_factory == Py_None) + res = _psyco_curs_buildrow(self, self->row); + else + res = _psyco_curs_buildrow_with_factory(self, self->row); + + self->row++; /* move the counter to next line */ + + /* if the query was async aggresively free pgres, to allow + successive requests to reallocate it */ + if (self->row >= self->rowcount + && self->conn->async_cursor == (PyObject*)self) + IFCLEARPGRES(self->pgres); + + return res; +} + + +/* fetch many - fetch some results */ + +#define psyco_curs_fetchmany_doc \ +"fetchmany(size=self.arraysize) -> list of tuple\n\n" \ +"Return the next `size` rows of a query result set in the form of a list\n" \ +"of tuples (by default) or using the sequence factory previously set in\n" \ +"the `row_factory` attribute. Return `None` when no more data is available.\n" + +PyObject * +psyco_curs_fetchmany(cursorObject *self, PyObject *args, PyObject *kwords) +{ + int i; + PyObject *list, *res; + + long int size = self->arraysize; + static char *kwlist[] = {"size", NULL}; + + if (!PyArg_ParseTupleAndKeywords(args, kwords, "|l", kwlist, &size)) { + return NULL; + } + + EXC_IF_CURS_CLOSED(self); + if (_psyco_curs_prefetch(self) < 0) return NULL; + EXC_IF_NO_TUPLES(self); + + if (self->name != NULL) { + char buffer[128]; + + EXC_IF_NO_MARK(self); + PyOS_snprintf(buffer, 127, "FETCH FORWARD %d FROM %s", + (int)size, self->name); + if (pq_execute(self, buffer, 0) == -1) return NULL; + if (_psyco_curs_prefetch(self) < 0) return NULL; + } + + /* make sure size is not > than the available number of rows */ + if (size > self->rowcount - self->row || size < 0) { + size = self->rowcount - self->row; + } + + Dprintf("psyco_curs_fetchmany: size = %ld", size); + + if (size <= 0) { + return PyList_New(0); + } + + list = PyList_New(size); + + for (i = 0; i < size; i++) { + if (self->tuple_factory == Py_None) + res = _psyco_curs_buildrow(self, self->row); + else + res = _psyco_curs_buildrow_with_factory(self, self->row); + + self->row++; + + if (res == NULL) { + Py_DECREF(list); + return NULL; + } + + PyList_SET_ITEM(list, i, res); + } + + /* if the query was async aggresively free pgres, to allow + successive requests to reallocate it */ + if (self->row >= self->rowcount + && self->conn->async_cursor == (PyObject*)self) + IFCLEARPGRES(self->pgres); + + return list; +} + + +/* fetch all - fetch all results */ + +#define psyco_curs_fetchall_doc \ +"fetchall() -> list of tuple\n\n" \ +"Return all the remaining rows of a query result set.\n\n" \ +"Rows are returned in the form of a list of tuples (by default) or using\n" \ +"the sequence factory previously set in the `row_factory` attribute.\n" \ +"Return `None` when no more data is available.\n" + +PyObject * +psyco_curs_fetchall(cursorObject *self, PyObject *args) +{ + int i, size; + PyObject *list, *res; + + if (!PyArg_ParseTuple(args, "")) { + return NULL; + } + + EXC_IF_CURS_CLOSED(self); + if (_psyco_curs_prefetch(self) < 0) return NULL; + EXC_IF_NO_TUPLES(self); + + if (self->name != NULL) { + char buffer[128]; + + EXC_IF_NO_MARK(self); + PyOS_snprintf(buffer, 127, "FETCH FORWARD ALL FROM %s", self->name); + if (pq_execute(self, buffer, 0) == -1) return NULL; + if (_psyco_curs_prefetch(self) < 0) return NULL; + } + + size = self->rowcount - self->row; + + if (size <= 0) { + return PyList_New(0); + } + + list = PyList_New(size); + + for (i = 0; i < size; i++) { + if (self->tuple_factory == Py_None) + res = _psyco_curs_buildrow(self, self->row); + else + res = _psyco_curs_buildrow_with_factory(self, self->row); + + self->row++; + + if (res == NULL) { + Py_DECREF(list); + return NULL; + } + + PyList_SET_ITEM(list, i, res); + } + + /* if the query was async aggresively free pgres, to allow + successive requests to reallocate it */ + if (self->row >= self->rowcount + && self->conn->async_cursor == (PyObject*)self) + IFCLEARPGRES(self->pgres); + + return list; +} + + +/* callproc method - execute a stored procedure */ + +#define psyco_curs_callproc_doc \ +"callproc(procname, parameters=None, async=0) -- Execute stored procedure." + +static PyObject * +psyco_curs_callproc(cursorObject *self, PyObject *args, PyObject *kwargs) +{ + char *procname = NULL, *sql = NULL; + long int async = 0; + int i, nparameters = 0, sl = 0; + PyObject *parameters = NULL; + PyObject *operation = NULL; + PyObject *res = NULL; + + if (!PyArg_ParseTuple(args, "s|Oi", &procname, ¶meters, &async)) { + return NULL; + } + + EXC_IF_CURS_CLOSED(self); + + if (self->name != NULL) { + psyco_set_error(ProgrammingError, (PyObject*)self, + "can't call .callproc() on named cursors", NULL, NULL); + return NULL; + } + + if(parameters && parameters != Py_None) { + nparameters = PyObject_Length(parameters); + if (nparameters < 0) nparameters = 0; + } + + /* allocate some memory, build the SQL and create a PyString from it */ + sl = strlen(procname) + 10 + nparameters*3 - (nparameters ? 1 : 0); + sql = (char*)PyMem_Malloc(sl); + if (sql == NULL) return NULL; + + sprintf(sql, "SELECT %s(", procname); + for(i=0; i<nparameters; i++) { + strcat(sql, "%s,"); + } + sql[sl-2] = ')'; + sql[sl-1] = '\0'; + + operation = PyString_FromString(sql); + PyMem_Free((void*)sql); + + if (_psyco_curs_execute(self, operation, parameters, async)) { + Py_INCREF(Py_None); + res = Py_None; + } + + Py_DECREF(operation); + return res; +} + + +/* nextset method - return the next set of data (not supported) */ + +#define psyco_curs_nextset_doc \ +"nextset() -- Skip to next set of data.\n\n" \ +"This method is not supported (PostgreSQL does not have multiple data \n" \ +"sets) and will raise a NotSupportedError exception." + +static PyObject * +psyco_curs_nextset(cursorObject *self, PyObject *args) +{ + if (!PyArg_ParseTuple(args, "")) return NULL; + + EXC_IF_CURS_CLOSED(self); + + PyErr_SetString(NotSupportedError, "not supported by PostgreSQL"); + return NULL; +} + + +/* setinputsizes - predefine memory areas for execute (does nothing) */ + +#define psyco_curs_setinputsizes_doc \ +"setinputsizes(sizes) -- Set memory areas before execute.\n\n" \ +"This method currently does nothing but it is safe to call it." + +static PyObject * +psyco_curs_setinputsizes(cursorObject *self, PyObject *args) +{ + PyObject *sizes; + + if (!PyArg_ParseTuple(args, "O", &sizes)) + return NULL; + + EXC_IF_CURS_CLOSED(self); + + Py_INCREF(Py_None); + return Py_None; +} + + +/* setoutputsize - predefine memory areas for execute (does nothing) */ + +#define psyco_curs_setoutputsize_doc \ +"setoutputsize(size, column=None) -- Set column buffer size.\n\n" \ +"This method currently does nothing but it is safe to call it." + +static PyObject * +psyco_curs_setoutputsize(cursorObject *self, PyObject *args) +{ + long int size, column; + + if (!PyArg_ParseTuple(args, "l|l", &size, &column)) + return NULL; + + EXC_IF_CURS_CLOSED(self); + + Py_INCREF(Py_None); + return Py_None; +} + + +/* scroll - scroll position in result list */ + +#define psyco_curs_scroll_doc \ +"scroll(value, mode='relative') -- Scroll to new position according to mode." + +static PyObject * +psyco_curs_scroll(cursorObject *self, PyObject *args, PyObject *kwargs) +{ + int value, newpos; + char *mode = "relative"; + + static char *kwlist[] = {"value", "mode", NULL}; + + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i|s", + kwlist, &value, &mode)) + return NULL; + + EXC_IF_CURS_CLOSED(self); + + /* if the cursor is not named we have the full result set and we can do + our own calculations to scroll; else we just delegate the scrolling + to the MOVE SQL statement */ + if (self->name == NULL) { + if (strcmp(mode, "relative") == 0) { + newpos = self->row + value; + } else if (strcmp( mode, "absolute") == 0) { + newpos = value; + } else { + psyco_set_error(ProgrammingError, (PyObject*)self, + "scroll mode must be 'relative' or 'absolute'", NULL, NULL); + return NULL; + } + + if (newpos < 0 || newpos >= self->rowcount ) { + psyco_set_error(ProgrammingError, (PyObject*)self, + "scroll destination out of bounds", NULL, NULL); + return NULL; + } + + self->row = newpos; + } + + else { + char buffer[128]; + + EXC_IF_NO_MARK(self); + + if (strcmp(mode, "absolute") == 0) { + PyOS_snprintf(buffer, 127, "MOVE ABSOLUTE %d FROM %s", + value, self->name); + } + else { + PyOS_snprintf(buffer, 127, "MOVE %d FROM %s", value, self->name); + } + if (pq_execute(self, buffer, 0) == -1) return NULL; + if (_psyco_curs_prefetch(self) < 0) return NULL; + } + + Py_INCREF(Py_None); + return Py_None; +} + + +#ifdef PSYCOPG_EXTENSIONS + +/* extension: copy_from - implements COPY FROM */ + +#define psyco_curs_copy_from_doc \ +"copy_from(file, table, sep='\\t', null='\\N', columns=None) -- Copy table from file." + +static int +_psyco_curs_has_read_check(PyObject* o, void* var) +{ + if (PyObject_HasAttrString(o, "readline") + && PyObject_HasAttrString(o, "read")) { + Py_INCREF(o); + *((PyObject**)var) = o; + return 1; + } + else { + PyErr_SetString(PyExc_TypeError, + "argument 1 must have both .read() and .readline() methods"); + return 0; + } +} + +static PyObject * +psyco_curs_copy_from(cursorObject *self, PyObject *args, PyObject *kwargs) +{ + char query[1024]; + char *table_name; + char *sep = "\t", *null = NULL; + long int bufsize = DEFAULT_COPYSIZE; + PyObject *file, *columns = NULL, *res = NULL; + char columnlist[1024] = ""; + + static char *kwlist[] = {"file", "table", "sep", "null", "size", + "columns", NULL}; + + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&s|ssiO", kwlist, + _psyco_curs_has_read_check, &file, + &table_name, &sep, &null, &bufsize, + &columns)) { + return NULL; + } + + if (columns != NULL && columns != Py_None) { + PyObject* collistiter = PyObject_GetIter(columns); + PyObject* col; + int collistlen = 2; + int colitemlen; + char* colname; + if (collistiter == NULL) { + return NULL; + } + strcpy(columnlist, " ("); + while ((col = PyIter_Next(collistiter)) != NULL) { + if (!PyString_Check(col)) { + Py_DECREF(col); + Py_DECREF(collistiter); + PyErr_SetString(PyExc_ValueError, + "Elements in column list must be strings"); + return NULL; + } + PyString_AsStringAndSize(col, &colname, &colitemlen); + if (collistlen + colitemlen > 1022) { + Py_DECREF(col); + Py_DECREF(collistiter); + PyErr_SetString(PyExc_ValueError, "Column list too long"); + return NULL; + } + strncpy(&columnlist[collistlen], colname, colitemlen); + collistlen += colitemlen; + columnlist[collistlen++] = ','; + Py_DECREF(col); + } + Py_DECREF(collistiter); + + if (collistlen == 2) { /* empty list; we printed no comma */ + collistlen++; + } + + columnlist[collistlen - 1] = ')'; + columnlist[collistlen] = '\0'; + } + + if (PyErr_Occurred()) { + return NULL; + } + + EXC_IF_CURS_CLOSED(self); + + if (null) { + PyOS_snprintf(query, 1023, "COPY %s%s FROM stdin USING DELIMITERS '%s'" + " WITH NULL AS '%s'", table_name, columnlist, sep, null); + } + else { + PyOS_snprintf(query, 1023, "COPY %s%s FROM stdin USING DELIMITERS '%s'", + table_name, columnlist, sep); + } + Dprintf("psyco_curs_copy_from: query = %s", query); + + self->copysize = bufsize; + self->copyfile = file; + + if (pq_execute(self, query, 0) == 1) { + res = Py_None; + Py_INCREF(Py_None); + } + + self->copyfile =NULL; + + return res; +} + +#define psyco_curs_copy_to_doc \ +"copy_to(file, table, sep='\\t', null='\\N') -- Copy table to file." + +static int +_psyco_curs_has_write_check(PyObject* o, void* var) +{ + if (PyObject_HasAttrString(o, "write")) { + Py_INCREF(o); + *((PyObject**)var) = o; + return 1; + } + else { + PyErr_SetString(PyExc_TypeError, + "argument 1 must have a .write() method"); + return 0; + } +} + +static PyObject * +psyco_curs_copy_to(cursorObject *self, PyObject *args, PyObject *kwargs) +{ + char query[256]; + char *table_name; + char *sep = "\t", *null = NULL; + PyObject *file, *res = NULL; + + static char *kwlist[] = {"file", "table", "sep", "null", NULL}; + + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&s|ss", kwlist, + _psyco_curs_has_write_check, &file, + &table_name, &sep, &null)) { + return NULL; + } + + EXC_IF_CURS_CLOSED(self); + + if (null) { + PyOS_snprintf(query, 255, "COPY %s TO stdout USING DELIMITERS '%s'" + " WITH NULL AS '%s'", table_name, sep, null); + } + else { + PyOS_snprintf(query, 255, "COPY %s TO stdout USING DELIMITERS '%s'", + table_name, sep); + } + + self->copysize = 0; + self->copyfile = file; + + if (pq_execute(self, query, 0) == 1) { + res = Py_None; + Py_INCREF(Py_None); + } + + self->copyfile = NULL; + + return res; +} +/* extension: fileno - return the file descripor of the connection */ + +#define psyco_curs_fileno_doc \ +"fileno() -> int -- Return file descriptor associated to database connection." + +static PyObject * +psyco_curs_fileno(cursorObject *self, PyObject *args) +{ + long int socket; + + if (!PyArg_ParseTuple(args, "")) return NULL; + EXC_IF_CURS_CLOSED(self); + + /* note how we call PQflush() to make sure the user will use + select() in the safe way! */ + pthread_mutex_lock(&(self->conn->lock)); + Py_BEGIN_ALLOW_THREADS; + PQflush(self->conn->pgconn); + socket = (long int)PQsocket(self->conn->pgconn); + Py_END_ALLOW_THREADS; + pthread_mutex_unlock(&(self->conn->lock)); + + return PyInt_FromLong(socket); +} + +/* extension: isready - return true if data from async execute is ready */ + +#define psyco_curs_isready_doc \ +"isready() -> bool -- Return True if data is ready after an async query." + +static PyObject * +psyco_curs_isready(cursorObject *self, PyObject *args) +{ + if (!PyArg_ParseTuple(args, "")) return NULL; + EXC_IF_CURS_CLOSED(self); + + /* pq_is_busy does its own locking, we don't need anything special but if + the cursor is ready we need to fetch the result and free the connection + for the next query. */ + + if (pq_is_busy(self->conn)) { + Py_INCREF(Py_False); + return Py_False; + } + else { + IFCLEARPGRES(self->pgres); + pthread_mutex_lock(&(self->conn->lock)); + self->pgres = PQgetResult(self->conn->pgconn); + self->conn->async_cursor = NULL; + pthread_mutex_unlock(&(self->conn->lock)); + self->needsfetch = 1; + Py_INCREF(Py_True); + return Py_True; + } +} + +#endif + + +/** the cursor object **/ + +/* iterator protocol */ + +static PyObject * +cursor_iter(PyObject *self) +{ + EXC_IF_CURS_CLOSED((cursorObject*)self); + Py_INCREF(self); + return self; +} + +static PyObject * +cursor_next(PyObject *self) +{ + PyObject *res; + + /* we don't parse arguments: psyco_curs_fetchone will do that for us */ + res = psyco_curs_fetchone((cursorObject*)self, NULL); + + /* convert a None to NULL to signal the end of iteration */ + if (res && res == Py_None) { + Py_DECREF(res); + res = NULL; + } + return res; +} + +/* object method list */ + +static struct PyMethodDef cursorObject_methods[] = { + /* DBAPI-2.0 core */ + {"close", (PyCFunction)psyco_curs_close, + METH_VARARGS, psyco_curs_close_doc}, + {"execute", (PyCFunction)psyco_curs_execute, + METH_VARARGS|METH_KEYWORDS, psyco_curs_execute_doc}, + {"executemany", (PyCFunction)psyco_curs_executemany, + METH_VARARGS|METH_KEYWORDS, psyco_curs_executemany_doc}, + {"fetchone", (PyCFunction)psyco_curs_fetchone, + METH_VARARGS, psyco_curs_fetchone_doc}, + {"fetchmany", (PyCFunction)psyco_curs_fetchmany, + METH_VARARGS|METH_KEYWORDS, psyco_curs_fetchmany_doc}, + {"fetchall", (PyCFunction)psyco_curs_fetchall, + METH_VARARGS, psyco_curs_fetchall_doc}, + {"callproc", (PyCFunction)psyco_curs_callproc, + METH_VARARGS, psyco_curs_callproc_doc}, + {"nextset", (PyCFunction)psyco_curs_nextset, + METH_VARARGS, psyco_curs_nextset_doc}, + {"setinputsizes", (PyCFunction)psyco_curs_setinputsizes, + METH_VARARGS, psyco_curs_setinputsizes_doc}, + {"setoutputsize", (PyCFunction)psyco_curs_setoutputsize, + METH_VARARGS, psyco_curs_setoutputsize_doc}, + /* DBAPI-2.0 extensions */ + {"scroll", (PyCFunction)psyco_curs_scroll, + METH_VARARGS|METH_KEYWORDS, psyco_curs_scroll_doc}, + /* psycopg extensions */ +#ifdef PSYCOPG_EXTENSIONS + {"mogrify", (PyCFunction)psyco_curs_mogrify, + METH_VARARGS|METH_KEYWORDS, psyco_curs_mogrify_doc}, + {"fileno", (PyCFunction)psyco_curs_fileno, + METH_VARARGS, psyco_curs_fileno_doc}, + {"isready", (PyCFunction)psyco_curs_isready, + METH_VARARGS, psyco_curs_isready_doc}, + {"copy_from", (PyCFunction)psyco_curs_copy_from, + METH_VARARGS|METH_KEYWORDS, psyco_curs_copy_from_doc}, + {"copy_to", (PyCFunction)psyco_curs_copy_to, + METH_VARARGS|METH_KEYWORDS, psyco_curs_copy_to_doc}, +#endif + {NULL} +}; + +/* object member list */ + +#define OFFSETOF(x) offsetof(cursorObject, x) + +static struct PyMemberDef cursorObject_members[] = { + /* DBAPI-2.0 basics */ + {"rowcount", T_LONG, OFFSETOF(rowcount), RO, + "Number of rows read from the backend in the last command."}, + {"arraysize", T_LONG, OFFSETOF(arraysize), 0, + "Number of records `fetchmany()` must fetch if not explicitely " \ + "specified."}, + {"description", T_OBJECT, OFFSETOF(description), RO, + "Cursor description as defined in DBAPI-2.0."}, + {"lastrowid", T_LONG, OFFSETOF(lastoid), RO, + "The ``oid`` of the last row inserted by the cursor."}, + /* DBAPI-2.0 extensions */ + {"rownumber", T_LONG, OFFSETOF(row), RO, + "The current row position."}, + {"connection", T_OBJECT, OFFSETOF(conn), RO, + "The connection where the cursor comes from."}, +#ifdef PSYCOPG_EXTENSIONS + {"name", T_STRING, OFFSETOF(name), RO}, + {"statusmessage", T_OBJECT, OFFSETOF(pgstatus), RO, + "The return message of the last command."}, + {"query", T_OBJECT, OFFSETOF(query), RO, + "The last query text sent to the backend."}, + {"row_factory", T_OBJECT, OFFSETOF(tuple_factory), 0}, + {"tzinfo_factory", T_OBJECT, OFFSETOF(tzinfo_factory), 0}, + {"typecaster", T_OBJECT, OFFSETOF(caster), RO}, + {"string_types", T_OBJECT, OFFSETOF(string_types), 0}, + {"binary_types", T_OBJECT, OFFSETOF(binary_types), 0}, +#endif + {NULL} +}; + +/* initialization and finalization methods */ + +static int +cursor_setup(cursorObject *self, connectionObject *conn, char *name) +{ + Dprintf("cursor_setup: init cursor object at %p", self); + Dprintf("cursor_setup: parameters: name = %s, conn = %p", name, conn); + + if (name) { + self->name = PyMem_Malloc(strlen(name)+1); + if (self->name == NULL) return 1; + strncpy(self->name, name, strlen(name)+1); + } + + /* FIXME: why does this raise an excpetion on the _next_ line of code? + if (PyObject_IsInstance((PyObject*)conn, + (PyObject *)&connectionType) == 0) { + PyErr_SetString(PyExc_TypeError, + "argument 1 must be subclass of psycopg2._psycopg.connection"); + return 1; + } */ + self->conn = conn; + Py_INCREF((PyObject*)self->conn); + + self->closed = 0; + self->mark = conn->mark; + self->pgres = NULL; + self->notuples = 1; + self->arraysize = 1; + self->rowcount = -1; + self->lastoid = InvalidOid; + + self->casts = NULL; + self->notice = NULL; + + self->string_types = NULL; + self->binary_types = NULL; + + self->description = Py_None; + Py_INCREF(Py_None); + self->pgstatus = Py_None; + Py_INCREF(Py_None); + self->tuple_factory = Py_None; + Py_INCREF(Py_None); + self->query = Py_None; + Py_INCREF(Py_None); + + /* default tzinfo factory */ + self->tzinfo_factory = pyPsycopgTzFixedOffsetTimezone; + Py_INCREF(self->tzinfo_factory); + + Dprintf("cursor_setup: good cursor object at %p, refcnt = %d", + self, ((PyObject *)self)->ob_refcnt); + return 0; +} + +static void +cursor_dealloc(PyObject* obj) +{ + cursorObject *self = (cursorObject *)obj; + + if (self->name) PyMem_Free(self->name); + + Py_XDECREF((PyObject*)self->conn); + Py_XDECREF(self->casts); + Py_XDECREF(self->description); + Py_XDECREF(self->pgstatus); + Py_XDECREF(self->tuple_factory); + Py_XDECREF(self->tzinfo_factory); + Py_XDECREF(self->query); + + IFCLEARPGRES(self->pgres); + + Dprintf("cursor_dealloc: deleted cursor object at %p, refcnt = %d", + obj, obj->ob_refcnt); + + obj->ob_type->tp_free(obj); +} + +static int +cursor_init(PyObject *obj, PyObject *args, PyObject *kwds) +{ + char *name = NULL; + PyObject *conn; + + if (!PyArg_ParseTuple(args, "O|s", &conn, &name)) + return -1; + + return cursor_setup((cursorObject *)obj, (connectionObject *)conn, name); +} + +static PyObject * +cursor_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +{ + return type->tp_alloc(type, 0); +} + +static void +cursor_del(PyObject* self) +{ + PyObject_Del(self); +} + +static PyObject * +cursor_repr(cursorObject *self) +{ + return PyString_FromFormat( + "<cursor object at %p; closed: %d>", self, self->closed); +} + + +/* object type */ + +#define cursorType_doc \ +"A database cursor." + +PyTypeObject cursorType = { + PyObject_HEAD_INIT(NULL) + 0, + "psycopg2._psycopg.cursor", + sizeof(cursorObject), + 0, + cursor_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + 0, /*tp_compare*/ + (reprfunc)cursor_repr, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash */ + + 0, /*tp_call*/ + (reprfunc)cursor_repr, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_ITER, /*tp_flags*/ + cursorType_doc, /*tp_doc*/ + + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + + cursor_iter, /*tp_iter*/ + cursor_next, /*tp_iternext*/ + + /* Attribute descriptor and subclassing stuff */ + + cursorObject_methods, /*tp_methods*/ + cursorObject_members, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + + cursor_init, /*tp_init*/ + 0, /*tp_alloc Will be set to PyType_GenericAlloc in module init*/ + cursor_new, /*tp_new*/ + (freefunc)cursor_del, /*tp_free Low-level free-memory routine */ + 0, /*tp_is_gc For PyObject_IS_GC */ + 0, /*tp_bases*/ + 0, /*tp_mro method resolution order */ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0 /*tp_weaklist*/ +}; diff --git a/psycopg2/psycopg/microprotocols.c b/psycopg2/psycopg/microprotocols.c new file mode 100644 index 00000000..73abbfc7 --- /dev/null +++ b/psycopg2/psycopg/microprotocols.c @@ -0,0 +1,161 @@ +/* microprotocols.c - minimalist and non-validating protocols implementation + * + * Copyright (C) 2003-2004 Federico Di Gregorio <fog@debian.org> + * + * This file is part of psycopg. + * + * 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 the Free Software Foundation; either version 2, + * or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include <Python.h> +#include <structmember.h> + +#define PSYCOPG_MODULE +#include "psycopg/config.h" +#include "psycopg/python.h" +#include "psycopg/psycopg.h" +#include "psycopg/cursor.h" +#include "psycopg/connection.h" +#include "psycopg/microprotocols.h" +#include "psycopg/microprotocols_proto.h" + + +/** the adapters registry **/ + +PyObject *psyco_adapters; + +/* microprotocols_init - initialize the adapters dictionary */ + +int +microprotocols_init(PyObject *dict) +{ + /* create adapters dictionary and put it in module namespace */ + if ((psyco_adapters = PyDict_New()) == NULL) { + return -1; + } + + PyDict_SetItemString(dict, "adapters", psyco_adapters); + + return 0; +} + + +/* microprotocols_add - add a reverse type-caster to the dictionary */ + +int +microprotocols_add(PyTypeObject *type, PyObject *proto, PyObject *cast) +{ + if (proto == NULL) proto = (PyObject*)&isqlquoteType; + + Dprintf("microprotocols_add: cast %p for (%s, ?)", cast, type->tp_name); + + PyDict_SetItem(psyco_adapters, + Py_BuildValue("(OO)", (PyObject*)type, proto), + cast); + return 0; +} + +/* microprotocols_adapt - adapt an object to the built-in protocol */ + +PyObject * +microprotocols_adapt(PyObject *obj, PyObject *proto, PyObject *alt) +{ + PyObject *adapter, *key; + + /* we don't check for exact type conformance as specified in PEP 246 + because the ISQLQuote type is abstract and there is no way to get a + quotable object to be its instance */ + + Dprintf("microprotocols_adapt: trying to adapt %s", obj->ob_type->tp_name); + + /* look for an adapter in the registry */ + key = Py_BuildValue("(OO)", (PyObject*)obj->ob_type, proto); + adapter = PyDict_GetItem(psyco_adapters, key); + Py_DECREF(key); + if (adapter) { + PyObject *adapted = PyObject_CallFunctionObjArgs(adapter, obj, NULL); + return adapted; + } + + /* try to have the protocol adapt this object*/ + if (PyObject_HasAttrString(proto, "__adapt__")) { + PyObject *adapted = PyObject_CallMethod(proto, "__adapt__", "O", obj); + if (adapted && adapted != Py_None) return adapted; + Py_XDECREF(adapted); + if (PyErr_Occurred() && !PyErr_ExceptionMatches(PyExc_TypeError)) + return NULL; + } + + /* and finally try to have the object adapt itself */ + if (PyObject_HasAttrString(obj, "__conform__")) { + PyObject *adapted = PyObject_CallMethod(obj, "__conform__","O", proto); + if (adapted && adapted != Py_None) return adapted; + Py_XDECREF(adapted); + if (PyErr_Occurred() && !PyErr_ExceptionMatches(PyExc_TypeError)) + return NULL; + } + + /* else set the right exception and return NULL */ + psyco_set_error(ProgrammingError, NULL, "can't adapt", NULL, NULL); + return NULL; +} + +/* microprotocol_getquoted - utility function that adapt and call getquoted */ + +PyObject * +microprotocol_getquoted(PyObject *obj, connectionObject *conn) +{ + PyObject *res = NULL; + PyObject *tmp = microprotocols_adapt( + obj, (PyObject*)&isqlquoteType, NULL); + + if (tmp != NULL) { + Dprintf("microprotocol_getquoted: adapted to %s", + tmp->ob_type->tp_name); + + /* if requested prepare the object passing it the connection */ + if (PyObject_HasAttrString(tmp, "prepare") && conn) { + res = PyObject_CallMethod(tmp, "prepare", "O", (PyObject*)conn); + if (res == NULL) { + Py_DECREF(tmp); + return NULL; + } + else { + Py_DECREF(res); + } + } + + /* call the getquoted method on tmp (that should exist because we + adapted to the right protocol) */ + res = PyObject_CallMethod(tmp, "getquoted", NULL); + Py_DECREF(tmp); + } + + /* we return res with one extra reference, the caller shall free it */ + return res; +} + + +/** module-level functions **/ + +PyObject * +psyco_microprotocols_adapt(cursorObject *self, PyObject *args) +{ + PyObject *obj, *alt = NULL; + PyObject *proto = (PyObject*)&isqlquoteType; + + if (!PyArg_ParseTuple(args, "O|OO", &obj, &proto, &alt)) return NULL; + return microprotocols_adapt(obj, proto, alt); +} diff --git a/psycopg2/psycopg/microprotocols.h b/psycopg2/psycopg/microprotocols.h new file mode 100644 index 00000000..5501a7c6 --- /dev/null +++ b/psycopg2/psycopg/microprotocols.h @@ -0,0 +1,60 @@ +/* microprotocols.c - definitions for minimalist and non-validating protocols + * + * Copyright (C) 2003-2004 Federico Di Gregorio <fog@debian.org> + * + * This file is part of psycopg. + * + * 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 the Free Software Foundation; either version 2, + * or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef PSYCOPG_MICROPROTOCOLS_H +#define PSYCOPG_MICROPROTOCOLS_H 1 + +#include <Python.h> +#include "psycopg/connection.h" +#include "psycopg/cursor.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** adapters registry **/ + +extern PyObject *psyco_adapters; + +/** the names of the three mandatory methods **/ + +#define MICROPROTOCOLS_GETQUOTED_NAME "getquoted" +#define MICROPROTOCOLS_GETSTRING_NAME "getstring" +#define MICROPROTOCOLS_GETBINARY_NAME "getbinary" + +/** exported functions **/ + +/* used by module.c to init the microprotocols system */ +extern int microprotocols_init(PyObject *dict); +extern int microprotocols_add( + PyTypeObject *type, PyObject *proto, PyObject *cast); + +extern PyObject *microprotocols_adapt( + PyObject *obj, PyObject *proto, PyObject *alt); +extern PyObject *microprotocol_getquoted( + PyObject *obj, connectionObject *conn); + +extern PyObject * + psyco_microprotocols_adapt(cursorObject *self, PyObject *args); +#define psyco_microprotocols_adapt_doc \ + "adapt(obj, protocol, alternate) -> object -- adapt obj to given protocol" + +#endif /* !defined(PSYCOPG_MICROPROTOCOLS_H) */ diff --git a/psycopg2/psycopg/microprotocols_proto.c b/psycopg2/psycopg/microprotocols_proto.c new file mode 100644 index 00000000..72c3a7eb --- /dev/null +++ b/psycopg2/psycopg/microprotocols_proto.c @@ -0,0 +1,216 @@ +/* microprotocol_proto.c - psycopg protocols + * + * Copyright (C) 2003 Federico Di Gregorio <fog@debian.org> + * + * This file is part of psycopg. + * + * 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 the Free Software Foundation; either version 2, + * or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include <Python.h> +#include <structmember.h> +#include <stringobject.h> + +#include <string.h> + +#define PSYCOPG_MODULE +#include "psycopg/config.h" +#include "psycopg/python.h" +#include "psycopg/psycopg.h" +#include "psycopg/microprotocols_proto.h" + + +/** void protocol implementation **/ + + +/* getquoted - return quoted representation for object */ + +#define psyco_isqlquote_getquoted_doc \ +"getquoted() -- return SQL-quoted representation of this object" + +static PyObject * +psyco_isqlquote_getquoted(isqlquoteObject *self, PyObject *args) +{ + if (!PyArg_ParseTuple(args, "")) return NULL; + + Py_INCREF(Py_None); + return Py_None; +} + +/* getbinary - return quoted representation for object */ + +#define psyco_isqlquote_getbinary_doc \ +"getbinary() -- return SQL-quoted binary representation of this object" + +static PyObject * +psyco_isqlquote_getbinary(isqlquoteObject *self, PyObject *args) +{ + if (!PyArg_ParseTuple(args, "")) return NULL; + + Py_INCREF(Py_None); + return Py_None; +} + +/* getbuffer - return quoted representation for object */ + +#define psyco_isqlquote_getbuffer_doc \ +"getbuffer() -- return this object" + +static PyObject * +psyco_isqlquote_getbuffer(isqlquoteObject *self, PyObject *args) +{ + if (!PyArg_ParseTuple(args, "")) return NULL; + + Py_INCREF(Py_None); + return Py_None; +} + + + +/** the ISQLQuote object **/ + + +/* object method list */ + +static struct PyMethodDef isqlquoteObject_methods[] = { + {"getquoted", (PyCFunction)psyco_isqlquote_getquoted, + METH_VARARGS, psyco_isqlquote_getquoted_doc}, + {"getbinary", (PyCFunction)psyco_isqlquote_getbinary, + METH_VARARGS, psyco_isqlquote_getbinary_doc}, + {"getbuffer", (PyCFunction)psyco_isqlquote_getbuffer, + METH_VARARGS, psyco_isqlquote_getbuffer_doc}, + /* {"prepare", (PyCFunction)psyco_isqlquote_prepare, + METH_VARARGS, psyco_isqlquote_prepare_doc}, */ + {NULL} +}; + +/* object member list */ + +static struct PyMemberDef isqlquoteObject_members[] = { + /* DBAPI-2.0 extensions (exception objects) */ + {"_wrapped", T_OBJECT, offsetof(isqlquoteObject, wrapped), RO}, + {NULL} +}; + +/* initialization and finalization methods */ + +static int +isqlquote_setup(isqlquoteObject *self, PyObject *wrapped) +{ + self->wrapped = wrapped; + Py_INCREF(wrapped); + + return 0; +} + +static void +isqlquote_dealloc(PyObject* obj) +{ + isqlquoteObject *self = (isqlquoteObject *)obj; + + Py_XDECREF(self->wrapped); + + obj->ob_type->tp_free(obj); +} + +static int +isqlquote_init(PyObject *obj, PyObject *args, PyObject *kwds) +{ + PyObject *wrapped = NULL; + + if (!PyArg_ParseTuple(args, "O", &wrapped)) + return -1; + + return isqlquote_setup((isqlquoteObject *)obj, wrapped); +} + +static PyObject * +isqlquote_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +{ + return type->tp_alloc(type, 0); +} + +static void +isqlquote_del(PyObject* self) +{ + PyObject_Del(self); +} + + +/* object type */ + +#define isqlquoteType_doc \ +"Abstract ISQLQuote protocol\n\n" \ +"An object conform to this protocol should expose a ``getquoted()`` method\n" \ +"returning the SQL representation of the object.\n\n" + +PyTypeObject isqlquoteType = { + PyObject_HEAD_INIT(NULL) + 0, + "psycopg2._psycopg.ISQLQuote", + sizeof(isqlquoteObject), + 0, + isqlquote_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + 0, /*tp_compare*/ + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash */ + + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + isqlquoteType_doc, /*tp_doc*/ + + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + + /* Attribute descriptor and subclassing stuff */ + + isqlquoteObject_methods, /*tp_methods*/ + isqlquoteObject_members, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + + isqlquote_init, /*tp_init*/ + 0, /*tp_alloc will be set to PyType_GenericAlloc in module init*/ + isqlquote_new, /*tp_new*/ + (freefunc)isqlquote_del, /*tp_free Low-level free-memory routine */ + 0, /*tp_is_gc For PyObject_IS_GC */ + 0, /*tp_bases*/ + 0, /*tp_mro method resolution order */ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0 /*tp_weaklist*/ +}; diff --git a/psycopg2/psycopg/microprotocols_proto.h b/psycopg2/psycopg/microprotocols_proto.h new file mode 100644 index 00000000..c671264f --- /dev/null +++ b/psycopg2/psycopg/microprotocols_proto.h @@ -0,0 +1,45 @@ +/* microporotocols_proto.h - definiton for psycopg's protocols + * + * Copyright (C) 2004 Federico Di Gregorio <fog@debian.org> + * + * This file is part of psycopg. + * + * 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 the Free Software Foundation; either version 2, + * or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef PSYCOPG_ISQLQUOTE_H +#define PSYCOPG_ISQLQUOTE_H 1 + +#include <Python.h> +#include <libpq-fe.h> + +#ifdef __cplusplus +extern "C" { +#endif + +extern PyTypeObject isqlquoteType; + +typedef struct { + PyObject HEAD; + + PyObject *wrapped; + +} isqlquoteObject; + +#ifdef __cplusplus +} +#endif + +#endif /* !defined(PSYCOPG_ISQLQUOTE_H) */ diff --git a/psycopg2/psycopg/pgtypes.h b/psycopg2/psycopg/pgtypes.h new file mode 100644 index 00000000..1fdbda9a --- /dev/null +++ b/psycopg2/psycopg/pgtypes.h @@ -0,0 +1,65 @@ +#define BOOLOID 16 +#define BYTEAOID 17 +#define CHAROID 18 +#define NAMEOID 19 +#define INT8OID 20 +#define INT2OID 21 +#define INT2VECTOROID 22 +#define INT4OID 23 +#define REGPROCOID 24 +#define TEXTOID 25 +#define OIDOID 26 +#define TIDOID 27 +#define XIDOID 28 +#define CIDOID 29 +#define OIDVECTOROID 30 +#define PG_TYPE_RELTYPE_OID 71 +#define PG_ATTRIBUTE_RELTYPE_OID 75 +#define PG_PROC_RELTYPE_OID 81 +#define PG_CLASS_RELTYPE_OID 83 +#define POINTOID 600 +#define LSEGOID 601 +#define PATHOID 602 +#define BOXOID 603 +#define POLYGONOID 604 +#define LINEOID 628 +#define FLOAT4OID 700 +#define FLOAT8OID 701 +#define ABSTIMEOID 702 +#define RELTIMEOID 703 +#define TINTERVALOID 704 +#define UNKNOWNOID 705 +#define CIRCLEOID 718 +#define CASHOID 790 +#define MACADDROID 829 +#define INETOID 869 +#define CIDROID 650 +#define INT4ARRAYOID 1007 +#define ACLITEMOID 1033 +#define BPCHAROID 1042 +#define VARCHAROID 1043 +#define DATEOID 1082 +#define TIMEOID 1083 +#define TIMESTAMPOID 1114 +#define TIMESTAMPTZOID 1184 +#define INTERVALOID 1186 +#define TIMETZOID 1266 +#define BITOID 1560 +#define VARBITOID 1562 +#define NUMERICOID 1700 +#define REFCURSOROID 1790 +#define REGPROCEDUREOID 2202 +#define REGOPEROID 2203 +#define REGOPERATOROID 2204 +#define REGCLASSOID 2205 +#define REGTYPEOID 2206 +#define RECORDOID 2249 +#define CSTRINGOID 2275 +#define ANYOID 2276 +#define ANYARRAYOID 2277 +#define VOIDOID 2278 +#define TRIGGEROID 2279 +#define LANGUAGE_HANDLEROID 2280 +#define INTERNALOID 2281 +#define OPAQUEOID 2282 +#define ANYELEMENTOID 2283 diff --git a/psycopg2/psycopg/pgversion.h b/psycopg2/psycopg/pgversion.h new file mode 100644 index 00000000..f874a9ae --- /dev/null +++ b/psycopg2/psycopg/pgversion.h @@ -0,0 +1,2 @@ +#define PG_VERSION_MAJOR 7 +#define PG_VERSION_MINOR 4 diff --git a/psycopg2/psycopg/pqpath.c b/psycopg2/psycopg/pqpath.c new file mode 100644 index 00000000..1ebb569c --- /dev/null +++ b/psycopg2/psycopg/pqpath.c @@ -0,0 +1,883 @@ +/* pqpath.c - single path into libpq + * + * Copyright (C) 2003 Federico Di Gregorio <fog@debian.org> + * + * This file is part of psycopg. + * + * 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 the Free Software Foundation; either version 2, + * or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/* IMPORTANT NOTE: no function in this file do its own connection locking + except for pg_execute and pq_fetch (that are somehow high-level. This means + that all the othe functions should be called while holding a lock to the + connection. +*/ + +#include <Python.h> +#include <string.h> + +#define PSYCOPG_MODULE +#include "psycopg/config.h" +#include "psycopg/python.h" +#include "psycopg/psycopg.h" +#include "psycopg/pqpath.h" +#include "psycopg/connection.h" +#include "psycopg/cursor.h" +#include "psycopg/typecast.h" +#include "psycopg/pgtypes.h" +#include "psycopg/pgversion.h" + +/* pq_raise - raise a python exception of the right kind + + This function should be called while holding the GIL. */ + +void +pq_raise(connectionObject *conn, cursorObject *curs, PyObject *exc, char *msg) +{ + PyObject *pgc = (PyObject*)curs; + + char *err = NULL; + char *err2 = NULL; + char *code = NULL; + char *buf = NULL; + + if ((conn == NULL && curs == NULL) || (curs != NULL && conn == NULL)) { + PyErr_SetString(Error, "psycopg went psycotic and raised a null error"); + return; + } + + if (curs && curs->pgres) { + err = PQresultErrorMessage(curs->pgres); +#ifdef HAVE_PQPROTOCOL3 + if (err != NULL && conn->protocol == 3) { + code = PQresultErrorField(curs->pgres, PG_DIAG_SQLSTATE); + } +#endif + } + if (err == NULL) + err = PQerrorMessage(conn->pgconn); + + /* if the is no error message we probably called pq_raise without reason: + we need to set an exception anyway because the caller will probably + raise and a meaningful message is better than an empty one */ + if (err == NULL) { + PyErr_SetString(Error, "psycopg went psycotic without error set"); + return; + } + + /* if exc is NULL, analyze the message and try to deduce the right + exception kind (only if we have a pgres, obviously) */ + if (exc == NULL) { + if (curs && curs->pgres) { + if (conn->protocol == 3) { +#ifdef HAVE_PQPROTOCOL3 + char *pgstate = + PQresultErrorField(curs->pgres, PG_DIAG_SQLSTATE); + if (pgstate != NULL && !strncmp(pgstate, "23", 2)) + exc = IntegrityError; + else + exc = ProgrammingError; +#endif + } + } + } + + /* if exc is still NULL psycopg was not built with HAVE_PQPROTOCOL3 or the + connection is using protocol 2: in both cases we default to comparing + error messages */ + if (exc == NULL) { + if (!strncmp(err, "ERROR: Cannot insert a duplicate key", 37) + || !strncmp(err, "ERROR: ExecAppend: Fail to add null", 36) + || strstr(err, "referential integrity violation")) + exc = IntegrityError; + else + exc = ProgrammingError; + } + + /* try to remove the initial "ERROR: " part from the postgresql error */ + if (err && strlen(err) > 8) err2 = &(err[8]); + else err2 = err; + + /* if msg is not NULL, add it to the error message, after a '\n' */ + if (msg && code) { + int len = strlen(code) + strlen(err) + strlen(msg) + 5; + if ((buf = PyMem_Malloc(len))) { + snprintf(buf, len, "[%s] %s\n%s", code, err2, msg); + psyco_set_error(exc, pgc, buf, err, code); + } + } + else if (msg) { + int len = strlen(err) + strlen(msg) + 2; + if ((buf = PyMem_Malloc(len))) { + snprintf(buf, len, "%s\n%s", err2, msg); + psyco_set_error(exc, pgc, buf, err, code); + } + } + else { + psyco_set_error(exc, pgc, err2, err, code); + } + + if (buf != NULL) PyMem_Free(buf); +} + +/* pq_set_critical, pq_resolve_critical - manage critical errors + + this function is invoked when a PQexec() call returns NULL, meaning a + critical condition like out of memory or lost connection. it save the error + message and mark the connection as 'wanting cleanup'. + + both functions do not call any Py_*_ALLOW_THREADS macros. + pq_resolve_critical should be called while holding the GIL. */ + +void +pq_set_critical(connectionObject *conn, const char *msg) +{ + if (msg == NULL) + msg = PQerrorMessage(conn->pgconn); + if (conn->critical) free(conn->critical); + if (msg && msg[0] != '\0') conn->critical = strdup(msg); + else conn->critical = NULL; +} + +PyObject * +pq_resolve_critical(connectionObject *conn, int close) +{ + Dprintf("pq_resolve_critical: resolving %s", conn->critical); + + if (conn->critical) { + char *msg = &(conn->critical[6]); + Dprintf("pq_resolve_critical: error = %s", msg); + /* we can't use pq_raise because the error has already been cleared + from the connection, so we just raise an OperationalError with the + critical message */ + PyErr_SetString(OperationalError, msg); + + /* we don't want to destroy this connection but just close it */ + if (close == 1) conn_close(conn); + } + return NULL; +} + +/* pq_clear_async - clear the effects of a previous async query + + note that this function does block because it needs to wait for the full + result sets of the previous query to clear them. + + + this function does not call any Py_*_ALLOW_THREADS macros */ + +void +pq_clear_async(connectionObject *conn) +{ + PGresult *pgres; + + do { + pgres = PQgetResult(conn->pgconn); + Dprintf("pq_clear_async: clearing PGresult at %p", pgres); + IFCLEARPGRES(pgres); + } while (pgres != NULL); +} + +/* pq_begin - send a BEGIN WORK, if necessary + + this function does not call any Py_*_ALLOW_THREADS macros */ + +int +pq_begin(connectionObject *conn) +{ + const char *query[] = { + NULL, + "BEGIN; SET TRANSACTION ISOLATION LEVEL READ COMMITTED", + "BEGIN; SET TRANSACTION ISOLATION LEVEL SERIALIZABLE"}; + + int pgstatus, retvalue = -1; + PGresult *pgres = NULL; + + Dprintf("pq_begin: pgconn = %p, isolevel = %ld, status = %d", + conn->pgconn, conn->isolation_level, conn->status); + + if (conn->isolation_level == 0 || conn->status != CONN_STATUS_READY) { + Dprintf("pq_begin: transaction in progress"); + return 0; + } + + pq_clear_async(conn); + pgres = PQexec(conn->pgconn, query[conn->isolation_level]); + if (pgres == NULL) { + Dprintf("pq_begin: PQexec() failed"); + pq_set_critical(conn, NULL); + goto cleanup; + } + + pgstatus = PQresultStatus(pgres); + if (pgstatus != PGRES_COMMAND_OK ) { + Dprintf("pq_begin: result is NOT OK"); + pq_set_critical(conn, NULL); + goto cleanup; + } + Dprintf("pq_begin: issued '%s' command", query[conn->isolation_level]); + + retvalue = 0; + conn->status = CONN_STATUS_BEGIN; + + cleanup: + IFCLEARPGRES(pgres); + return retvalue; +} + +/* pq_commit - send an END, if necessary + + this function does not call any Py_*_ALLOW_THREADS macros */ + +int +pq_commit(connectionObject *conn) +{ + const char *query = "END"; + int pgstatus, retvalue = -1; + PGresult *pgres = NULL; + + Dprintf("pq_commit: pgconn = %p, isolevel = %ld, status = %d", + conn->pgconn, conn->isolation_level, conn->status); + + if (conn->isolation_level == 0 || conn->status != CONN_STATUS_BEGIN) { + Dprintf("pq_commit: no transaction to commit"); + return 0; + } + + pq_clear_async(conn); + pgres = PQexec(conn->pgconn, query); + if (pgres == NULL) { + Dprintf("pq_commit: PQexec() failed"); + pq_set_critical(conn, NULL); + goto cleanup; + } + + pgstatus = PQresultStatus(pgres); + if (pgstatus != PGRES_COMMAND_OK ) { + Dprintf("pq_commit: result is NOT OK"); + pq_set_critical(conn, NULL); + goto cleanup; + } + Dprintf("pq_commit: issued '%s' command", query); + + retvalue = 0; + conn->status = CONN_STATUS_READY; + + cleanup: + IFCLEARPGRES(pgres); + return retvalue; +} + +/* pq_abort - send an ABORT, if necessary + + this function does not call any Py_*_ALLOW_THREADS macros */ + +int +pq_abort(connectionObject *conn) +{ + const char *query = "ABORT"; + int pgstatus, retvalue = -1; + PGresult *pgres = NULL; + + Dprintf("pq_abort: pgconn = %p, isolevel = %ld, status = %d", + conn->pgconn, conn->isolation_level, conn->status); + + if (conn->isolation_level == 0 || conn->status != CONN_STATUS_BEGIN) { + Dprintf("pq_abort: no transaction to abort"); + return 0; + } + + pq_clear_async(conn); + pgres = PQexec(conn->pgconn, query); + if (pgres == NULL) { + Dprintf("pq_abort: PQexec() failed"); + pq_set_critical(conn, NULL); + goto cleanup; + } + + pgstatus = PQresultStatus(pgres); + if (pgstatus != PGRES_COMMAND_OK ) { + Dprintf("pq_abort: result is NOT OK"); + pq_set_critical(conn, NULL); + goto cleanup; + } + Dprintf("pq_abort: issued '%s' command", query); + + retvalue = 0; + conn->status = CONN_STATUS_READY; + + cleanup: + IFCLEARPGRES(pgres); + return retvalue; +} + +/* pq_is_busy - consume input and return connection status + + a status of 1 means that a call to pq_fetch will block, while a status of 0 + means that there is data available to be collected. -1 means an error, the + exception will be set accordingly. + + this fucntion locks the connection object + this function call Py_*_ALLOW_THREADS macros */ + +int +pq_is_busy(connectionObject *conn) +{ + PGnotify *pgn; + + Dprintf("pq_is_busy: consuming input"); + + Py_BEGIN_ALLOW_THREADS; + pthread_mutex_lock(&(conn->lock)); + + if (PQconsumeInput(conn->pgconn) == 0) { + Dprintf("pq_is_busy: PQconsumeInput() failed"); + pthread_mutex_unlock(&(conn->lock)); + Py_BLOCK_THREADS; + PyErr_SetString(OperationalError, PQerrorMessage(conn->pgconn)); + return -1; + } + + pthread_mutex_unlock(&(conn->lock)); + Py_END_ALLOW_THREADS; + + /* now check for notifies */ + while ((pgn = PQnotifies(conn->pgconn)) != NULL) { + PyObject *notify; + + Dprintf("curs_is_busy: got NOTIFY from pid %d, msg = %s", + pgn->be_pid, pgn->relname); + + notify = PyTuple_New(2); + PyTuple_SET_ITEM(notify, 0, PyInt_FromLong((long)pgn->be_pid)); + PyTuple_SET_ITEM(notify, 1, PyString_FromString(pgn->relname)); + PyList_Append(conn->notifies, notify); + free(pgn); + } + + return PQisBusy(conn->pgconn); +} + +/* pq_execute - execute a query, possibly asyncronously + + this fucntion locks the connection object + this function call Py_*_ALLOW_THREADS macros */ + +int +pq_execute(cursorObject *curs, const char *query, int async) +{ + /* if the status of the connection is critical raise an exception and + definitely close the connection */ + if (curs->conn->critical) { + pq_resolve_critical(curs->conn, 1); + return -1; + } + + /* check status of connection, raise error if not OK */ + if (PQstatus(curs->conn->pgconn) != CONNECTION_OK) { + Dprintf("pq_execute: connection NOT OK"); + PyErr_SetString(OperationalError, PQerrorMessage(curs->conn->pgconn)); + return -1; + } + Dprintf("curs_execute: pg connection at %p OK", curs->conn->pgconn); + + Py_BEGIN_ALLOW_THREADS; + pthread_mutex_lock(&(curs->conn->lock)); + + pq_begin(curs->conn); + + if (async == 0) { + IFCLEARPGRES(curs->pgres); + Dprintf("pq_execute: executing SYNC query:"); + Dprintf(" %-.200s", query); + curs->pgres = PQexec(curs->conn->pgconn, query); + } + + else if (async == 1) { + /* first of all, let see if the previous query has already ended, if + not what should we do? just block and discard data or execute + another query? */ + pq_clear_async(curs->conn); + + Dprintf("pq_execute: executing ASYNC query:"); + Dprintf(" %-.200s", query); + + /* then we can go on and send a new query without fear */ + IFCLEARPGRES(curs->pgres); + if (PQsendQuery(curs->conn->pgconn, query) == 0) { + pthread_mutex_unlock(&(curs->conn->lock)); + Py_BLOCK_THREADS; + PyErr_SetString(OperationalError, + PQerrorMessage(curs->conn->pgconn)); + return -1; + } + Dprintf("pq_execute: async query sent to backend"); + } + + pthread_mutex_unlock(&(curs->conn->lock)); + Py_END_ALLOW_THREADS; + + /* if the execute was sync, we call pq_fetch() immediately, + to respect the old DBAPI-2.0 compatible behaviour */ + if (async == 0) { + Dprintf("pq_execute: entering syncronous DBAPI compatibility mode"); + if (pq_fetch(curs) == -1) return -1; + } + else { + curs->conn->async_cursor = (PyObject*)curs; + } + + return 1-async; +} + + +/* pq_fetch - fetch data after a query + + this fucntion locks the connection object + this function call Py_*_ALLOW_THREADS macros + + return value: + -1 - some error occurred while calling libpq + 0 - no result from the backend but no libpq errors + 1 - result from backend (possibly data is ready) +*/ + +static void +_pq_fetch_tuples(cursorObject *curs) +{ + int i, *dsize = NULL; + + int pgnfields = PQnfields(curs->pgres); + int pgbintuples = PQbinaryTuples(curs->pgres); + + curs->notuples = 0; + + /* create the tuple for description and typecasting */ + Py_XDECREF(curs->description); + Py_XDECREF(curs->casts); + curs->description = PyTuple_New(pgnfields); + curs->casts = PyTuple_New(pgnfields); + curs->columns = pgnfields; + + /* calculate the display size for each column (cpu intensive, can be + switched off at configuration time) */ +#ifdef PSYCOPG_DISPLAY_SIZE + dsize = (int *)PyMem_Malloc(pgnfields * sizeof(int)); + if (dsize != NULL) { + int j, len; + for (i=0; i < pgnfields; i++) { + dsize[i] = -1; + } + for (j = 0; j < curs->rowcount; j++) { + for (i = 0; i < pgnfields; i++) { + len = PQgetlength(curs->pgres, j, i); + if (len > dsize[i]) dsize[i] = len; + } + } + } +#endif + + /* calculate various parameters and typecasters */ + for (i = 0; i < pgnfields; i++) { + Oid ftype = PQftype(curs->pgres, i); + int fsize = PQfsize(curs->pgres, i); + int fmod = PQfmod(curs->pgres, i); + + PyObject *dtitem = PyTuple_New(7); + PyObject *type = PyInt_FromLong(ftype); + PyObject *cast = NULL; + + PyTuple_SET_ITEM(curs->description, i, dtitem); + + /* fill the right cast function by accessing the global dictionary of + casting objects. if we got no defined cast use the default + one */ + if (!(cast = PyDict_GetItem(curs->casts, type))) { + Dprintf("_pq_fetch_tuples: cast %d not in per-cursor dict", ftype); + if (!(cast = PyDict_GetItem(psyco_types, type))) { + Dprintf("_pq_fetch_tuples: cast %d not found, using default", + PQftype(curs->pgres,i)); + cast = psyco_default_cast; + } + } + /* else if we got binary tuples and if we got a field that + is binary use the default cast + FIXME: what the hell am I trying to do here? This just can't work.. + */ + else if (pgbintuples && cast == psyco_default_binary_cast) { + Dprintf("_pq_fetch_tuples: Binary cursor and " + "binary field: %i using default cast", + PQftype(curs->pgres,i)); + cast = psyco_default_cast; + } + Dprintf("_pq_fetch_tuples: using cast at %p (%s) for type %d", + cast, PyString_AS_STRING(((typecastObject*)cast)->name), + PQftype(curs->pgres,i)); + Py_INCREF(cast); + PyTuple_SET_ITEM(curs->casts, i, cast); + + + /* 1/ fill the other fields */ + PyTuple_SET_ITEM(dtitem, 0, + PyString_FromString(PQfname(curs->pgres, i))); + PyTuple_SET_ITEM(dtitem, 1, type); + + /* 2/ display size is the maximum size of this field result tuples. */ + if (dsize && dsize[i] >= 0) { + PyTuple_SET_ITEM(dtitem, 2, PyInt_FromLong(dsize[i])); + } + else { + Py_INCREF(Py_None); + PyTuple_SET_ITEM(dtitem, 2, Py_None); + } + + /* 3/ size on the backend */ + if (fmod > 0) fmod = fmod - sizeof(int); + if (fsize == -1) { + if (ftype == NUMERICOID) { + PyTuple_SET_ITEM(dtitem, 3, + PyInt_FromLong((fmod >> 16) & 0xFFFF)); + } + else { /* If variable length record, return maximum size */ + PyTuple_SET_ITEM(dtitem, 3, PyInt_FromLong(fmod)); + } + } + else { + PyTuple_SET_ITEM(dtitem, 3, PyInt_FromLong(fsize)); + } + + /* 4,5/ scale and precision */ + if (ftype == NUMERICOID) { + PyTuple_SET_ITEM(dtitem, 4, PyInt_FromLong((fmod >> 16) & 0xFFFF)); + PyTuple_SET_ITEM(dtitem, 5, PyInt_FromLong((fmod & 0xFFFF) - 4)); + } + else { + Py_INCREF(Py_None); + PyTuple_SET_ITEM(dtitem, 4, Py_None); + Py_INCREF(Py_None); + PyTuple_SET_ITEM(dtitem, 5, Py_None); + } + + /* 6/ FIXME: null_ok??? */ + Py_INCREF(Py_None); + PyTuple_SET_ITEM(dtitem, 6, Py_None); + } + + if (dsize) PyMem_Free(dsize); +} + +#ifdef HAVE_PQPROTOCOL3 +static int +_pq_copy_in_v3(cursorObject *curs) +{ + /* COPY FROM implementation when protocol 3 is available: this function + uses the new PQputCopyData() and can detect errors and set the correct + exception */ + PyObject *o; + int length = 0, error = 0; + + while (1) { + o = PyObject_CallMethod(curs->copyfile, "read", "i", curs->copysize); + if (!o || !PyString_Check(o) || (length = PyString_Size(o)) == -1) { + error = 1; + } + if (length == 0 || error == 1) break; + + Py_BEGIN_ALLOW_THREADS; + if (PQputCopyData(curs->conn->pgconn, + PyString_AS_STRING(o), length) == -1) { + error = 2; + } + Py_END_ALLOW_THREADS; + + if (error == 2) break; + + Py_DECREF(o); + } + + Py_XDECREF(o); + + if (error == 0 || error == 2) + /* 0 means that the copy went well, 2 that there was an error on the + backend: in both cases we'll get the error message from the + PQresult */ + PQputCopyEnd(curs->conn->pgconn, NULL); + else + PQputCopyEnd(curs->conn->pgconn, "error during .read() call"); + + /* and finally we grab the operation result from the backend */ + IFCLEARPGRES(curs->pgres); + while ((curs->pgres = PQgetResult(curs->conn->pgconn)) != NULL) { + if (PQresultStatus(curs->pgres) == PGRES_FATAL_ERROR) + pq_raise(curs->conn, curs, NULL, NULL); + IFCLEARPGRES(curs->pgres); + } + + return 1; +} +#endif +static int +_pq_copy_in(cursorObject *curs) +{ + /* COPY FROM implementation when protocol 3 is not available: this + function can't fail but the backend will send an ERROR notice that will + be catched by our notice collector */ + PyObject *o; + + while (1) { + o = PyObject_CallMethod(curs->copyfile, "readline", NULL); + if (!o || o == Py_None || PyString_GET_SIZE(o) == 0) break; + if (PQputline(curs->conn->pgconn, PyString_AS_STRING(o)) != 0) { + Py_DECREF(o); + return -1; + } + Py_DECREF(o); + } + Py_XDECREF(o); + PQputline(curs->conn->pgconn, "\\.\n"); + PQendcopy(curs->conn->pgconn); + + /* if for some reason we're using a protocol 3 libpq to connect to a + protocol 2 backend we still need to cycle on the result set */ + IFCLEARPGRES(curs->pgres); + while ((curs->pgres = PQgetResult(curs->conn->pgconn)) != NULL) { + if (PQresultStatus(curs->pgres) == PGRES_FATAL_ERROR) + pq_raise(curs->conn, curs, NULL, NULL); + IFCLEARPGRES(curs->pgres); + } + + return 1; +} + +#ifdef HAVE_PQPROTOCOL3 +static int +_pq_copy_out_v3(cursorObject *curs) +{ + char *buffer; + int len; + + while (1) { + Py_BEGIN_ALLOW_THREADS; + len = PQgetCopyData(curs->conn->pgconn, &buffer, 0); + Py_END_ALLOW_THREADS; + + if (len > 0 && buffer) { + PyObject_CallMethod(curs->copyfile, "write", "s#", buffer, len); + PQfreemem(buffer); + } + /* we break on len == 0 but note that that should *not* happen, + because we are not doing an async call (if it happens blame + postgresql authors :/) */ + else if (len <= 0) break; + } + + if (len == -2) { + pq_raise(curs->conn, NULL, NULL, NULL); + return -1; + } + + /* and finally we grab the operation result from the backend */ + IFCLEARPGRES(curs->pgres); + while ((curs->pgres = PQgetResult(curs->conn->pgconn)) != NULL) { + if (PQresultStatus(curs->pgres) == PGRES_FATAL_ERROR) + pq_raise(curs->conn, curs, NULL, NULL); + IFCLEARPGRES(curs->pgres); + } + return 1; +} +#endif + +static int +_pq_copy_out(cursorObject *curs) +{ + char buffer[4096]; + int status, len; + + while (1) { + Py_BEGIN_ALLOW_THREADS; + status = PQgetline(curs->conn->pgconn, buffer, 4096); + Py_END_ALLOW_THREADS; + if (status == 0) { + if (buffer[0] == '\\' && buffer[1] == '.') break; + + len = strlen(buffer); + buffer[len++] = '\n'; + } + else if (status == 1) { + len = 4096-1; + } + else { + return -1; + } + + PyObject_CallMethod(curs->copyfile, "write", "s#", buffer, len); + } + + status = 1; + if (PQendcopy(curs->conn->pgconn) != 0) + status = -1; + + /* if for some reason we're using a protocol 3 libpq to connect to a + protocol 2 backend we still need to cycle on the result set */ + IFCLEARPGRES(curs->pgres); + while ((curs->pgres = PQgetResult(curs->conn->pgconn)) != NULL) { + if (PQresultStatus(curs->pgres) == PGRES_FATAL_ERROR) + pq_raise(curs->conn, curs, NULL, NULL); + IFCLEARPGRES(curs->pgres); + } + + return status; +} + +int +pq_fetch(cursorObject *curs) +{ + int pgstatus, ex = -1; + + /* even if we fail, we remove any information about the previous query */ + curs_reset(curs); + + /* we check the result from the previous execute; if the result is not + already there, we need to consume some input and go to sleep until we + get something edible to eat */ + if (!curs->pgres) { + + Dprintf("pq_fetch: no data: entering polling loop"); + + while (pq_is_busy(curs->conn) > 0) { + fd_set rfds; + struct timeval tv; + int sval, sock; + + Py_BEGIN_ALLOW_THREADS; + pthread_mutex_lock(&(curs->conn->lock)); + + sock = PQsocket(curs->conn->pgconn); + FD_ZERO(&rfds); + FD_SET(sock, &rfds); + + /* set a default timeout of 5 seconds + TODO: make use of the timeout, maybe allowing the user to + make a non-blocking (timeouted) call to fetchXXX */ + tv.tv_sec = 5; + tv.tv_usec = 0; + + Dprintf("pq_fetch: entering PDflush() loop"); + while (PQflush(curs->conn->pgconn) != 0); + sval = select(sock+1, &rfds, NULL, NULL, &tv); + + pthread_mutex_unlock(&(curs->conn->lock)); + Py_END_ALLOW_THREADS; + } + + Dprintf("pq_fetch: data is probably ready"); + IFCLEARPGRES(curs->pgres); + curs->pgres = PQgetResult(curs->conn->pgconn); + } + + /* check for PGRES_FATAL_ERROR result */ + /* FIXME: I am not sure we need to check for critical error here. + if (curs->pgres == NULL) { + Dprintf("pq_fetch: got a NULL pgres, checking for critical"); + pq_set_critical(curs->conn); + if (curs->conn->critical) { + pq_resolve_critical(curs->conn); + return -1; + } + else { + return 0; + } + } + */ + + if (curs->pgres == NULL) return 0; + + pgstatus = PQresultStatus(curs->pgres); + Dprintf("pq_fetch: pgstatus = %s", PQresStatus(pgstatus)); + + /* backend status message */ + Py_XDECREF(curs->pgstatus); + curs->pgstatus = PyString_FromString(PQcmdStatus(curs->pgres)); + + switch(pgstatus) { + + case PGRES_COMMAND_OK: + Dprintf("pq_fetch: command returned OK (no tuples)"); + curs->rowcount = atoi(PQcmdTuples(curs->pgres)); + curs->lastoid = PQoidValue(curs->pgres); + CLEARPGRES(curs->pgres); + ex = 1; + break; + + case PGRES_COPY_OUT: + Dprintf("pq_fetch: data from a COPY TO (no tuples)"); +#ifdef HAVE_PQPROTOCOL3 + if (curs->conn->protocol == 3) + ex = _pq_copy_out_v3(curs); + else +#endif + ex = _pq_copy_out(curs); + curs->rowcount = -1; + /* error caught by out glorious notice handler */ + if (PyErr_Occurred()) ex = -1; + IFCLEARPGRES(curs->pgres); + break; + + case PGRES_COPY_IN: + Dprintf("pq_fetch: data from a COPY FROM (no tuples)"); +#ifdef HAVE_PQPROTOCOL3 + if (curs->conn->protocol == 3) + ex = _pq_copy_in_v3(curs); + else +#endif + ex = _pq_copy_in(curs); + curs->rowcount = -1; + /* error caught by out glorious notice handler */ + if (PyErr_Occurred()) ex = -1; + IFCLEARPGRES(curs->pgres); + break; + + case PGRES_TUPLES_OK: + Dprintf("pq_fetch: data from a SELECT (got tuples)"); + curs->rowcount = PQntuples(curs->pgres); + _pq_fetch_tuples(curs); ex = 0; + /* don't clear curs->pgres, because it contains the results! */ + break; + + default: + Dprintf("pq_fetch: uh-oh, something FAILED"); + pq_raise(curs->conn, curs, NULL, NULL); + IFCLEARPGRES(curs->pgres); + ex = -1; + break; + } + + Dprintf("pq_fetch: fetching done; check for critical errors"); + + /* error checking, close the connection if necessary (some critical errors + are not really critical, like a COPY FROM error: if that's the case we + raise the exception but we avoid to close the connection) */ + if (curs->conn->critical) { + if (ex == -1) { + pq_resolve_critical(curs->conn, 1); + } + else { + pq_resolve_critical(curs->conn, 0); + } + return -1; + } + + return ex; +} diff --git a/psycopg2/psycopg/pqpath.h b/psycopg2/psycopg/pqpath.h new file mode 100644 index 00000000..64d113e4 --- /dev/null +++ b/psycopg2/psycopg/pqpath.h @@ -0,0 +1,41 @@ +/* pqpath.h - definitions for pqpath.c + * + * Copyright (C) 2003 Federico Di Gregorio <fog@debian.org> + * + * This file is part of psycopg. + * + * 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 the Free Software Foundation; either version 2, + * or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef PSYCOPG_PQPATH_H +#define PSYCOPG_PQPATH_H 1 + +#include "psycopg/cursor.h" +#include "psycopg/connection.h" + +/* macros to clean the pg result */ +#define IFCLEARPGRES(pgres) if (pgres) {PQclear(pgres); pgres = NULL;} +#define CLEARPGRES(pgres) PQclear(pgres); pgres = NULL + +/* exported functions */ +extern int pq_fetch(cursorObject *curs); +extern int pq_execute(cursorObject *curs, const char *query, int async); +extern int pq_begin(connectionObject *conn); +extern int pq_commit(connectionObject *conn); +extern int pq_abort(connectionObject *conn); +extern int pq_is_busy(connectionObject *conn); +extern void pq_set_critical(connectionObject *conn, const char *msg); + +#endif /* !defined(PSYCOPG_PQPATH_H) */ diff --git a/psycopg2/psycopg/psycopg.h b/psycopg2/psycopg/psycopg.h new file mode 100644 index 00000000..a689ea45 --- /dev/null +++ b/psycopg2/psycopg/psycopg.h @@ -0,0 +1,142 @@ +/* psycopg.h - definitions for the psycopg python module + * + * Copyright (C) 2003 Federico Di Gregorio <fog@debian.org> + * + * This file is part of psycopg. + * + * 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 the Free Software Foundation; either version 2, + * or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef PSYCOPG_H +#define PSYCOPG_H 1 + +#include <Python.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* DBAPI compliance parameters */ +#define APILEVEL "2.0" +#define THREADSAFETY 2 +#define PARAMSTYLE "pyformat" + +/* C API functions */ +#define psyco_errors_fill_NUM 0 +#define psyco_errors_fill_RETURN void +#define psyco_errors_fill_PROTO (PyObject *dict) +#define psyco_errors_set_NUM 1 +#define psyco_errors_set_RETURN void +#define psyco_errors_set_PROTO (PyObject *type) + +/* Total number of C API pointers */ +#define PSYCOPG_API_pointers 2 + +#ifdef PSYCOPG_MODULE + /** This section is used when compiling psycopgmodule.c & co. **/ +extern psyco_errors_fill_RETURN psyco_errors_fill psyco_errors_fill_PROTO; +extern psyco_errors_set_RETURN psyco_errors_set psyco_errors_set_PROTO; + +/* global excpetions */ +extern PyObject *Error, *Warning, *InterfaceError, *DatabaseError, + *InternalError, *OperationalError, *ProgrammingError, + *IntegrityError, *DataError, *NotSupportedError; + +/* python versions and compatibility stuff */ +#ifndef PyMODINIT_FUNC +#define PyMODINIT_FUNC void +#endif + +#else + /** This section is used in modules that use psycopg's C API **/ + +static void **PSYCOPG_API; + +#define psyco_errors_fill \ + (*(psyco_errors_fill_RETURN (*)psyco_errors_fill_PROTO) \ + PSYCOPG_API[psyco_errors_fill_NUM]) +#define psyco_errors_set \ + (*(psyco_errors_set_RETURN (*)psyco_errors_set_PROTO) \ + PSYCOPG_API[psyco_errors_set_NUM]) + +/* Return -1 and set exception on error, 0 on success. */ +static int +import_psycopg(void) +{ + PyObject *module = PyImport_ImportModule("psycopg"); + + if (module != NULL) { + PyObject *c_api_object = PyObject_GetAttrString(module, "_C_API"); + if (c_api_object == NULL) return -1; + if (PyCObject_Check(c_api_object)) + PSYCOPG_API = (void **)PyCObject_AsVoidPtr(c_api_object); + Py_DECREF(c_api_object); + } + return 0; +} + +#endif + +/* postgresql<->python encoding map */ +extern PyObject *psycoEncodings; + +typedef struct { + char *pgenc; + char *pyenc; +} encodingPair; + +/* the Decimal type, used by the DECIMAL typecaster */ +extern PyObject *decimalType; + +/* some utility functions */ +extern void psyco_set_error(PyObject *exc, PyObject *curs, char *msg, + char *pgerror, char *pgcode); + +/* Exceptions docstrings */ +#define Error_doc \ +"Base class for error exceptions." + +#define Warning_doc \ +"A database warning." + +#define InterfaceError_doc \ +"Error related to the database interface." + +#define DatabaseError_doc \ +"Error related to the database engine." + +#define InternalError_doc \ +"The database encountered an internal error." + +#define OperationalError_doc \ +"Error related to database operation (disconnect, memory allocation etc)." + +#define ProgrammingError_doc \ +"Error related to database programming (SQL error, table not found etc)." + +#define IntegrityError_doc \ +"Error related to database integrity." + +#define DataError_doc \ +"Error related to problems with the processed data." + +#define NotSupportedError_doc \ +"A not supported datbase API was called." + +#ifdef __cplusplus +} +#endif + +#endif /* !defined(PSYCOPG_H) */ diff --git a/psycopg2/psycopg/psycopgmodule.c b/psycopg2/psycopg/psycopgmodule.c new file mode 100644 index 00000000..426fb27a --- /dev/null +++ b/psycopg2/psycopg/psycopgmodule.c @@ -0,0 +1,672 @@ +/* psycopgmodule.c - psycopg module (will import other C classes) + * + * Copyright (C) 2003 Federico Di Gregorio <fog@debian.org> + * + * This file is part of psycopg. + * + * 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 the Free Software Foundation; either version 2, + * or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include <Python.h> + +#define PSYCOPG_MODULE +#include "psycopg/config.h" +#include "psycopg/python.h" +#include "psycopg/psycopg.h" +#include "psycopg/connection.h" +#include "psycopg/cursor.h" +#include "psycopg/typecast.h" +#include "psycopg/microprotocols.h" +#include "psycopg/microprotocols_proto.h" + +#include "psycopg/adapter_qstring.h" +#include "psycopg/adapter_binary.h" +#include "psycopg/adapter_pboolean.h" +#include "psycopg/adapter_asis.h" +#include "psycopg/adapter_list.h" +#include "psycopg/typecast_binary.h" + +#ifdef HAVE_MXDATETIME +#include <mxDateTime.h> +#include "psycopg/adapter_mxdatetime.h" +mxDateTimeModule_APIObject *mxDateTimeP = NULL; +#endif + +/* some module-level variables, like the datetime module */ +#ifdef HAVE_PYDATETIME +#include <datetime.h> +#include "psycopg/adapter_datetime.h" +PyObject *pyDateTimeModuleP = NULL; +PyObject *pyDateTypeP = NULL; +PyObject *pyTimeTypeP = NULL; +PyObject *pyDateTimeTypeP = NULL; +PyObject *pyDeltaTypeP = NULL; +#endif + +/* pointers to the psycopg.tz classes */ +PyObject *pyPsycopgTzModule = NULL; +PyObject *pyPsycopgTzLOCAL = NULL; +PyObject *pyPsycopgTzFixedOffsetTimezone = NULL; + +PyObject *psycoEncodings = NULL; +PyObject *decimalType = NULL; + +/** connect module-level function **/ +#define psyco_connect_doc \ +"connect(dsn, ...) -- Create a new database connection.\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 `connection` class.\n" \ +"Else the given sub-class of `extensions.connection` will be used to\n" \ +"instantiate the connection object.\n\n" \ +":return: New database connection\n" \ +":rtype: `extensions.connection`" + +static int +_psyco_connect_fill_dsn(char *dsn, char *kw, char *v, int i) +{ + strcpy(&dsn[i], kw); i += strlen(kw); + strcpy(&dsn[i], v); i += strlen(v); + return i; +} + +static void +_psyco_connect_fill_exc(connectionObject *conn) +{ + /* fill the connection object with the exceptions */ + conn->exc_Error = Error; + Py_INCREF(Error); + conn->exc_Warning = Warning; + Py_INCREF(Warning); + conn->exc_InterfaceError = InterfaceError; + Py_INCREF(InterfaceError); + conn->exc_DatabaseError = DatabaseError; + Py_INCREF(DatabaseError); + conn->exc_InternalError = InternalError; + Py_INCREF(InternalError); + conn->exc_ProgrammingError = ProgrammingError; + Py_INCREF(ProgrammingError); + conn->exc_IntegrityError = IntegrityError; + Py_INCREF(IntegrityError); + conn->exc_DataError = DataError; + Py_INCREF(DataError); + conn->exc_NotSupportedError = NotSupportedError; + Py_INCREF(NotSupportedError); + conn->exc_OperationalError = OperationalError; + Py_INCREF(OperationalError); +} + +static PyObject * +psyco_connect(PyObject *self, PyObject *args, PyObject *keywds) +{ + PyObject *conn, *factory = NULL; + PyObject *pyport = NULL; + + int idsn=-1, iport=-1; + char *dsn=NULL, *database=NULL, *user=NULL, *password=NULL; + char *host=NULL, *sslmode=NULL; + char port[16]; + + static char *kwlist[] = {"dsn", "database", "host", "port", + "user", "password", "sslmode", + "connection_factory", NULL}; + + if (!PyArg_ParseTupleAndKeywords(args, keywds, "|sssOsssO", kwlist, + &dsn, &database, &host, &pyport, + &user, &password, &sslmode, &factory)) { + return NULL; + } + + if (pyport && PyString_Check(pyport)) { + PyObject *pyint = PyInt_FromString(PyString_AsString(pyport), NULL, 10); + if (!pyint) return NULL; + iport = PyInt_AsLong(pyint); + } + else if (pyport && PyInt_Check(pyport)) { + iport = PyInt_AsLong(pyport); + } + else if (pyport != NULL) { + PyErr_SetString(PyExc_TypeError, "port must be a string or int"); + return NULL; + } + + if (iport > 0) + PyOS_snprintf(port, 16, "%d", iport); + + if (dsn == NULL) { + int l = 45; /* len("dbname= user= password= host= port= sslmode=\0") */ + + if (database) l += strlen(database); + if (host) l += strlen(host); + if (iport > 0) l += strlen(port); + if (user) l += strlen(user); + if (password) l += strlen(password); + if (sslmode) l += strlen(sslmode); + + dsn = malloc(l*sizeof(char)); + if (dsn == NULL) { + PyErr_SetString(InterfaceError, "dynamic dsn allocation failed"); + return NULL; + } + + idsn = 0; + if (database) + idsn = _psyco_connect_fill_dsn(dsn, " dbname=", database, idsn); + if (host) + idsn = _psyco_connect_fill_dsn(dsn, " host=", host, idsn); + if (iport > 0) + idsn = _psyco_connect_fill_dsn(dsn, " port=", port, idsn); + if (user) + idsn = _psyco_connect_fill_dsn(dsn, " user=", user, idsn); + if (password) + idsn = _psyco_connect_fill_dsn(dsn, " password=", password, idsn); + if (sslmode) + idsn = _psyco_connect_fill_dsn(dsn, " sslmode=", sslmode, idsn); + + if (idsn > 0) { + dsn[idsn] = '\0'; + memmove(dsn, &dsn[1], idsn); + } + else { + free(dsn); + PyErr_SetString(InterfaceError, "missing dsn and no parameters"); + return NULL; + } + } + + Dprintf("psyco_connect: dsn = '%s'", dsn); + + /* allocate connection, fill with errors and return it */ + if (factory == NULL) factory = (PyObject *)&connectionType; + conn = PyObject_CallFunction(factory, "s", dsn); + if (conn) _psyco_connect_fill_exc((connectionObject*)conn); + + return conn; +} + +/** type registration **/ +#define psyco_register_type_doc \ +"register_type(obj) -> None -- register obj with psycopg type system\n\n" \ +":Parameters:\n" \ +" * `obj`: A type adapter created by `new_type()`" + +#define typecast_from_python_doc \ +"new_type(oids, name, adapter) -> new type object\n\n" \ +"Create a new binding object. The object can be used with the\n" \ +"`register_type()` function to bind PostgreSQL objects to python objects.\n\n" \ +":Parameters:\n" \ +" * `oids`: Tuple of ``oid`` of the PostgreSQL types to convert.\n" \ +" * `name`: Name for the new type\n" \ +" * `adapter`: Callable to perform type conversion.\n" \ +" It must have the signature ``fun(value, cur)`` where ``value`` is\n" \ +" the string representation returned by PostgreSQL (`None` if ``NULL``)\n" \ +" and ``cur`` is the cursor from which data are read." + +static PyObject * +psyco_register_type(PyObject *self, PyObject *args) +{ + PyObject *type; + + if (!PyArg_ParseTuple(args, "O!", &typecastType, &type)) { + return NULL; + } + + typecast_add(type, 0); + + Py_INCREF(Py_None); + return Py_None; +} + + +/* default adapters */ + +static void +psyco_adapters_init(PyObject *mod) +{ + PyObject *call; + + microprotocols_add(&PyFloat_Type, NULL, (PyObject*)&asisType); + microprotocols_add(&PyInt_Type, NULL, (PyObject*)&asisType); + microprotocols_add(&PyLong_Type, NULL, (PyObject*)&asisType); + + microprotocols_add(&PyString_Type, NULL, (PyObject*)&qstringType); + microprotocols_add(&PyUnicode_Type, NULL, (PyObject*)&qstringType); + microprotocols_add(&PyBuffer_Type, NULL, (PyObject*)&binaryType); + microprotocols_add(&PyList_Type, NULL, (PyObject*)&listType); + +#ifdef HAVE_MXDATETIME + /* the module has already been initialized, so we can obtain the callable + objects directly from its dictionary :) */ + call = PyMapping_GetItemString(mod, "TimestampFromMx"); + microprotocols_add(mxDateTimeP->DateTime_Type, NULL, call); + call = PyMapping_GetItemString(mod, "TimeFromMx"); + microprotocols_add(mxDateTimeP->DateTimeDelta_Type, NULL, call); +#endif + +#ifdef HAVE_PYDATETIME + /* as above, we use the callable objects from the psycopg module */ + call = PyMapping_GetItemString(mod, "DateFromPy"); + microprotocols_add((PyTypeObject*)pyDateTypeP, NULL, call); + call = PyMapping_GetItemString(mod, "TimeFromPy"); + microprotocols_add((PyTypeObject*)pyTimeTypeP, NULL, call); + call = PyMapping_GetItemString(mod, "TimestampFromPy"); + microprotocols_add((PyTypeObject*)pyDateTimeTypeP, NULL, call); + call = PyMapping_GetItemString(mod, "IntervalFromPy"); + microprotocols_add((PyTypeObject*)pyDeltaTypeP, NULL, call); +#endif + +#ifdef HAVE_PYBOOL + microprotocols_add(&PyBool_Type, NULL, (PyObject*)&pbooleanType); +#endif + +#ifdef HAVE_DECIMAL + microprotocols_add((PyTypeObject*)decimalType, NULL, (PyObject*)&asisType); +#endif +} + +/* psyco_encodings_fill + + Fill the module's postgresql<->python encoding table */ + +static encodingPair encodings[] = { + {"SQL_ASCII", "ascii"}, + {"LATIN1", "latin_1"}, + {"UNICODE", "utf_8"}, + {"UTF8", "utf_8"}, + + /* some compatibility stuff */ + {"LATIN-1", "latin_1"}, + + {NULL, NULL} +}; +static void psyco_encodings_fill(PyObject *dict) +{ + encodingPair *enc; + + for (enc = encodings; enc->pgenc != NULL; enc++) { + PyObject *value = PyString_FromString(enc->pyenc); + PyDict_SetItemString(dict, enc->pgenc, value); + Py_DECREF(value); + } +} + +/* psyco_errors_init, psyco_errors_fill (callable from C) + + Initialize the module's exceptions and after that a dictionary with a full + set of exceptions. */ + +PyObject *Error, *Warning, *InterfaceError, *DatabaseError, + *InternalError, *OperationalError, *ProgrammingError, + *IntegrityError, *DataError, *NotSupportedError; + +/* mapping between exception names and their PyObject */ +static struct { + char *name; + PyObject **exc; + PyObject **base; + char *docstr; +} exctable[] = { + { "psycopg2.Error", &Error, 0, Error_doc }, + { "psycopg2.Warning", &Warning, 0, Warning_doc }, + { "psycopg2.InterfaceError", &InterfaceError, &Error, InterfaceError_doc }, + { "psycopg2.DatabaseError", &DatabaseError, &Error, DatabaseError_doc }, + { "psycopg2.InternalError", &InternalError, &DatabaseError, InternalError_doc }, + { "psycopg2.OperationalError", &OperationalError, &DatabaseError, + OperationalError_doc }, + { "psycopg2.ProgrammingError", &ProgrammingError, &DatabaseError, + ProgrammingError_doc }, + { "psycopg2.IntegrityError", &IntegrityError, &DatabaseError, + IntegrityError_doc }, + { "psycopg2.DataError", &DataError, &DatabaseError, DataError_doc }, + { "psycopg2.NotSupportedError", &NotSupportedError, &DatabaseError, + NotSupportedError_doc }, + {NULL} /* Sentinel */ +}; + +static void +psyco_errors_init(void) +{ + /* the names of the exceptions here reflect the oranization of the + psycopg2 module and not the fact the the original error objects + live in _psycopg */ + + int i; + PyObject *dict; + PyObject *base; + PyObject *str; + + for (i=0; exctable[i].name; i++) { + dict = PyDict_New(); + + if (exctable[i].docstr) { + str = PyString_FromString(exctable[i].docstr); + PyDict_SetItemString(dict, "__doc__", str); + } + + if (exctable[i].base == 0) + base = PyExc_StandardError; + else + base = *exctable[i].base; + + *exctable[i].exc = PyErr_NewException(exctable[i].name, base, dict); + } +} + +void +psyco_errors_fill(PyObject *dict) +{ + PyDict_SetItemString(dict, "Error", Error); + PyDict_SetItemString(dict, "Warning", Warning); + PyDict_SetItemString(dict, "InterfaceError", InterfaceError); + PyDict_SetItemString(dict, "DatabaseError", DatabaseError); + PyDict_SetItemString(dict, "InternalError", InternalError); + PyDict_SetItemString(dict, "OperationalError", OperationalError); + PyDict_SetItemString(dict, "ProgrammingError", ProgrammingError); + PyDict_SetItemString(dict, "IntegrityError", IntegrityError); + PyDict_SetItemString(dict, "DataError", DataError); + PyDict_SetItemString(dict, "NotSupportedError", NotSupportedError); +} + +void +psyco_errors_set(PyObject *type) +{ + PyObject_SetAttrString(type, "Error", Error); + PyObject_SetAttrString(type, "Warning", Warning); + PyObject_SetAttrString(type, "InterfaceError", InterfaceError); + PyObject_SetAttrString(type, "DatabaseError", DatabaseError); + PyObject_SetAttrString(type, "InternalError", InternalError); + PyObject_SetAttrString(type, "OperationalError", OperationalError); + PyObject_SetAttrString(type, "ProgrammingError", ProgrammingError); + PyObject_SetAttrString(type, "IntegrityError", IntegrityError); + PyObject_SetAttrString(type, "DataError", DataError); + PyObject_SetAttrString(type, "NotSupportedError", NotSupportedError); +} + +/* psyco_error_new + + Create a new error of the given type with extra attributes. */ + +void +psyco_set_error(PyObject *exc, PyObject *curs, char *msg, + char *pgerror, char *pgcode) +{ + PyObject *t; + + PyObject *err = PyObject_CallFunction(exc, "s", msg); + + if (err) { + if (pgerror) { + t = PyString_FromString(pgerror); + } + else { + t = Py_None ; Py_INCREF(t); + } + PyObject_SetAttrString(err, "pgerror", t); + Py_DECREF(t); + + if (pgcode) { + t = PyString_FromString(pgcode); + } + else { + t = Py_None ; Py_INCREF(t); + } + PyObject_SetAttrString(err, "pgcode", t); + Py_DECREF(t); + + if (curs) + PyObject_SetAttrString(err, "cursor", curs); + else + PyObject_SetAttrString(err, "cursor", Py_None); + + PyErr_SetObject(exc, err); + Py_DECREF(err); + } +} + +/* psyco_decimal_init + + Initialize the module's pointer to the decimal type. */ + +void +psyco_decimal_init(void) +{ +#ifdef HAVE_DECIMAL + PyObject *decimal = PyImport_ImportModule("decimal"); + if (decimal) { + decimalType = PyObject_GetAttrString(decimal, "Decimal"); + } + else { + PyErr_Clear(); + decimalType = (PyObject *)&PyFloat_Type; + Py_INCREF(decimalType); + } +#endif +} + + +/** method table and module initialization **/ + +static PyMethodDef psycopgMethods[] = { + {"connect", (PyCFunction)psyco_connect, + METH_VARARGS|METH_KEYWORDS, psyco_connect_doc}, + {"adapt", (PyCFunction)psyco_microprotocols_adapt, + METH_VARARGS, psyco_microprotocols_adapt_doc}, + + {"register_type", (PyCFunction)psyco_register_type, + METH_VARARGS, psyco_register_type_doc}, + {"new_type", (PyCFunction)typecast_from_python, + METH_VARARGS|METH_KEYWORDS, typecast_from_python_doc}, + + {"AsIs", (PyCFunction)psyco_AsIs, + METH_VARARGS, psyco_AsIs_doc}, + {"QuotedString", (PyCFunction)psyco_QuotedString, + METH_VARARGS, psyco_QuotedString_doc}, + {"Boolean", (PyCFunction)psyco_Boolean, + METH_VARARGS, psyco_Boolean_doc}, + {"Binary", (PyCFunction)psyco_Binary, + METH_VARARGS, psyco_Binary_doc}, + {"Date", (PyCFunction)psyco_Date, + METH_VARARGS, psyco_Date_doc}, + {"Time", (PyCFunction)psyco_Time, + METH_VARARGS, psyco_Time_doc}, + {"Timestamp", (PyCFunction)psyco_Timestamp, + METH_VARARGS, psyco_Timestamp_doc}, + {"DateFromTicks", (PyCFunction)psyco_DateFromTicks, + METH_VARARGS, psyco_DateFromTicks_doc}, + {"TimeFromTicks", (PyCFunction)psyco_TimeFromTicks, + METH_VARARGS, psyco_TimeFromTicks_doc}, + {"TimestampFromTicks", (PyCFunction)psyco_TimestampFromTicks, + METH_VARARGS, psyco_TimestampFromTicks_doc}, + {"List", (PyCFunction)psyco_List, + METH_VARARGS, psyco_List_doc}, + +#ifdef HAVE_MXDATETIME + {"DateFromMx", (PyCFunction)psyco_DateFromMx, + METH_VARARGS, psyco_DateFromMx_doc}, + {"TimeFromMx", (PyCFunction)psyco_TimeFromMx, + METH_VARARGS, psyco_TimeFromMx_doc}, + {"TimestampFromMx", (PyCFunction)psyco_TimestampFromMx, + METH_VARARGS, psyco_TimestampFromMx_doc}, + {"IntervalFromMx", (PyCFunction)psyco_IntervalFromMx, + METH_VARARGS, psyco_IntervalFromMx_doc}, +#endif + +#ifdef HAVE_PYDATETIME + {"DateFromPy", (PyCFunction)psyco_DateFromPy, + METH_VARARGS, psyco_DateFromPy_doc}, + {"TimeFromPy", (PyCFunction)psyco_TimeFromPy, + METH_VARARGS, psyco_TimeFromPy_doc}, + {"TimestampFromPy", (PyCFunction)psyco_TimestampFromPy, + METH_VARARGS, psyco_TimestampFromPy_doc}, + {"IntervalFromPy", (PyCFunction)psyco_IntervalFromPy, + METH_VARARGS, psyco_IntervalFromPy_doc}, +#endif + + {NULL, NULL, 0, NULL} /* Sentinel */ +}; + +PyMODINIT_FUNC +init_psycopg(void) +{ + static void *PSYCOPG_API[PSYCOPG_API_pointers]; + + PyObject *module, *dict; + PyObject *c_api_object; + + Dprintf("initpsycopg: initializing psycopg %s", PSYCOPG_VERSION); + + /* initialize all the new types and then the module */ + connectionType.ob_type = &PyType_Type; + cursorType.ob_type = &PyType_Type; + typecastType.ob_type = &PyType_Type; + qstringType.ob_type = &PyType_Type; + binaryType.ob_type = &PyType_Type; + isqlquoteType.ob_type = &PyType_Type; + asisType.ob_type = &PyType_Type; + listType.ob_type = &PyType_Type; + chunkType.ob_type = &PyType_Type; + + if (PyType_Ready(&connectionType) == -1) return; + if (PyType_Ready(&cursorType) == -1) return; + if (PyType_Ready(&typecastType) == -1) return; + if (PyType_Ready(&qstringType) == -1) return; + if (PyType_Ready(&binaryType) == -1) return; + if (PyType_Ready(&isqlquoteType) == -1) return; + if (PyType_Ready(&asisType) == -1) return; + if (PyType_Ready(&listType) == -1) return; + if (PyType_Ready(&chunkType) == -1) return; + +#ifdef HAVE_PYBOOL + pbooleanType.ob_type = &PyType_Type; + if (PyType_Ready(&pbooleanType) == -1) return; +#endif + + /* import mx.DateTime module, if necessary */ +#ifdef HAVE_MXDATETIME + mxdatetimeType.ob_type = &PyType_Type; + if (PyType_Ready(&mxdatetimeType) == -1) return; + if (mxDateTime_ImportModuleAndAPI() != 0) { + Dprintf("initpsycopg: why marc hide mx.DateTime again?!"); + PyErr_SetString(PyExc_ImportError, "can't import mx.DateTime module"); + return; + } + mxDateTimeP = &mxDateTime; +#endif + + /* import python builtin datetime module, if available */ +#ifdef HAVE_PYDATETIME + pyDateTimeModuleP = PyImport_ImportModule("datetime"); + if (pyDateTimeModuleP == NULL) { + Dprintf("initpsycopg: can't import datetime module"); + PyErr_SetString(PyExc_ImportError, "can't import datetime module"); + return; + } + pydatetimeType.ob_type = &PyType_Type; + if (PyType_Ready(&pydatetimeType) == -1) return; + + /* now we define the datetime types, this is crazy because python should + be doing that, not us! */ + pyDateTypeP = PyObject_GetAttrString(pyDateTimeModuleP, "date"); + pyTimeTypeP = PyObject_GetAttrString(pyDateTimeModuleP, "time"); + pyDateTimeTypeP = PyObject_GetAttrString(pyDateTimeModuleP, "datetime"); + pyDeltaTypeP = PyObject_GetAttrString(pyDateTimeModuleP, "timedelta"); +#endif + + /* import psycopg2.tz anyway (TODO: replace with C-level module?) */ + pyPsycopgTzModule = PyImport_ImportModule("psycopg2.tz"); + if (pyPsycopgTzModule == NULL) { + Dprintf("initpsycopg: can't import psycopg2.tz module"); + PyErr_SetString(PyExc_ImportError, "can't import psycopg2.tz module"); + return; + } + pyPsycopgTzLOCAL = + PyObject_GetAttrString(pyPsycopgTzModule, "LOCAL"); + pyPsycopgTzFixedOffsetTimezone = + PyObject_GetAttrString(pyPsycopgTzModule, "FixedOffsetTimezone"); + + /* initialize the module and grab module's dictionary */ + module = Py_InitModule("_psycopg", psycopgMethods); + dict = PyModule_GetDict(module); + + /* initialize all the module's exported functions */ + /* PyBoxer_API[PyBoxer_Fake_NUM] = (void *)PyBoxer_Fake; */ + + /* Create a CObject containing the API pointer array's address */ + c_api_object = PyCObject_FromVoidPtr((void *)PSYCOPG_API, NULL); + if (c_api_object != NULL) + PyModule_AddObject(module, "_C_API", c_api_object); + + /* other mixed initializations of module-level variables */ + psycoEncodings = PyDict_New(); + psyco_encodings_fill(psycoEncodings); + psyco_decimal_init(); + + /* set some module's parameters */ + PyModule_AddStringConstant(module, "__version__", PSYCOPG_VERSION); + PyModule_AddStringConstant(module, "__doc__", "psycopg PostgreSQL driver"); + PyModule_AddObject(module, "apilevel", PyString_FromString(APILEVEL)); + PyModule_AddObject(module, "threadsafety", PyInt_FromLong(THREADSAFETY)); + PyModule_AddObject(module, "paramstyle", PyString_FromString(PARAMSTYLE)); + + /* put new types in module dictionary */ + PyModule_AddObject(module, "connection", (PyObject*)&connectionType); + PyModule_AddObject(module, "cursor", (PyObject*)&cursorType); + PyModule_AddObject(module, "ISQLQuote", (PyObject*)&isqlquoteType); + + /* encodings dictionary in module dictionary */ + PyModule_AddObject(module, "encodings", psycoEncodings); + + /* initialize default set of typecasters */ + typecast_init(dict); + + /* initialize microprotocols layer */ + microprotocols_init(dict); + psyco_adapters_init(dict); + + /* create a standard set of exceptions and add them to the module's dict */ + psyco_errors_init(); + psyco_errors_fill(dict); + + /* Solve win32 build issue about non-constant initializer element */ + cursorType.tp_alloc = PyType_GenericAlloc; + binaryType.tp_alloc = PyType_GenericAlloc; + isqlquoteType.tp_alloc = PyType_GenericAlloc; + pbooleanType.tp_alloc = PyType_GenericAlloc; + connectionType.tp_alloc = PyType_GenericAlloc; + asisType.tp_alloc = PyType_GenericAlloc; + qstringType.tp_alloc = PyType_GenericAlloc; + listType.tp_alloc = PyType_GenericAlloc; + chunkType.tp_alloc = PyType_GenericAlloc; + +#ifdef HAVE_PYDATETIME + pydatetimeType.tp_alloc = PyType_GenericAlloc; +#endif + + Dprintf("initpsycopg: module initialization complete"); +} diff --git a/psycopg2/psycopg/python.h b/psycopg2/psycopg/python.h new file mode 100644 index 00000000..1c2b96d4 --- /dev/null +++ b/psycopg2/psycopg/python.h @@ -0,0 +1,43 @@ +/* python.h - python version compatibility stuff + * + * Copyright (C) 2003 Federico Di Gregorio <fog@debian.org> + * + * This file is part of psycopg. + * + * 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 the Free Software Foundation; either version 2, + * or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef PSYCOPG_PYTHON_H +#define PSYCOPG_PYTHON_H 1 + +#include <Python.h> +#include <structmember.h> + +/* python < 2.2 does not have PyMemeberDef */ +#if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 2 +#define PyMemberDef memberlist +#endif + +/* PyObject_TypeCheck introduced in 2.2 */ +#ifndef PyObject_TypeCheck +#define PyObject_TypeCheck(o, t) ((o)->ob_type == (t)) +#endif + +/* python 2.2 does not have freefunc (it has destructor instead) */ +#if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 3 +#define freefunc destructor +#endif + +#endif /* !defined(PSYCOPG_PYTHON_H) */ diff --git a/psycopg2/psycopg/typecast.c b/psycopg2/psycopg/typecast.c new file mode 100644 index 00000000..ef91bfde --- /dev/null +++ b/psycopg2/psycopg/typecast.c @@ -0,0 +1,563 @@ +/* typecast.c - basic utility functions related to typecasting + * + * Copyright (C) 2003 Federico Di Gregorio <fog@debian.org> + * + * This file is part of psycopg. + * + * 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 the Free Software Foundation; either version 2, + * or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include <Python.h> +#include <structmember.h> + +#define PSYCOPG_MODULE +#include "psycopg/config.h" +#include "psycopg/psycopg.h" +#include "psycopg/python.h" +#include "psycopg/typecast.h" +#include "psycopg/cursor.h" + +/* usefull function used by some typecasters */ + +static char * +skip_until_space(char *s) +{ + while (*s && *s != ' ') s++; + return s; +} + +static char * +skip_until_space2(char *s, int *len) +{ + while (*len > 0 && *s && *s != ' ') { + s++; (*len)--; + } + return s; +} + +static int +typecast_parse_date(char* s, char** t, int* len, + int* year, int* month, int* day) +{ + int acc = -1, cz = 0; + + Dprintf("typecast_parse_date: len = %d, s = %s", *len, s); + + while (cz < 3 && *len > 0 && *s) { + switch (*s) { + case '-': + case ' ': + case 'T': + if (cz == 0) *year = acc; + else if (cz == 1) *month = acc; + else if (cz == 2) *day = acc; + acc = -1; cz++; + break; + default: + acc = (acc == -1 ? 0 : acc*10) + ((int)*s - (int)'0'); + break; + } + + s++; (*len)--; + } + + if (acc != -1) { + *day = acc; + cz += 1; + } + if (t != NULL) *t = s; + + return cz; +} + +static int +typecast_parse_time(char* s, char** t, int* len, + int* hh, int* mm, int* ss, int* us, int* tz) +{ + int acc = -1, cz = 0; + int tzs = 1, tzhh = 0, tzmm = 0; + int usd = 0; + + /* sets microseconds and timezone to 0 because they may be missing */ + *us = *tz = 0; + + Dprintf("typecast_parse_time: len = %d, s = %s", *len, s); + + while (cz < 6 && *len > 0 && *s) { + switch (*s) { + case ':': + if (cz == 0) *hh = acc; + else if (cz == 1) *mm = acc; + else if (cz == 2) *ss = acc; + else if (cz == 3) *us = acc; + else if (cz == 4) tzhh = acc; + acc = -1; cz++; + break; + case '.': + /* we expect seconds and if we don't get them we return an error */ + if (cz != 2) return -1; + *ss = acc; + acc = -1; cz++; + break; + case '+': + case '-': + /* seconds or microseconds here, anything else is an error */ + if (cz < 2 || cz > 3) return -1; + if (*s == '-') tzs = -1; + if (cz == 2) *ss = acc; + else if (cz == 3) *us = acc; + acc = -1; cz = 4; + break; + default: + acc = (acc == -1 ? 0 : acc*10) + ((int)*s - (int)'0'); + if (cz == 3) usd += 1; + break; + } + + s++; (*len)--; + } + + if (acc != -1) { + if (cz == 2) { *ss = acc; cz += 1; } + else if (cz == 3) { *us = acc; cz += 1; } + else if (cz == 4) { tzhh = acc; cz += 1; } + else if (cz == 5) tzmm = acc; + } + if (t != NULL) *t = s; + + *tz = tzs * tzhh*60 + tzmm; + + if (*us != 0.0) { + while (usd++ < 6) *us *= 10.0; + } + + return cz; +} + +/** include casting objects **/ +#include "psycopg/typecast_basic.c" +#include "psycopg/typecast_binary.c" + +#ifdef HAVE_MXDATETIME +#include "psycopg/typecast_mxdatetime.c" +#endif + +#ifdef HAVE_PYDATETIME +#include "psycopg/typecast_datetime.c" +#endif + +#include "psycopg/typecast_array.c" +#include "psycopg/typecast_builtins.c" + + +/* a list of initializers, used to make the typecasters accessible anyway */ +#ifdef HAVE_PYDATETIME +typecastObject_initlist typecast_pydatetime[] = { + {"PYDATETIME", typecast_DATETIME_types, typecast_PYDATETIME_cast}, + {"PYTIME", typecast_TIME_types, typecast_PYTIME_cast}, + {"PYDATE", typecast_DATE_types, typecast_PYDATE_cast}, + {"PYINTERVAL", typecast_INTERVAL_types, typecast_PYINTERVAL_cast}, + {NULL, NULL, NULL} +}; +#endif + +/* a list of initializers, used to make the typecasters accessible anyway */ +#ifdef HAVE_MXDATETIME +typecastObject_initlist typecast_mxdatetime[] = { + {"MXDATETIME", typecast_DATETIME_types, typecast_MXDATE_cast}, + {"MXTIME", typecast_TIME_types, typecast_MXTIME_cast}, + {"MXDATE", typecast_DATE_types, typecast_MXDATE_cast}, + {"MXINTERVAL", typecast_INTERVAL_types, typecast_MXINTERVAL_cast}, + {NULL, NULL, NULL} +}; +#endif + + +/** the type dictionary and associated functions **/ + +PyObject *psyco_types; +PyObject *psyco_default_cast; +PyObject *psyco_binary_types; +PyObject *psyco_default_binary_cast; + +static long int typecast_default_DEFAULT[] = {0}; +static typecastObject_initlist typecast_default = { + "DEFAULT", typecast_default_DEFAULT, typecast_STRING_cast}; + + +/* typecast_init - initialize the dictionary and create default types */ + +int +typecast_init(PyObject *dict) +{ + int i; + + /* create type dictionary and put it in module namespace */ + psyco_types = PyDict_New(); + psyco_binary_types = PyDict_New(); + + if (!psyco_types || !psyco_binary_types) { + Py_XDECREF(psyco_types); + Py_XDECREF(psyco_binary_types); + return -1; + } + + PyDict_SetItemString(dict, "string_types", psyco_types); + PyDict_SetItemString(dict, "binary_types", psyco_binary_types); + + /* insert the cast types into the 'types' dictionary and register them in + the module dictionary */ + for (i = 0; typecast_builtins[i].name != NULL; i++) { + typecastObject *t; + + Dprintf("typecast_init: initializing %s", typecast_builtins[i].name); + + t = (typecastObject *)typecast_from_c(&(typecast_builtins[i]), dict); + if (t == NULL) return -1; + if (typecast_add((PyObject *)t, 0) != 0) return -1; + + PyDict_SetItem(dict, t->name, (PyObject *)t); + + /* export binary object */ + if (typecast_builtins[i].values == typecast_BINARY_types) { + psyco_default_binary_cast = (PyObject *)t; + } + } + + /* create and save a default cast object (but does not register it) */ + psyco_default_cast = typecast_from_c(&typecast_default, dict); + + /* register the date/time typecasters with their original names */ +#ifdef HAVE_MXDATETIME + for (i = 0; typecast_mxdatetime[i].name != NULL; i++) { + typecastObject *t; + Dprintf("typecast_init: initializing %s", typecast_mxdatetime[i].name); + t = (typecastObject *)typecast_from_c(&(typecast_mxdatetime[i]), dict); + if (t == NULL) return -1; + PyDict_SetItem(dict, t->name, (PyObject *)t); + } +#endif +#ifdef HAVE_PYDATETIME + for (i = 0; typecast_pydatetime[i].name != NULL; i++) { + typecastObject *t; + Dprintf("typecast_init: initializing %s", typecast_pydatetime[i].name); + t = (typecastObject *)typecast_from_c(&(typecast_pydatetime[i]), dict); + if (t == NULL) return -1; + PyDict_SetItem(dict, t->name, (PyObject *)t); + } +#endif + + return 0; +} + +/* typecast_add - add a type object to the dictionary */ +int +typecast_add(PyObject *obj, int binary) +{ + PyObject *val; + int len, i; + + typecastObject *type = (typecastObject *)obj; + + Dprintf("typecast_add: object at %p, values refcnt = %d", + obj, type->values->ob_refcnt); + + len = PyTuple_Size(type->values); + for (i = 0; i < len; i++) { + val = PyTuple_GetItem(type->values, i); + Dprintf("typecast_add: adding val: %ld", PyInt_AsLong(val)); + if (binary) { + PyDict_SetItem(psyco_binary_types, val, obj); + } + else { + PyDict_SetItem(psyco_types, val, obj); + } + } + + Dprintf("typecast_add: base caster: %p", type->bcast); + + return 0; +} + + +/** typecast type **/ + +#define OFFSETOF(x) offsetof(typecastObject, x) + +static int +typecast_cmp(PyObject *obj1, PyObject* obj2) +{ + typecastObject *self = (typecastObject*)obj1; + typecastObject *other = NULL; + PyObject *number = NULL; + int i, j, res = -1; + + if (PyObject_TypeCheck(obj2, &typecastType)) { + other = (typecastObject*)obj2; + } + else { + number = PyNumber_Int(obj2); + } + + Dprintf("typecast_cmp: other = %p, number = %p", other, number); + + for (i=0; i < PyObject_Length(self->values) && res == -1; i++) { + long int val = PyInt_AsLong(PyTuple_GET_ITEM(self->values, i)); + + if (other != NULL) { + for (j=0; j < PyObject_Length(other->values); j++) { + if (PyInt_AsLong(PyTuple_GET_ITEM(other->values, j)) == val) { + res = 0; break; + } + } + } + + else if (number != NULL) { + if (PyInt_AsLong(number) == val) { + res = 0; break; + } + } + } + + Py_XDECREF(number); + return res; +} + +static PyObject* +typecast_richcompare(PyObject *obj1, PyObject* obj2, int opid) +{ + PyObject *result = NULL; + int res = typecast_cmp(obj1, obj2); + + if (PyErr_Occurred()) return NULL; + + if ((opid == Py_EQ && res == 0) || (opid != Py_EQ && res != 0)) + result = Py_True; + else + result = Py_False; + + Py_INCREF(result); + return result; +} + +static struct PyMemberDef typecastObject_members[] = { + {"name", T_OBJECT, OFFSETOF(name), RO}, + {"values", T_OBJECT, OFFSETOF(values), RO}, + {NULL} +}; + +static void +typecast_dealloc(PyObject *obj) +{ + typecastObject *self = (typecastObject*)obj; + + Py_XDECREF(self->values); + Py_XDECREF(self->name); + Py_XDECREF(self->pcast); + + PyObject_Del(self); +} + +static PyObject * +typecast_call(PyObject *obj, PyObject *args, PyObject *kwargs) +{ + PyObject *string, *cursor; + + if (!PyArg_ParseTuple(args, "OO", &string, &cursor)) { + return NULL; + } + + return typecast_cast(obj, + PyString_AsString(string), PyString_Size(string), + cursor); +} + +PyTypeObject typecastType = { + PyObject_HEAD_INIT(NULL) + 0, + "psycopg2._psycopg.type", + sizeof(typecastObject), + 0, + + typecast_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + typecast_cmp, /*tp_compare*/ + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash */ + + typecast_call, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + + Py_TPFLAGS_HAVE_RICHCOMPARE, /*tp_flags*/ + "psycopg type-casting object", /*tp_doc*/ + + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + + typecast_richcompare, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + + /* Attribute descriptor and subclassing stuff */ + + 0, /*tp_methods*/ + typecastObject_members, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + + 0, /*tp_init*/ + 0, /*tp_alloc will be set to PyType_GenericAlloc in module init*/ + 0, /*tp_new*/ + 0, /*tp_free Low-level free-memory routine */ + 0, /*tp_is_gc For PyObject_IS_GC */ + 0, /*tp_bases*/ + 0, /*tp_mro method resolution order */ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0 /*tp_weaklist*/ +}; + +static PyObject * +typecast_new(PyObject *name, PyObject *values, PyObject *cast, PyObject *base) +{ + typecastObject *obj; + + obj = PyObject_NEW(typecastObject, &typecastType); + if (obj == NULL) return NULL; + + Dprintf("typecast_new: new type at = %p, refcnt = %d", obj, obj->ob_refcnt); + + Py_INCREF(values); + obj->values = values; + + if (name) { + Py_INCREF(name); + obj->name = name; + } + else { + Py_INCREF(Py_None); + obj->name = Py_None; + } + + obj->pcast = NULL; + obj->ccast = NULL; + obj->bcast = base; + + if (obj->bcast) Py_INCREF(obj->bcast); + + /* FIXME: raise an exception when None is passed as Python caster */ + if (cast && cast != Py_None) { + Py_INCREF(cast); + obj->pcast = cast; + } + + Dprintf("typecast_new: typecast object created at %p", obj); + + return (PyObject *)obj; +} + +PyObject * +typecast_from_python(PyObject *self, PyObject *args, PyObject *keywds) +{ + PyObject *v, *name, *cast = NULL, *base = NULL; + + static char *kwlist[] = {"values", "name", "castobj", "baseobj", NULL}; + + if (!PyArg_ParseTupleAndKeywords(args, keywds, "O!|O!OO", kwlist, + &PyTuple_Type, &v, + &PyString_Type, &name, + &cast, &base)) { + return NULL; + } + + return typecast_new(name, v, cast, base); +} + +PyObject * +typecast_from_c(typecastObject_initlist *type, PyObject *dict) +{ + PyObject *tuple, *base = NULL; + typecastObject *obj; + int i, len = 0; + + /* before doing anything else we look for the base */ + if (type->base) { + /* NOTE: base is a borrowed reference! */ + base = PyDict_GetItemString(dict, type->base); + if (!base) { + PyErr_Format(Error, "typecast base not found: %s", type->base); + return NULL; + } + } + + while (type->values[len] != 0) len++; + + tuple = PyTuple_New(len); + if (!tuple) return NULL; + + for (i = 0; i < len ; i++) { + PyTuple_SET_ITEM(tuple, i, PyInt_FromLong(type->values[i])); + } + + + obj = (typecastObject *) + typecast_new(PyString_FromString(type->name), tuple, NULL, base); + + if (obj) { + obj->ccast = type->cast; + obj->pcast = NULL; + } + return (PyObject *)obj; +} + +PyObject * +typecast_cast(PyObject *obj, char *str, int len, PyObject *curs) +{ + PyObject *old, *res = NULL; + typecastObject *self = (typecastObject *)obj; + + /* we don't incref, the caster *can't* die at this point */ + old = ((cursorObject*)curs)->caster; + ((cursorObject*)curs)->caster = obj; + + if (self->ccast) { + res = self->ccast(str, len, curs); + } + else if (self->pcast) { + res = PyObject_CallFunction(self->pcast, "s#O", str, len, curs); + } + else { + PyErr_SetString(Error, "internal error: no casting function found"); + } + + ((cursorObject*)curs)->caster = old; + + return res; +} diff --git a/psycopg2/psycopg/typecast.h b/psycopg2/psycopg/typecast.h new file mode 100644 index 00000000..ec77e5ca --- /dev/null +++ b/psycopg2/psycopg/typecast.h @@ -0,0 +1,85 @@ +/* typecast.h - definitions for typecasters + * + * Copyright (C) 2003 Federico Di Gregorio <fog@debian.org> + * + * This file is part of psycopg. + * + * 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 the Free Software Foundation; either version 2, + * or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef PSYCOPG_TYPECAST_H +#define PSYCOPG_TYPECAST_H 1 + +#include <Python.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* type of type-casting functions (both C and Python) */ +typedef PyObject *(*typecast_function)(char *, int len, PyObject *); + +/** typecast type **/ + +extern PyTypeObject typecastType; + +typedef struct { + PyObject_HEAD + + PyObject *name; /* the name of this type */ + PyObject *values; /* the different types this instance can match */ + + typecast_function ccast; /* the C casting function */ + PyObject *pcast; /* the python casting function */ + PyObject *bcast; /* base cast, used by array typecasters */ +} typecastObject; + +/* the initialization values are stored here */ + +typedef struct { + char *name; + long int *values; + typecast_function cast; + + /* base is the base typecaster for arrays */ + char *base; +} typecastObject_initlist; + +/* the type dictionary, much faster to access it globally */ +extern PyObject *psyco_types; +extern PyObject *psyco_binary_types; + +/* the default casting objects, used when no other objects are available */ +extern PyObject *psyco_default_cast; +extern PyObject *psyco_default_binary_cast; + +/** exported functions **/ + +/* used by module.c to init the type system and register types */ +extern int typecast_init(PyObject *dict); +extern int typecast_add(PyObject *obj, int binary); + +/* the C callable typecastObject creator function */ +extern PyObject *typecast_from_c(typecastObject_initlist *type, PyObject *d); + +/* the python callable typecast creator function */ +extern PyObject *typecast_from_python( + PyObject *self, PyObject *args, PyObject *keywds); + +/* the function used to dispatch typecasting calls */ +extern PyObject *typecast_cast( + PyObject *self, char *str, int len, PyObject *curs); + +#endif /* !defined(PSYCOPG_TYPECAST_H) */ diff --git a/psycopg2/psycopg/typecast_array.c b/psycopg2/psycopg/typecast_array.c new file mode 100644 index 00000000..7dcb3a3d --- /dev/null +++ b/psycopg2/psycopg/typecast_array.c @@ -0,0 +1,258 @@ +/* typecast_array.c - array typecasters + * + * Copyright (C) 2005 Federico Di Gregorio <fog@debian.org> + * + * This file is part of the psycopg module. + * + * 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 the Free Software Foundation; either version 2, + * or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#define MAX_DIMENSIONS 16 + +/** typecast_array_cleanup - remove the horrible [...]= stuff **/ + +static int +typecast_array_cleanup(char **str, int *len) +{ + int i, depth = 1; + + if ((*str)[0] != '[') return -1; + + for (i=1 ; depth > 0 && i < *len ; i++) { + if ((*str)[i] == '[') + depth += 1; + else if ((*str)[i] == ']') + depth -= 1; + } + if ((*str)[i] != '=') return -1; + + *str = &((*str)[i+1]); + *len = *len - i - 1; + return 0; +} + +/** typecast_array_scan - scan a string looking for array items **/ + +#define ASCAN_ERROR -1 +#define ASCAN_EOF 0 +#define ASCAN_BEGIN 1 +#define ASCAN_END 2 +#define ASCAN_TOKEN 3 +#define ASCAN_QUOTED 4 + +static int +typecast_array_tokenize(char *str, int strlength, + int *pos, char** token, int *length) +{ + /* FORTRAN glory */ + int i, j, q, b, l, res; + + Dprintf("typecast_array_tokenize: '%s', %d/%d", + &str[*pos], *pos, strlength); + + /* we always get called with pos pointing at the start of a token, so a + fast check is enough for ASCAN_EOF, ASCAN_BEGIN and ASCAN_END */ + if (*pos == strlength) { + return ASCAN_EOF; + } + else if (str[*pos] == '{') { + *pos += 1; + return ASCAN_BEGIN; + } + else if (str[*pos] == '}') { + *pos += 1; + if (str[*pos] == ',') + *pos += 1; + return ASCAN_END; + } + + /* now we start looking for the first unquoted ',' or '}', the only two + tokens that can limit an array element */ + q = 0; /* if q is odd we're inside quotes */ + b = 0; /* if b is 1 we just encountered a backslash */ + res = ASCAN_TOKEN; + + for (i = *pos ; i < strlength ; i++) { + switch (str[i]) { + case '"': + if (b == 0) + q += 1; + else + b = 0; + break; + + case '\\': + res = ASCAN_QUOTED; + if (b == 0) + b = 1; + else + /* we're backslashing a backslash */ + b = 0; + break; + + case '}': + case ',': + if (b == 0 && ((q&1) == 0)) + goto tokenize; + break; + + default: + /* reset the backslash counter */ + b = 0; + break; + } + } + + tokenize: + /* remove initial quoting character and calculate raw length */ + l = i - *pos; + if (str[*pos] == '"') { + *pos += 1; + l -= 2; + } + + if (res == ASCAN_QUOTED) { + char *buffer = PyMem_Malloc(l+1); + if (buffer == NULL) return ASCAN_ERROR; + + *token = buffer; + + for (j = *pos; j < *pos+l; j++) { + if (str[j] != '\\' + || (j > *pos && str[j-1] == '\\')) + *(buffer++) = str[j]; + } + + *buffer = '\0'; + *length = buffer - *token; + } + else { + *token = &str[*pos]; + *length = l; + } + + *pos = i; + + /* skip the comma and set position to the start of next token */ + if (str[i] == ',') *pos += 1; + + return res; +} + +static int +typecast_array_scan(char *str, int strlength, + PyObject *curs, PyObject *base, PyObject *array) +{ + int state, length = 0, pos = 0; + char *token; + + PyObject *stack[MAX_DIMENSIONS]; + int stack_index = 0; + + while (1) { + token = NULL; + state = typecast_array_tokenize(str, strlength, &pos, &token, &length); + Dprintf("typecast_array_scan: state = %d, length = %d, token = '%s'", + state, length, token); + if (state == ASCAN_TOKEN || state == ASCAN_QUOTED) { + PyObject *obj = typecast_cast(base, token, length, curs); + + /* before anything else we free the memory */ + if (state == ASCAN_QUOTED) PyMem_Free(token); + if (obj == NULL) return 0; + + PyList_Append(array, obj); + Py_DECREF(obj); + } + + else if (state == ASCAN_BEGIN) { + PyObject *sub = PyList_New(0); + if (sub == NULL) return 0; + + PyList_Append(array, sub); + Py_DECREF(sub); + + if (stack_index == MAX_DIMENSIONS) + return 0; + + stack[stack_index++] = array; + array = sub; + } + + else if (state == ASCAN_ERROR) { + return 0; + } + + else if (state == ASCAN_END) { + if (--stack_index < 0) + return 0; + array = stack[stack_index]; + } + + else if (state == ASCAN_EOF) + break; + } + + return 1; +} + + +/** GENERIC - a generic typecaster that can be used when no special actions + have to be taken on the single items **/ + +static PyObject * +typecast_GENERIC_ARRAY_cast(char *str, int len, PyObject *curs) +{ + PyObject *obj = NULL; + PyObject *base = ((typecastObject*)((cursorObject*)curs)->caster)->bcast; + + Dprintf("typecast_GENERIC_ARRAY_cast: str = '%s', len = %d", str, len); + + if (str == NULL) {Py_INCREF(Py_None); return Py_None;} + if (str[0] == '[') + typecast_array_cleanup(&str, &len); + if (str[0] != '{') { + PyErr_SetString(Error, "array does not start with '{'"); + return NULL; + } + + Dprintf("typecast_GENERIC_ARRAY_cast: str = '%s', len = %d", str, len); + + obj = PyList_New(0); + + /* scan the array skipping the first level of {} */ + if (typecast_array_scan(&str[1], len-2, curs, base, obj) == 0) { + Py_DECREF(obj); + obj = NULL; + } + + return obj; +} + +/** almost all the basic array typecasters are derived from GENERIC **/ + +#define typecast_LONGINTEGERARRAY_cast typecast_GENERIC_ARRAY_cast +#define typecast_INTEGERARRAY_cast typecast_GENERIC_ARRAY_cast +#define typecast_FLOATARRAY_cast typecast_GENERIC_ARRAY_cast +#define typecast_DECIMALARRAY_cast typecast_GENERIC_ARRAY_cast +#define typecast_STRINGARRAY_cast typecast_GENERIC_ARRAY_cast +#define typecast_UNICODEARRAY_cast typecast_GENERIC_ARRAY_cast +#define typecast_BOOLEANARRAY_cast typecast_GENERIC_ARRAY_cast +#define typecast_DATETIMEARRAY_cast typecast_GENERIC_ARRAY_cast +#define typecast_DATEARRAY_cast typecast_GENERIC_ARRAY_cast +#define typecast_TIMEARRAY_cast typecast_GENERIC_ARRAY_cast +#define typecast_INTERVALARRAY_cast typecast_GENERIC_ARRAY_cast +#define typecast_BINARYARRAY_cast typecast_GENERIC_ARRAY_cast +#define typecast_ROWIDARRAY_cast typecast_GENERIC_ARRAY_cast diff --git a/psycopg2/psycopg/typecast_basic.c b/psycopg2/psycopg/typecast_basic.c new file mode 100644 index 00000000..e9ac7f49 --- /dev/null +++ b/psycopg2/psycopg/typecast_basic.c @@ -0,0 +1,141 @@ +/* pgcasts_basic.c - basic typecasting functions to python types + * + * Copyright (C) 2001-2003 Federico Di Gregorio <fog@debian.org> + * + * This file is part of the psycopg module. + * + * 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 the Free Software Foundation; either version 2, + * or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/** INTEGER - cast normal integers (4 bytes) to python int **/ + +static PyObject * +typecast_INTEGER_cast(char *s, int len, PyObject *curs) +{ + char buffer[12]; + + if (s == NULL) {Py_INCREF(Py_None); return Py_None;} + if (s[len] != '\0') { + strncpy(buffer, s, len); buffer[len] = '\0'; + s = buffer; + } + return PyInt_FromString(s, NULL, 0); +} + +/** LONGINTEGER - cast long integers (8 bytes) to python long **/ + +static PyObject * +typecast_LONGINTEGER_cast(char *s, int len, PyObject *curs) +{ + char buffer[24]; + + if (s == NULL) {Py_INCREF(Py_None); return Py_None;} + if (s[len] != '\0') { + strncpy(buffer, s, len); buffer[len] = '\0'; + s = buffer; + } + return PyLong_FromString(s, NULL, 0); +} + +/** FLOAT - cast floating point numbers to python float **/ + +static PyObject * +typecast_FLOAT_cast(char *s, int len, PyObject *curs) +{ + PyObject *str = NULL, *flo = NULL; + char *pend; + + if (s == NULL) {Py_INCREF(Py_None); return Py_None;} + str = PyString_FromStringAndSize(s, len); + flo = PyFloat_FromString(str, &pend); + Py_DECREF(str); + return flo; +} + +/** STRING - cast strings of any type to python string **/ + +static PyObject * +typecast_STRING_cast(char *s, int len, PyObject *curs) +{ + if (s == NULL) {Py_INCREF(Py_None); return Py_None;} + return PyString_FromStringAndSize(s, len); +} + +/** UNICODE - cast strings of any type to a python unicode object **/ + +static PyObject * +typecast_UNICODE_cast(char *s, int len, PyObject *curs) +{ + PyObject *enc; + + if (s == NULL) {Py_INCREF(Py_None); return Py_None;} + + enc = PyDict_GetItemString(psycoEncodings, + ((cursorObject*)curs)->conn->encoding); + if (enc) { + return PyUnicode_Decode(s, len, PyString_AsString(enc), NULL); + } + else { + PyErr_Format(InterfaceError, + "can't decode into unicode string from %s", + ((cursorObject*)curs)->conn->encoding); + return NULL; + } +} + +/** BOOLEAN - cast boolean value into right python object **/ + +static PyObject * +typecast_BOOLEAN_cast(char *s, int len, PyObject *curs) +{ + PyObject *res; + + if (s == NULL) {Py_INCREF(Py_None); return Py_None;} + + if (s[0] == 't') + res = Py_True; + else + res = Py_False; + + Py_INCREF(res); + return res; +} + +/** DECIMAL - cast any kind of number into a Python Decimal object **/ + +#ifdef HAVE_DECIMAL +static PyObject * +typecast_DECIMAL_cast(char *s, int len, PyObject *curs) +{ + PyObject *res = NULL; + char *buffer; + + if (s == NULL) {Py_INCREF(Py_None); return Py_None;} + + if ((buffer = PyMem_Malloc(len+1)) == NULL) + PyErr_NoMemory(); + strncpy(buffer, s, len); buffer[len] = '\0'; + res = PyObject_CallFunction(decimalType, "s", buffer); + PyMem_Free(buffer); + + return res; +} +#else +#define typecast_DECIMAL_cast typecast_FLOAT_cast +#endif + +/* some needed aliases */ +#define typecast_NUMBER_cast typecast_FLOAT_cast +#define typecast_ROWID_cast typecast_INTEGER_cast diff --git a/psycopg2/psycopg/typecast_binary.c b/psycopg2/psycopg/typecast_binary.c new file mode 100644 index 00000000..d490bc70 --- /dev/null +++ b/psycopg2/psycopg/typecast_binary.c @@ -0,0 +1,191 @@ +/* typecast_binary.c - binary typecasting functions to python types + * + * Copyright (C) 2001-2003 Federico Di Gregorio <fog@debian.org> + * + * This file is part of the psycopg module. + * + * 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 the Free Software Foundation; either version 2, + * or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include "typecast_binary.h" + +#include <libpq-fe.h> +#include <stdlib.h> + + +/* Python object holding a memory chunk. The memory is deallocated when + the object is destroyed. This type is used to let users directly access + memory chunks holding unescaped binary data through the buffer interface. + */ + +static void +chunk_dealloc(chunkObject *self) +{ + Dprintf("chunk_dealloc: deallocating memory at %p, size %d", + self->base, self->len); + free(self->base); + self->ob_type->tp_free((PyObject *) self); +} + +static PyObject * +chunk_repr(chunkObject *self) +{ + return PyString_FromFormat("<memory chunk at %p size %d>", + self->base, self->len); +} + +static int +chunk_getreadbuffer(chunkObject *self, int segment, void **ptr) +{ + if (segment != 0) + { + PyErr_SetString(PyExc_SystemError, + "acessing non-existant buffer segment"); + return -1; + } + *ptr = self->base; + return self->len; +} + +static int +chunk_getsegcount(chunkObject *self, int *lenp) +{ + if (lenp != NULL) + *lenp = self->len; + return 1; +} + +static PyBufferProcs chunk_as_buffer = +{ + (getreadbufferproc) chunk_getreadbuffer, + (getwritebufferproc) NULL, + (getsegcountproc) chunk_getsegcount, + (getcharbufferproc) NULL +}; + +#define chunk_doc "memory chunk" + +PyTypeObject chunkType = { + PyObject_HEAD_INIT(NULL) + 0, /* ob_size */ + "psycopg2._psycopg.chunk", /* tp_name */ + sizeof(chunkObject), /* tp_basicsize */ + 0, /* tp_itemsize */ + (destructor) chunk_dealloc, /* tp_dealloc*/ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_compare */ + (reprfunc) chunk_repr, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + &chunk_as_buffer, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */ + chunk_doc /* tp_doc */ +}; + +/* the function typecast_BINARY_cast_unescape is used when libpq does not + provide PQunescapeBytea: it convert all the \xxx octal sequences to the + proper byte value */ + +#ifdef PSYCOPG_OWN_QUOTING +static unsigned char * +typecast_BINARY_cast_unescape(unsigned char *str, size_t *to_length) +{ + char *dstptr, *dststr; + int len, i; + + len = strlen(str); + dststr = (char*)calloc(len, sizeof(char)); + dstptr = dststr; + + if (dststr == NULL) return NULL; + + Py_BEGIN_ALLOW_THREADS; + + for (i = 0; i < len; i++) { + if (str[i] == '\\') { + if ( ++i < len) { + if (str[i] == '\\') { + *dstptr = '\\'; + } + else { + *dstptr = 0; + *dstptr |= (str[i++] & 7) << 6; + *dstptr |= (str[i++] & 7) << 3; + *dstptr |= (str[i] & 7); + } + } + } + else { + *dstptr = str[i]; + } + dstptr++; + } + + Py_END_ALLOW_THREADS; + + *to_length = (size_t)(dstptr-dststr); + + return dststr; +} + +#define PQunescapeBytea typecast_BINARY_cast_unescape +#endif + +static PyObject * +typecast_BINARY_cast(char *s, int l, PyObject *curs) +{ + chunkObject *chunk; + PyObject *res; + char *str, *buffer = NULL; + size_t len; + + if (s == NULL) {Py_INCREF(Py_None); return Py_None;} + + /* PQunescapeBytea absolutely wants a 0-terminated string and we don't + want to copy the whole buffer, right? Wrong, but there isn't any other + way <g> */ + if (s[l] != '\0') { + if ((buffer = PyMem_Malloc(l+1)) == NULL) + PyErr_NoMemory(); + strncpy(buffer, s, l); + buffer[l] = '\0'; + s = buffer; + } + str = (char*)PQunescapeBytea((unsigned char*)s, &len); + Dprintf("typecast_BINARY_cast: unescaped %d bytes", len); + if (buffer) PyMem_Free(buffer); + + chunk = (chunkObject *) PyObject_New(chunkObject, &chunkType); + if (chunk == NULL) return NULL; + + chunk->base = str; + chunk->len = len; + if ((res = PyBuffer_FromObject((PyObject *)chunk, 0, len)) == NULL) + return NULL; + + /* PyBuffer_FromObject() created a new reference. Release our reference so + that the memory can be freed once the buffer is garbage collected. */ + Py_DECREF(chunk); + + return res; +} diff --git a/psycopg2/psycopg/typecast_binary.h b/psycopg2/psycopg/typecast_binary.h new file mode 100644 index 00000000..cf985bb0 --- /dev/null +++ b/psycopg2/psycopg/typecast_binary.h @@ -0,0 +1,47 @@ +/* typecast_binary.h - definitions for binary typecaster + * + * Copyright (C) 2003 Federico Di Gregorio <fog@debian.org> + * + * This file is part of psycopg. + * + * 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 the Free Software Foundation; either version 2, + * or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef PSYCOPG_TYPECAST_BINARY_H +#define PSYCOPG_TYPECAST_BINARY_H 1 + +#include <Python.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/** chunk type **/ + +extern PyTypeObject chunkType; + +typedef struct { + PyObject_HEAD + + void *base; /* Pointer to the memory chunk. */ + int len; /* Size in bytes of the memory chunk. */ + +} chunkObject; + +#ifdef __cplusplus +} +#endif + +#endif /* !defined(PSYCOPG_TYPECAST_BINARY_H) */ diff --git a/psycopg2/psycopg/typecast_builtins.c b/psycopg2/psycopg/typecast_builtins.c new file mode 100644 index 00000000..0fc109d8 --- /dev/null +++ b/psycopg2/psycopg/typecast_builtins.c @@ -0,0 +1,60 @@ +static long int typecast_NUMBER_types[] = {20, 23, 21, 701, 700, 1700, 0}; +static long int typecast_LONGINTEGER_types[] = {20, 0}; +static long int typecast_INTEGER_types[] = {23, 21, 0}; +static long int typecast_FLOAT_types[] = {701, 700, 0}; +static long int typecast_DECIMAL_types[] = {1700, 0}; +static long int typecast_UNICODE_types[] = {19, 18, 25, 1042, 1043, 0}; +static long int typecast_STRING_types[] = {19, 18, 25, 1042, 1043, 0}; +static long int typecast_BOOLEAN_types[] = {16, 0}; +static long int typecast_DATETIME_types[] = {1114, 1184, 704, 1186, 0}; +static long int typecast_TIME_types[] = {1083, 1266, 0}; +static long int typecast_DATE_types[] = {1082, 0}; +static long int typecast_INTERVAL_types[] = {704, 1186, 0}; +static long int typecast_BINARY_types[] = {17, 0}; +static long int typecast_ROWID_types[] = {26, 0}; +static long int typecast_LONGINTEGERARRAY_types[] = {1016, 0}; +static long int typecast_INTEGERARRAY_types[] = {1005, 1006, 1007, 0}; +static long int typecast_FLOATARRAY_types[] = {1017, 1021, 1022, 0}; +static long int typecast_DECIMALARRAY_types[] = {1231, 0}; +static long int typecast_UNICODEARRAY_types[] = {1002, 1003, 1009, 1014, 1015, 0}; +static long int typecast_STRINGARRAY_types[] = {1002, 1003, 1009, 1014, 1015, 0}; +static long int typecast_BOOLEANARRAY_types[] = {1000, 0}; +static long int typecast_DATETIMEARRAY_types[] = {1115, 1185, 0}; +static long int typecast_TIMEARRAY_types[] = {1183, 1270, 0}; +static long int typecast_DATEARRAY_types[] = {1182, 0}; +static long int typecast_INTERVALARRAY_types[] = {1187, 0}; +static long int typecast_BINARYARRAY_types[] = {1001, 0}; +static long int typecast_ROWIDARRAY_types[] = {1028, 1013, 0}; + + +typecastObject_initlist typecast_builtins[] = { + {"NUMBER", typecast_NUMBER_types, typecast_NUMBER_cast, NULL}, + {"LONGINTEGER", typecast_LONGINTEGER_types, typecast_LONGINTEGER_cast, NULL}, + {"INTEGER", typecast_INTEGER_types, typecast_INTEGER_cast, NULL}, + {"FLOAT", typecast_FLOAT_types, typecast_FLOAT_cast, NULL}, + {"DECIMAL", typecast_DECIMAL_types, typecast_DECIMAL_cast, NULL}, + {"UNICODE", typecast_UNICODE_types, typecast_UNICODE_cast, NULL}, + {"STRING", typecast_STRING_types, typecast_STRING_cast, NULL}, + {"BOOLEAN", typecast_BOOLEAN_types, typecast_BOOLEAN_cast, NULL}, + {"DATETIME", typecast_DATETIME_types, typecast_DATETIME_cast, NULL}, + {"TIME", typecast_TIME_types, typecast_TIME_cast, NULL}, + {"DATE", typecast_DATE_types, typecast_DATE_cast, NULL}, + {"INTERVAL", typecast_INTERVAL_types, typecast_INTERVAL_cast, NULL}, + {"BINARY", typecast_BINARY_types, typecast_BINARY_cast, NULL}, + {"ROWID", typecast_ROWID_types, typecast_ROWID_cast, NULL}, + {"LONGINTEGERARRAY", typecast_LONGINTEGERARRAY_types, typecast_LONGINTEGERARRAY_cast, "LONGINTEGER"}, + {"INTEGERARRAY", typecast_INTEGERARRAY_types, typecast_INTEGERARRAY_cast, "INTEGER"}, + {"FLOATARRAY", typecast_FLOATARRAY_types, typecast_FLOATARRAY_cast, "FLOAT"}, + {"DECIMALARRAY", typecast_DECIMALARRAY_types, typecast_DECIMALARRAY_cast, "DECIMAL"}, + {"UNICODEARRAY", typecast_UNICODEARRAY_types, typecast_UNICODEARRAY_cast, "UNICODE"}, + {"STRINGARRAY", typecast_STRINGARRAY_types, typecast_STRINGARRAY_cast, "STRING"}, + {"BOOLEANARRAY", typecast_BOOLEANARRAY_types, typecast_BOOLEANARRAY_cast, "BOOLEAN"}, + {"DATETIMEARRAY", typecast_DATETIMEARRAY_types, typecast_DATETIMEARRAY_cast, "DATETIME"}, + {"TIMEARRAY", typecast_TIMEARRAY_types, typecast_TIMEARRAY_cast, "TIME"}, + {"DATEARRAY", typecast_DATEARRAY_types, typecast_DATEARRAY_cast, "DATE"}, + {"INTERVALARRAY", typecast_INTERVALARRAY_types, typecast_INTERVALARRAY_cast, "INTERVAL"}, + {"BINARYARRAY", typecast_BINARYARRAY_types, typecast_BINARYARRAY_cast, "BINARY"}, + {"ROWIDARRAY", typecast_ROWIDARRAY_types, typecast_ROWIDARRAY_cast, "ROWID"}, + {NULL, NULL, NULL, NULL} +}; + diff --git a/psycopg2/psycopg/typecast_datetime.c b/psycopg2/psycopg/typecast_datetime.c new file mode 100644 index 00000000..3a09f07a --- /dev/null +++ b/psycopg2/psycopg/typecast_datetime.c @@ -0,0 +1,279 @@ +/* typecast_datetime.c - date and time typecasting functions to python types + * + * Copyright (C) 2001-2003 Federico Di Gregorio <fog@debian.org> + * + * This file is part of the psycopg module. + * + * 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 the Free Software Foundation; either version 2, + * or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include <math.h> +#include "datetime.h" + + +/* the pointer to the datetime module API is initialized by the module init + code, we just need to grab it */ +extern PyObject* pyDateTimeModuleP; +extern PyObject *pyDateTypeP; +extern PyObject *pyTimeTypeP; +extern PyObject *pyDateTimeTypeP; +extern PyObject *pyDeltaTypeP; + +/** DATE - cast a date into a date python object **/ + +static PyObject * +typecast_PYDATE_cast(char *str, int len, PyObject *curs) +{ + PyObject* obj = NULL; + int n, y=0, m=0, d=0; + + if (str == NULL) {Py_INCREF(Py_None); return Py_None;} + + if (!strcmp(str, "infinity") || !strcmp(str, "-infinity")) { + if (str[0] == '-') { + obj = PyObject_GetAttrString(pyDateTypeP, "min"); + } + else { + obj = PyObject_GetAttrString(pyDateTypeP, "max"); + } + } + + else { + n = typecast_parse_date(str, NULL, &len, &y, &m, &d); + Dprintf("typecast_PYDATE_cast: " + "n = %d, len = %d, y = %d, m = %d, d = %d", + n, len, y, m, d); + if (n != 3) { + PyErr_SetString(DataError, "unable to parse date"); + } + else { + obj = PyObject_CallFunction(pyDateTypeP, "iii", y, m, d); + } + } + return obj; +} + +/** DATETIME - cast a timestamp into a datetime python object **/ + +static PyObject * +typecast_PYDATETIME_cast(char *str, int len, PyObject *curs) +{ + PyObject* obj = NULL; + int n, y=0, m=0, d=0; + int hh=0, mm=0, ss=0, us=0, tz=0; + char *tp = NULL; + + if (str == NULL) {Py_INCREF(Py_None); return Py_None;} + + /* check for infinity */ + if (!strcmp(str, "infinity") || !strcmp(str, "-infinity")) { + if (str[0] == '-') { + obj = PyObject_GetAttrString(pyDateTimeTypeP, "min"); + } + else { + obj = PyObject_GetAttrString(pyDateTimeTypeP, "max"); + } + } + + else { + Dprintf("typecast_PYDATETIME_cast: s = %s", str); + n = typecast_parse_date(str, &tp, &len, &y, &m, &d); + Dprintf("typecast_PYDATE_cast: tp = %p " + "n = %d, len = %d, y = %d, m = %d, d = %d", + tp, n, len, y, m, d); + if (n != 3) { + PyErr_SetString(DataError, "unable to parse date"); + } + + if (len > 0) { + n = typecast_parse_time(tp, NULL, &len, &hh, &mm, &ss, &us, &tz); + Dprintf("typecast_PYDATETIME_cast: n = %d, len = %d, " + "hh = %d, mm = %d, ss = %d, us = %d, tz = %d", + n, len, hh, mm, ss, us, tz); + if (n < 3 || n > 5) { + PyErr_SetString(DataError, "unable to parse time"); + } + } + + if (ss > 59) { + mm += 1; + ss -= 60; + } + + if (n == 5 && ((cursorObject*)curs)->tzinfo_factory != Py_None) { + /* we have a time zone, calculate minutes and create + appropriate tzinfo object calling the factory */ + PyObject *tzinfo; + Dprintf("typecast_PYDATETIME_cast: UTC offset = %dm", tz); + tzinfo = PyObject_CallFunction( + ((cursorObject*)curs)->tzinfo_factory, "i", tz); + obj = PyObject_CallFunction(pyDateTimeTypeP, "iiiiiiiO", + y, m, d, hh, mm, ss, us, tzinfo); + Dprintf("typecast_PYDATETIME_cast: tzinfo: %p, refcnt = %d", + tzinfo, tzinfo->ob_refcnt); + Py_XDECREF(tzinfo); + } + else { + obj = PyObject_CallFunction(pyDateTimeTypeP, "iiiiiii", + y, m, d, hh, mm, ss, us); + } + } + return obj; +} + +/** TIME - parse time into a time object **/ + +static PyObject * +typecast_PYTIME_cast(char *str, int len, PyObject *curs) +{ + PyObject* obj = NULL; + int n, hh=0, mm=0, ss=0, us=0, tz=0; + + if (str == NULL) {Py_INCREF(Py_None); return Py_None;} + + n = typecast_parse_time(str, NULL, &len, &hh, &mm, &ss, &us, &tz); + Dprintf("typecast_PYTIME_cast: n = %d, len = %d, " + "hh = %d, mm = %d, ss = %d, us = %d, tz = %d", + n, len, hh, mm, ss, us, tz); + + if (n < 3 || n > 5) { + PyErr_SetString(DataError, "unable to parse time"); + } + else { + if (ss > 59) { + mm += 1; + ss -= 60; + } + obj = PyObject_CallFunction(pyTimeTypeP, "iiii", hh, mm, ss, us); + } + return obj; +} + +/** INTERVAL - parse an interval into a timedelta object **/ + +static PyObject * +typecast_PYINTERVAL_cast(char *str, int len, PyObject *curs) +{ + long years = 0, months = 0, days = 0; + double hours = 0.0, minutes = 0.0, seconds = 0.0, hundredths = 0.0; + double v = 0.0, sign = 1.0, denominator = 1.0; + int part = 0, sec; + double micro; + + if (str == NULL) {Py_INCREF(Py_None); return Py_None;} + + Dprintf("typecast_PYINTERVAL_cast: s = %s", str); + + while (len-- > 0 && *str) { + switch (*str) { + + case '-': + sign = -1.0; + break; + + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + v = v*10 + (double)*str - (double)'0'; + if (part == 6){ + denominator *= 10; + } + break; + + case 'y': + if (part == 0) { + years = (long)(v*sign); + str = skip_until_space2(str, &len); + v = 0.0; sign = 1.0; part = 1; + } + break; + + case 'm': + if (part <= 1) { + months = (long)(v*sign); + str = skip_until_space2(str, &len); + v = 0.0; sign = 1.0; part = 2; + } + break; + + case 'd': + if (part <= 2) { + days = (long)(v*sign); + str = skip_until_space2(str, &len); + v = 0.0; sign = 1.0; part = 3; + } + break; + + case ':': + if (part <= 3) { + hours = v; + v = 0.0; part = 4; + } + else if (part == 4) { + minutes = v; + v = 0.0; part = 5; + } + break; + + case '.': + if (part == 5) { + seconds = v; + v = 0.0; part = 6; + } + break; + + default: + break; + } + + str++; + } + + /* manage last value, be it minutes or seconds or hundredths of a second */ + if (part == 4) { + minutes = v; + } + else if (part == 5) { + seconds = v; + } + else if (part == 6) { + hundredths = v; + hundredths = hundredths/denominator; + } + + /* calculates seconds */ + if (sign < 0.0) { + seconds = - (hundredths + seconds + minutes*60 + hours*3600); + } + else { + seconds += hundredths + minutes*60 + hours*3600; + } + + /* calculates days */ + days += years*365 + months*30; + + micro = (seconds - floor(seconds)) * 1000000.0; + sec = (int)floor(seconds); + return PyObject_CallFunction(pyDeltaTypeP, "iii", + days, sec, (int)round(micro)); +} + +/* psycopg defaults to using python datetime types */ + +#ifdef PSYCOPG_DEFAULT_PYDATETIME +#define typecast_DATE_cast typecast_PYDATE_cast +#define typecast_TIME_cast typecast_PYTIME_cast +#define typecast_INTERVAL_cast typecast_PYINTERVAL_cast +#define typecast_DATETIME_cast typecast_PYDATETIME_cast +#endif diff --git a/psycopg2/psycopg/typecast_mxdatetime.c b/psycopg2/psycopg/typecast_mxdatetime.c new file mode 100644 index 00000000..52b1ce7f --- /dev/null +++ b/psycopg2/psycopg/typecast_mxdatetime.c @@ -0,0 +1,231 @@ +/* typecast_mxdatetime.c - date and time typecasting functions to mx types + * + * Copyright (C) 2001-2003 Federico Di Gregorio <fog@debian.org> + * + * This file is part of the psycopg module. + * + * 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 the Free Software Foundation; either version 2, + * or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include "mxDateTime.h" + +/* the pointer to the mxDateTime API is initialized by the module init code, + we just need to grab it */ +extern mxDateTimeModule_APIObject *mxDateTimeP; + +/** DATE - cast a date into mx.DateTime python object **/ + +static PyObject * +typecast_MXDATE_cast(char *str, int len, PyObject *curs) +{ + int n, y=0, m=0, d=0; + int hh=0, mm=0, ss=0, us=0, tz=0; + char *tp = NULL; + + if (str == NULL) {Py_INCREF(Py_None); return Py_None;} + + Dprintf("typecast_MXDATE_cast: s = %s", str); + + /* check for infinity */ + if (!strcmp(str, "infinity") || !strcmp(str, "-infinity")) { + if (str[0] == '-') { + return mxDateTimeP->DateTime_FromDateAndTime(-999998,1,1, 0,0,0); + } + else { + return mxDateTimeP->DateTime_FromDateAndTime(999999,12,31, 0,0,0); + } + } + + n = typecast_parse_date(str, &tp, &len, &y, &m, &d); + Dprintf("typecast_MXDATE_cast: tp = %p n = %d, len = %d, " + "y = %d, m = %d, d = %d", tp, n, len, y, m, d); + if (n != 3) { + PyErr_SetString(DataError, "unable to parse date"); + } + + if (len > 0) { + n = typecast_parse_time(tp, NULL, &len, &hh, &mm, &ss, &us, &tz); + Dprintf("typecast_MXDATE_cast: n = %d, len = %d, " + "hh = %d, mm = %d, ss = %d, us = %d, tz = %d", + n, len, hh, mm, ss, us, tz); + if (n < 3 || n > 5) { + PyErr_SetString(DataError, "unable to parse time"); + } + } + + Dprintf("typecast_MXDATE_cast: fractionary seconds: %lf", + (double)ss + (double)us/(double)1000000.0); + return mxDateTimeP->DateTime_FromDateAndTime(y, m, d, hh, mm, + (double)ss + (double)us/(double)1000000.0); +} + +/** TIME - parse time into an mx.DateTime object **/ + +static PyObject * +typecast_MXTIME_cast(char *str, int len, PyObject *curs) +{ + int n, hh=0, mm=0, ss=0, us=0, tz=0; + + if (str == NULL) {Py_INCREF(Py_None); return Py_None;} + + Dprintf("typecast_MXTIME_cast: s = %s", str); + + n = typecast_parse_time(str, NULL, &len, &hh, &mm, &ss, &us, &tz); + Dprintf("typecast_MXTIME_cast: time parsed, %d components", n); + Dprintf("typecast_MXTIME_cast: hh = %d, mm = %d, ss = %d, us = %d", + hh, mm, ss, us); + + if (n < 3 || n > 5) { + PyErr_SetString(DataError, "unable to parse time"); + return NULL; + } + + Dprintf("typecast_MXTIME_cast: fractionary seconds: %lf", + (double)ss + (double)us/(double)1000000.0); + return mxDateTimeP->DateTimeDelta_FromTime(hh, mm, + (double)ss + (double)us/(double)1000000.0); +} + +/** INTERVAL - parse an interval into an mx.DateTimeDelta **/ + +static PyObject * +typecast_MXINTERVAL_cast(char *str, int len, PyObject *curs) +{ + long years = 0, months = 0, days = 0, denominator = 1; + double hours = 0.0, minutes = 0.0, seconds = 0.0, hundredths = 0.0; + double v = 0.0, sign = 1.0; + int part = 0; + + if (str == NULL) {Py_INCREF(Py_None); return Py_None;} + + Dprintf("typecast_MXINTERVAL_cast: s = %s", str); + + while (*str) { + switch (*str) { + + case '-': + sign = -1.0; + break; + + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + v = v*10 + (double)*str - (double)'0'; + Dprintf("typecast_MXINTERVAL_cast: v = %f", v); + if (part == 6){ + denominator *= 10; + Dprintf("typecast_MXINTERVAL_cast: denominator = %ld", + denominator); + } + break; + + case 'y': + if (part == 0) { + years = (long)(v*sign); + str = skip_until_space(str); + Dprintf("typecast_MXINTERVAL_cast: years = %ld, rest = %s", + years, str); + v = 0.0; sign = 1.0; part = 1; + } + break; + + case 'm': + if (part <= 1) { + months = (long)(v*sign); + str = skip_until_space(str); + Dprintf("typecast_MXINTERVAL_cast: months = %ld, rest = %s", + months, str); + v = 0.0; sign = 1.0; part = 2; + } + break; + + case 'd': + if (part <= 2) { + days = (long)(v*sign); + str = skip_until_space(str); + Dprintf("typecast_MXINTERVAL_cast: days = %ld, rest = %s", + days, str); + v = 0.0; sign = 1.0; part = 3; + } + break; + + case ':': + if (part <= 3) { + hours = v; + Dprintf("typecast_MXINTERVAL_cast: hours = %f", hours); + v = 0.0; part = 4; + } + else if (part == 4) { + minutes = v; + Dprintf("typecast_MXINTERVAL_cast: minutes = %f", minutes); + v = 0.0; part = 5; + } + break; + + case '.': + if (part == 5) { + seconds = v; + Dprintf("typecast_MXINTERVAL_cast: seconds = %f", seconds); + v = 0.0; part = 6; + } + break; + + default: + break; + } + + str++; + } + + /* manage last value, be it minutes or seconds or hundredths of a second */ + if (part == 4) { + minutes = v; + Dprintf("typecast_MXINTERVAL_cast: minutes = %f", minutes); + } + else if (part == 5) { + seconds = v; + Dprintf("typecast_MXINTERVAL_cast: seconds = %f", seconds); + } + else if (part == 6) { + hundredths = v; + Dprintf("typecast_MXINTERVAL_cast: hundredths = %f", hundredths); + hundredths = hundredths/denominator; + Dprintf("typecast_MXINTERVAL_cast: fractions = %.20f", hundredths); + } + + /* calculates seconds */ + if (sign < 0.0) { + seconds = - (hundredths + seconds + minutes*60 + hours*3600); + } + else { + seconds += hundredths + minutes*60 + hours*3600; + } + + /* calculates days */ + days += years*365 + months*30; + + Dprintf("typecast_MXINTERVAL_cast: days = %ld, seconds = %f", + days, seconds); + return mxDateTimeP->DateTimeDelta_FromDaysAndSeconds(days, seconds); +} + +/* psycopg defaults to using mx types */ + +#ifdef PSYCOPG_DEFAULT_MXDATETIME +#define typecast_DATE_cast typecast_MXDATE_cast +#define typecast_TIME_cast typecast_MXTIME_cast +#define typecast_INTERVAL_cast typecast_MXINTERVAL_cast +#define typecast_DATETIME_cast typecast_MXDATE_cast +#endif + diff --git a/psycopg2/scripts/buildtypes.py b/psycopg2/scripts/buildtypes.py new file mode 100644 index 00000000..197272fd --- /dev/null +++ b/psycopg2/scripts/buildtypes.py @@ -0,0 +1,124 @@ +# -*- python -*- +# +# Copyright (C) 2001-2003 Federico Di Gregorio <fog@debian.org> +# +# This file is part of the psycopg module. +# +# 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 the Free Software Foundation; either version 2, +# or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +# this a little script that analyze a file with (TYPE, NUMBER) tuples +# and write out C code ready for inclusion in psycopg. the generated +# code defines the DBAPITypeObject fundamental types and warns for +# undefined types. + +import sys, os, string, copy +from string import split, join, strip + + +# here is the list of the foundamental types we want to import from +# postgresql header files + +basic_types = (['NUMBER', ['INT8', 'INT4', 'INT2', 'FLOAT8', 'FLOAT4', + 'NUMERIC']], + ['LONGINTEGER', ['INT8']], + ['INTEGER', ['INT4', 'INT2']], + ['FLOAT', ['FLOAT8', 'FLOAT4']], + ['DECIMAL', ['NUMERIC']], + ['UNICODE', ['NAME', 'CHAR', 'TEXT', 'BPCHAR', + 'VARCHAR']], + ['STRING', ['NAME', 'CHAR', 'TEXT', 'BPCHAR', + 'VARCHAR']], + ['BOOLEAN', ['BOOL']], + ['DATETIME', ['TIMESTAMP', 'TIMESTAMPTZ', + 'TINTERVAL', 'INTERVAL']], + ['TIME', ['TIME', 'TIMETZ']], + ['DATE', ['DATE']], + ['INTERVAL', ['TINTERVAL', 'INTERVAL']], + ['BINARY', ['BYTEA']], + ['ROWID', ['OID']]) + +# unfortunately we don't have a nice way to extract array information +# from postgresql headers; we'll have to do it hard-coding :/ +array_types = (['LONGINTEGER', [1016]], + ['INTEGER', [1005, 1006, 1007]], + ['FLOAT', [1017, 1021, 1022]], + ['DECIMAL', [1231]], + ['UNICODE', [1002, 1003, 1009, 1014, 1015]], + ['STRING', [1002, 1003, 1009, 1014, 1015]], + ['BOOLEAN', [1000]], + ['DATETIME', [1115, 1185]], + ['TIME', [1183, 1270]], + ['DATE', [1182]], + ['INTERVAL', [1187]], + ['BINARY', [1001]], + ['ROWID', [1028, 1013]]) + +# this is the header used to compile the data in the C module +HEADER = """ +typecastObject_initlist typecast_builtins[] = { +""" + +# then comes the footer +FOOTER = """ {NULL, NULL, NULL, NULL}\n};\n""" + + +# usefull error reporting function +def error(msg): + """Report an error on stderr.""" + sys.stderr.write(msg+'\n') + + +# read couples from stdin and build list +read_types = [] +for l in sys.stdin.readlines(): + oid, val = split(l) + read_types.append((strip(oid)[:-3], strip(val))) + +# look for the wanted types in the read touples +found_types = {} + +for t in basic_types: + k = t[0] + found_types[k] = [] + for v in t[1]: + found = filter(lambda x, y=v: x[0] == y, read_types) + if len(found) == 0: + error(v+': value not found') + elif len(found) > 1: + error(v+': too many values') + else: + found_types[k].append(int(found[0][1])) + +# now outputs to stdout the right C-style definitions +stypes = "" ; sstruct = "" +for t in basic_types: + k = t[0] + s = str(found_types[k]) + s = '{' + s[1:-1] + ', 0}' + stypes = stypes + ('static long int typecast_%s_types[] = %s;\n' % (k, s)) + sstruct += (' {"%s", typecast_%s_types, typecast_%s_cast, NULL},\n' + % (k, k, k)) +for t in array_types: + kt = t[0] + ka = t[0]+'ARRAY' + s = str(t[1]) + s = '{' + s[1:-1] + ', 0}' + stypes = stypes + ('static long int typecast_%s_types[] = %s;\n' % (ka, s)) + sstruct += (' {"%s", typecast_%s_types, typecast_%s_cast, "%s"},\n' + % (ka, ka, ka, kt)) +sstruct = HEADER + sstruct + FOOTER + +print stypes +print sstruct diff --git a/psycopg2/scripts/ext2html.py b/psycopg2/scripts/ext2html.py new file mode 100755 index 00000000..f7c95d84 --- /dev/null +++ b/psycopg2/scripts/ext2html.py @@ -0,0 +1,169 @@ +#!/usr/bin/env python + +# Author: Daniele Varrazzo +# Contact: daniele dot varrazzo at gmail dot com +# Revision: $Revision: 711 $ +# Date: $Date$ +# Copyright: This module has been placed in the public domain. + +""" +A minimal front end to the Docutils Publisher, producing HTML. + +Output can refer to Epydoc-generated APIs through the iterpreted text role +"api". +""" + +import types +import sys + +# The url fragment where the api "index.html" resides w.r.t. the generated docs +api_root = "api/" + +try: + import locale + locale.setlocale(locale.LC_ALL, '') +except: + pass + +from docutils.core import publish_cmdline, default_description +from docutils.parsers.rst.roles import register_canonical_role +from docutils import nodes, utils + +# api references are searched for in these modules +api_modules = [ + 'psycopg2', + 'psycopg2._psycopg', + 'psycopg2.extensions', +] + +# name starting with a dot are looking as those objects attributes. +searched_objects = [ + # module_name, object_name + ('psycopg2.extensions', 'connection'), + ('psycopg2.extensions', 'cursor'), +] + +# import all the referenced modules +for modname in api_modules: + __import__(modname) + +class EpydocTarget: + """Representation of an element language.""" + def __init__(self, name, element): + self.name = name + + # The python object described + self.element = element + + # The base name of the page + self.page = None + + # The url fragment + self.fragment = None + + def get_url(self): + # is it a private element? + components = self.page.split('.') + if self.fragment: components.append(self.fragment) + + for component in components: + if component.startswith('_'): + private = True + break + else: + private = False + + ref = api_root + (private and "private/" or "public/") \ + + self.page + "-" + self.get_type() + ".html" + if self.fragment: + ref = ref + "#" + self.fragment + + return ref + + def get_type(self): + # detect the element type + if isinstance(self.element, types.TypeType): + return 'class' + elif isinstance(self.element, types.ModuleType): + return 'module' + else: + raise ValueError("Can't choose a type for '%s'." % self.name) + +def filter_par(name): + """Filter parenthesis away from a name.""" + if name.endswith(")"): + return name.split("(")[0] + else: + return name + +def get_element_target(name): + """Return the life, the death, the miracles about a package element.""" + + name = filter_par(name) + + if name.startswith('.'): + for modname, objname in searched_objects: + if hasattr(getattr(sys.modules[modname], objname), name[1:]): + name = objname + name + break + + # is the element a module? + if name in api_modules: + out = EpydocTarget(name, sys.modules[name]) + out.page = name + return out + + # look for the element in some module + for modname in api_modules: + element = getattr(sys.modules[modname], name, None) + if element is not None: + + # Check if it is a function defined in a module + if isinstance(element, + (int, types.FunctionType, types.BuiltinFunctionType)): + out = EpydocTarget(name, sys.modules[modname]) + out.page = modname + out.fragment = name + else: + out = EpydocTarget(name, element) + out.page = modname + '.' + name + + return out + + # maybe a qualified name? + if '.' in name: + out = get_element_target('.'.join(name.split('.')[:-1])) + if out is not None: + out.fragment = filter_par(name.split('.')[-1]) + return out + + raise ValueError("Can't find '%s' in any provided module." % name) + +def api_role(role, rawtext, text, lineno, inliner, + options={}, content=[]): + try: + target = get_element_target(text) + except Exception, exc: + msg = inliner.reporter.error(str(exc), line=lineno) + prb = inliner.problematic(rawtext, rawtext, msg) + return [prb], [msg] + + ref = target.get_url() + node2 = nodes.literal(rawtext, utils.unescape(text)) + node = nodes.reference(rawtext, '', node2, refuri=ref, + **options) + return [node], [] + + +register_canonical_role('api', api_role) + +# Register the 'api' role as canonical role +from docutils.parsers.rst import roles +roles.DEFAULT_INTERPRETED_ROLE = 'api' + + +description = ('Generates (X)HTML documents from standalone reStructuredText ' + 'sources with links to Epydoc API. ' + default_description) + + +publish_cmdline(writer_name='html', description=description) diff --git a/psycopg2/scripts/makedocs.py b/psycopg2/scripts/makedocs.py new file mode 100755 index 00000000..dcaa940a --- /dev/null +++ b/psycopg2/scripts/makedocs.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python +"""Build documentation and api.""" + +import os + +EPYDOC = "python c:/programmi/python23/scripts/epydoc.py" +PSYCOPG = "c:/programmi/python23/lib/site-packages/psycopg2" + +os.system("python ext2html.py ../doc/extensions.rst > ../doc/extensions.html") +os.system("%s " + "-o ../doc/api " + "--css ../doc/api-screen.css " + "--docformat restructuredtext " + "%s" + % (EPYDOC,PSYCOPG,)) diff --git a/psycopg2/scripts/maketypes.sh b/psycopg2/scripts/maketypes.sh new file mode 100755 index 00000000..ab133c17 --- /dev/null +++ b/psycopg2/scripts/maketypes.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +SCRIPTSDIR="`dirname $0`" +SRCDIR="`dirname $SCRIPTSDIR`/psycopg" + +if [ -z "$1" ] ; then + echo Usage: $0 '<postgresql include directory>' + exit 1 +fi + +echo -n checking for pg_type.h ... +if [ -f "$1/catalog/pg_type.h" ] ; then + PGTYPE="$1/catalog/pg_type.h" +else + if [ -f "$1/server/catalog/pg_type.h" ] ; then + PGTYPE="$1/server/catalog/pg_type.h" + else + echo + echo "error: can't find pg_type.h under $1" + exit 2 + fi +fi +echo " found" + +PGVERSION="`sed -n -e 's/.*PG_VERSION \"\([0-9]\.[0-9]\).*\"/\1/p' $1/pg_config.h`" +PGMAJOR="`echo $PGVERSION | cut -d. -f1`" +PGMINOR="`echo $PGVERSION | cut -d. -f2`" + +echo checking for postgresql major: $PGMAJOR +echo checking for postgresql minor: $PGMINOR + +echo -n generating pgtypes.h ... +awk '/#define .+OID/ {print "#define " $2 " " $3}' "$PGTYPE" \ + > $SRCDIR/pgtypes.h +echo " done" +echo -n generating typecast_builtins.c ... +awk '/#define .+OID/ {print $2 " " $3}' "$PGTYPE" | \ + python $SCRIPTSDIR/buildtypes.py >$SRCDIR/typecast_builtins.c +echo " done" + + diff --git a/psycopg2/setup.cfg b/psycopg2/setup.cfg new file mode 100644 index 00000000..9c329514 --- /dev/null +++ b/psycopg2/setup.cfg @@ -0,0 +1,46 @@ +[build_ext] +define=PSYCOPG_EXTENSIONS,PSYCOPG_DISPLAY_SIZE,PSYCOPG_NEW_BOOLEAN,HAVE_PQFREEMEM,HAVE_PQPROTOCOL3 +# PSYCOPG_EXTENSIONS enables extensions to PEP-249 (you really want this) +# PSYCOPG_DISPLAY_SIZE enable display size calculation (a little slower) +# HAVE_PQFREEMEM should be defined on PostgreSQL >= 7.3 +# HAVE_PQPROTOCOL3 should be defined on PostgreSQL >= 7.4 +# PSYCOPG_DEBUG can be added to enable verbose debug information +# PSYCOPG_OWN_QUOTING can be added, but it is deprecated (will go away in 2.1) +# PSYCOPG_NEW_BOOLEAN to format booleans as true/false vs 't'/'f' + +# Set to 1 to use Python datatime objects for default date/time representation +use_pydatetime=1 + +# Set to 1 if you want to enable "Decimal" type on python 2.3. +# If the "decimal" module is found in the PYTHONPATH it will be used, else +# fall back on the float type (this is disabled by default to be compatible +# with old versions of psycopg 1 and pre-beta versions of psycopg 2.) +use_decimal=0 + +# If the build system does not find the mx.DateTime headers, try +# uncommenting the following line and setting its value to the right path. +#mx_include_dir= + +# "pg_config" is the preferred method to locate PostgreSQL headers and +# libraries needed to build psycopg2. If pg_config is not in the path or +# is installed under a different name uncomment the following option and +# set it to the pg_config full path. +#pg_config= + +# If "pg_config" is not available, "include_dirs" can be used to locate +# postgresql headers and libraries. Some extra checks on sys.platform will +# still be done in setup.py. +# The next line is the default as used on psycopg author Debian laptop: +#include_dirs=/usr/include/postgresql:/usr/include/postgresql/server + +# Uncomment next line on Mandrake 10.x (and comment previous ones): +#include_dirs=/usr/include/pgsql/8.0:/usr/include/pgsql/8.0/server + +# Uncomment next line on SUSE 9.3 (and comment previous ones): +#include_dirs=/usr/include/pgsql:/usr/include/pgsql/server + +# If postgresql is installed somewhere weird (i.e., not in your runtime library +# path like /usr/lib), just add the right path in "library_dirs" and any extra +# libraries required to link in "libraries". +#library_dirs= +#libraries= diff --git a/psycopg2/setup.py b/psycopg2/setup.py new file mode 100644 index 00000000..45daed7a --- /dev/null +++ b/psycopg2/setup.py @@ -0,0 +1,293 @@ +# setup.py - distutils packaging +# +# Copyright (C) 2003-2004 Federico Di Gregorio <fog@debian.org> +# +# 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 the +# Free Software Foundation; either version 2, or (at your option) any later +# version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. + +"""Python-PostgreSQL Database Adapter + +psycopg is a PostgreSQL database adapter for the Python programming +language. This is version 2, a complete rewrite of the original code to +provide new-style classes for connection and cursor objects and other sweet +candies. Like the original, psycopg 2 was written with the aim of being +very small and fast, and stable as a rock. + +psycopg is different from the other database adapter because it was +designed for heavily multi-threaded applications that create and destroy +lots of cursors and make a conspicuous number of concurrent INSERTs or +UPDATEs. psycopg 2 also provide full asycronous operations for the really +brave programmer. +""" + +classifiers = """\ +Development Status :: 4 - Beta +Intended Audience :: Developers +License :: OSI Approved :: GNU General Public License (GPL) +License :: OSI Approved :: Zope Public License +Programming Language :: Python +Programming Language :: C +Programming Language :: SQL +Topic :: Database +Topic :: Database :: Front-Ends +Topic :: Software Development +Topic :: Software Development :: Libraries :: Python Modules +Operating System :: Microsoft :: Windows +Operating System :: Unix +""" + +import os +import sys +import popen2 +from distutils.core import setup, Extension +from distutils.errors import DistutilsFileError +from distutils.command.build_ext import build_ext +from distutils.sysconfig import get_python_inc +from distutils.ccompiler import get_default_compiler + +PSYCOPG_VERSION = '2.0.5.1' +version_flags = [] + +# to work around older distutil limitations +if sys.version < '2.2.3': + from distutils.dist import DistributionMetadata + DistributionMetadata.classifiers = None + DistributionMetadata.download_url = None + +def get_pg_config(kind, pg_config="pg_config"): + p = popen2.popen3(pg_config + " --" + kind) + r = p[0].readline().strip() + if not r: + raise Warning(p[2].readline()) + return r + +class psycopg_build_ext(build_ext): + """Conditionally complement the setup.cfg options file. + + This class configures the include_dirs, libray_dirs, libraries + options as required by the system. Most of the configuration happens + in finalize_options() method. + + If you want to set up the build step for a peculiar platform, add a + method finalize_PLAT(), where PLAT matches your sys.platform. + """ + user_options = build_ext.user_options[:] + user_options.extend([ + ('use-pydatetime', None, + "Use Python datatime objects for date and time representation."), + ('pg-config=', None, + "The name of the pg_config binary and/or full path to find it"), + ('use-decimal', None, + "Use Decimal type even on Python 2.3 if the module is provided."), + ]) + + boolean_options = build_ext.boolean_options[:] + boolean_options.extend(('use-pydatetime', 'use-decimal')) + + DEFAULT_PG_CONFIG = "pg_config" + + def initialize_options(self): + build_ext.initialize_options(self) + self.use_pg_dll = 1 + self.pgdir = None + self.pg_config = self.DEFAULT_PG_CONFIG + self.mx_include_dir = None + + def get_compiler(self): + """Return the c compiler to compile extensions. + + If a compiler was not explicitely set (on the command line, for + example), fall back on the default compiler. + """ + return self.compiler or get_default_compiler() + + def get_pg_config(self, kind): + return get_pg_config(kind, self.pg_config) + + def build_extensions(self): + # Linking against this library causes psycopg2 to crash + # on Python >= 2.4. Maybe related to strdup calls, cfr. + # http://mail.python.org/pipermail/distutils-sig/2005-April/004433.html + if self.get_compiler().compiler_type == "mingw32" \ + and 'msvcr71' in self.compiler.dll_libraries: + self.compiler.dll_libraries.remove('msvcr71') + + build_ext.build_extensions(self) + + def finalize_win32(self): + """Finalize build system configuration on win32 platform.""" + self.libraries.append("ws2_32") + self.libraries.append("advapi32") + if self.get_compiler() == "msvc": + # MSVC requires an explicit "libpq" + self.libraries.remove("pq") + self.libraries.append("libpq") + self.libraries.append("shfolder") + for path in self.library_dirs: + if os.path.isfile(os.path.join(path, "ms", "libpq.lib")): + self.library_dirs.append(os.path.join(path, "ms")) + break + + def finalize_darwin(self): + """Finalize build system configuration on darwin platform.""" + self.libraries.append('ssl') + self.libraries.append('crypto') + + def finalize_options(self): + """Complete the build system configuation.""" + build_ext.finalize_options(self) + + self.include_dirs.append(".") + self.libraries.append("pq") + + try: + self.library_dirs.append(self.get_pg_config("libdir")) + self.include_dirs.append(self.get_pg_config("includedir")) + self.include_dirs.append(self.get_pg_config("includedir-server")) + try: + # Here we take a conservative approach: we suppose that + # *at least* PostgreSQL 7.4 is available (this is the only + # 7.x series supported by psycopg 2) + pgversion = self.get_pg_config("version").split()[1] + pgmajor, pgminor, pgpatch = pgversion.split('.') + except: + pgmajor, pgminor, pgpatch = 7, 4, 0 + define_macros.append(("PG_MAJOR_VERSION", pgmajor)) + define_macros.append(("PG_MINOR_VERSION", pgminor)) + define_macros.append(("PG_PATCH_VERSION", pgpatch)) + except Warning, w: + if self.pg_config == self.DEFAULT_PG_CONFIG: + sys.stderr.write("Warning: %s" % str(w)) + else: + sys.stderr.write("Error: %s" % str(w)) + sys.exit(1) + + if hasattr(self, "finalize_" + sys.platform): + getattr(self, "finalize_" + sys.platform)() + +# let's start with macro definitions (the ones not already in setup.cfg) +define_macros = [] +include_dirs = [] + +# python version +define_macros.append(('PY_MAJOR_VERSION', str(sys.version_info[0]))) +define_macros.append(('PY_MINOR_VERSION', str(sys.version_info[1]))) + +# some macros related to python versions and features +if sys.version_info[0] >= 2 and sys.version_info[1] >= 3: + define_macros.append(('HAVE_PYBOOL','1')) + +# gather information to build the extension module +ext = [] ; data_files = [] + +# sources + +sources = [ + 'psycopgmodule.c', 'pqpath.c', 'typecast.c', + 'microprotocols.c', 'microprotocols_proto.c', + 'connection_type.c', 'connection_int.c', 'cursor_type.c', 'cursor_int.c', + 'adapter_qstring.c', 'adapter_pboolean.c', 'adapter_binary.c', + 'adapter_asis.c', 'adapter_list.c'] + +from ConfigParser import ConfigParser +parser = ConfigParser() +parser.read('setup.cfg') + +# Choose if to use Decimal type +use_decimal = int(parser.get('build_ext', 'use_decimal')) +if sys.version_info[0] >= 2 and ( + sys.version_info[1] >= 4 or (sys.version_info[1] == 3 and use_decimal)): + define_macros.append(('HAVE_DECIMAL','1')) + version_flags.append('dec') + +# Choose a datetime module +have_pydatetime = False +have_mxdatetime = False +use_pydatetime = int(parser.get('build_ext', 'use_pydatetime')) + +# check for mx package +if parser.has_option('build_ext', 'mx_include_dir'): + mxincludedir = parser.get('build_ext', 'mx_include_dir') +else: + mxincludedir = os.path.join(get_python_inc(plat_specific=1), "mx") +if os.path.exists(mxincludedir): + include_dirs.append(mxincludedir) + define_macros.append(('HAVE_MXDATETIME','1')) + sources.append('adapter_mxdatetime.c') + have_mxdatetime = True + version_flags.append('mx') + +# check for python datetime package +if os.path.exists(os.path.join(get_python_inc(plat_specific=1),"datetime.h")): + define_macros.append(('HAVE_PYDATETIME','1')) + sources.append('adapter_datetime.c') + have_pydatetime = True + version_flags.append('dt') + +# now decide which package will be the default for date/time typecasts +if have_pydatetime and use_pydatetime \ + or have_pydatetime and not have_mxdatetime: + define_macros.append(('PSYCOPG_DEFAULT_PYDATETIME','1')) +elif have_mxdatetime: + define_macros.append(('PSYCOPG_DEFAULT_MXDATETIME','1')) +else: + def e(msg): + sys.stderr.write("error: " + msg + "\n") + e("psycopg requires a datetime module:") + e(" mx.DateTime module not found") + e(" python datetime module not found") + e("Note that psycopg needs the module headers and not just the module") + e("itself. If you installed Python or mx.DateTime from a binary package") + e("you probably need to install its companion -dev or -devel package.") + sys.exit(1) + +# generate a nice version string to avoid confusion when users report bugs +for have in parser.get('build_ext', 'define').split(','): + if have == 'PSYCOPG_EXTENSIONS': + version_flags.append('ext') + elif have == 'HAVE_PQPROTOCOL3': + version_flags.append('pq3') +if version_flags: + PSYCOPG_VERSION_EX = PSYCOPG_VERSION + " (%s)" % ' '.join(version_flags) +else: + PSYCOPG_VERSION_EX = PSYCOPG_VERSION + +if sys.platform != 'win32': + define_macros.append(('PSYCOPG_VERSION', '"'+PSYCOPG_VERSION_EX+'"')) +else: + define_macros.append(('PSYCOPG_VERSION', '\\"'+PSYCOPG_VERSION_EX+'\\"')) + +# build the extension + +sources = map(lambda x: os.path.join('psycopg', x), sources) + +ext.append(Extension("psycopg2._psycopg", sources, + define_macros=define_macros, + include_dirs=include_dirs, + undef_macros=[])) + +setup(name="psycopg2", + version=PSYCOPG_VERSION, + maintainer="Federico Di Gregorio", + maintainer_email="fog@initd.org", + author="Federico Di Gregorio", + author_email="fog@initd.org", + url="http://initd.org/tracker/psycopg", + download_url = "http://initd.org/pub/software/psycopg2", + license="GPL with exceptions or ZPL", + platforms = ["any"], + description=__doc__.split("\n")[0], + long_description="\n".join(__doc__.split("\n")[2:]), + classifiers=filter(None, classifiers.split("\n")), + data_files=data_files, + package_dir={'psycopg2':'lib'}, + packages=['psycopg2'], + cmdclass={ 'build_ext': psycopg_build_ext }, + ext_modules=ext) diff --git a/psycopg2/tests/dbapi20.py b/psycopg2/tests/dbapi20.py new file mode 100644 index 00000000..4fc8c0c7 --- /dev/null +++ b/psycopg2/tests/dbapi20.py @@ -0,0 +1,850 @@ +#!/usr/bin/env python +''' Python DB API 2.0 driver compliance unit test suite. + + This software is Public Domain and may be used without restrictions. + + "Now we have booze and barflies entering the discussion, plus rumours of + DBAs on drugs... and I won't tell you what flashes through my mind each + time I read the subject line with 'Anal Compliance' in it. All around + this is turning out to be a thoroughly unwholesome unit test." + + -- Ian Bicking +''' + +__rcs_id__ = '$Id: dbapi20.py,v 1.10 2003/10/09 03:14:14 zenzen Exp $' +__version__ = '$Revision: 1.10 $'[11:-2] +__author__ = 'Stuart Bishop <zen@shangri-la.dropbear.id.au>' + +import unittest +import time + +# $Log: dbapi20.py,v $ +# Revision 1.10 2003/10/09 03:14:14 zenzen +# Add test for DB API 2.0 optional extension, where database exceptions +# are exposed as attributes on the Connection object. +# +# Revision 1.9 2003/08/13 01:16:36 zenzen +# Minor tweak from Stefan Fleiter +# +# Revision 1.8 2003/04/10 00:13:25 zenzen +# Changes, as per suggestions by M.-A. Lemburg +# - Add a table prefix, to ensure namespace collisions can always be avoided +# +# Revision 1.7 2003/02/26 23:33:37 zenzen +# Break out DDL into helper functions, as per request by David Rushby +# +# Revision 1.6 2003/02/21 03:04:33 zenzen +# Stuff from Henrik Ekelund: +# added test_None +# added test_nextset & hooks +# +# Revision 1.5 2003/02/17 22:08:43 zenzen +# Implement suggestions and code from Henrik Eklund - test that cursor.arraysize +# defaults to 1 & generic cursor.callproc test added +# +# Revision 1.4 2003/02/15 00:16:33 zenzen +# Changes, as per suggestions and bug reports by M.-A. Lemburg, +# Matthew T. Kromer, Federico Di Gregorio and Daniel Dittmar +# - Class renamed +# - Now a subclass of TestCase, to avoid requiring the driver stub +# to use multiple inheritance +# - Reversed the polarity of buggy test in test_description +# - Test exception heirarchy correctly +# - self.populate is now self._populate(), so if a driver stub +# overrides self.ddl1 this change propogates +# - VARCHAR columns now have a width, which will hopefully make the +# DDL even more portible (this will be reversed if it causes more problems) +# - cursor.rowcount being checked after various execute and fetchXXX methods +# - Check for fetchall and fetchmany returning empty lists after results +# are exhausted (already checking for empty lists if select retrieved +# nothing +# - Fix bugs in test_setoutputsize_basic and test_setinputsizes +# + +class DatabaseAPI20Test(unittest.TestCase): + ''' Test a database self.driver for DB API 2.0 compatibility. + This implementation tests Gadfly, but the TestCase + is structured so that other self.drivers can subclass this + test case to ensure compiliance with the DB-API. It is + expected that this TestCase may be expanded in the future + if ambiguities or edge conditions are discovered. + + The 'Optional Extensions' are not yet being tested. + + self.drivers should subclass this test, overriding setUp, tearDown, + self.driver, connect_args and connect_kw_args. Class specification + should be as follows: + + import dbapi20 + class mytest(dbapi20.DatabaseAPI20Test): + [...] + + Don't 'import DatabaseAPI20Test from dbapi20', or you will + confuse the unit tester - just 'import dbapi20'. + ''' + + # The self.driver module. This should be the module where the 'connect' + # method is to be found + driver = None + connect_args = () # List of arguments to pass to connect + connect_kw_args = {} # Keyword arguments for connect + table_prefix = 'dbapi20test_' # If you need to specify a prefix for tables + + ddl1 = 'create table %sbooze (name varchar(20))' % table_prefix + ddl2 = 'create table %sbarflys (name varchar(20))' % table_prefix + xddl1 = 'drop table %sbooze' % table_prefix + xddl2 = 'drop table %sbarflys' % table_prefix + + lowerfunc = 'lower' # Name of stored procedure to convert string->lowercase + + # Some drivers may need to override these helpers, for example adding + # a 'commit' after the execute. + def executeDDL1(self,cursor): + cursor.execute(self.ddl1) + + def executeDDL2(self,cursor): + cursor.execute(self.ddl2) + + def setUp(self): + ''' self.drivers should override this method to perform required setup + if any is necessary, such as creating the database. + ''' + pass + + def tearDown(self): + ''' self.drivers should override this method to perform required cleanup + if any is necessary, such as deleting the test database. + The default drops the tables that may be created. + ''' + con = self._connect() + try: + cur = con.cursor() + for ddl in (self.xddl1,self.xddl2): + try: + cur.execute(ddl) + con.commit() + except self.driver.Error: + # Assume table didn't exist. Other tests will check if + # execute is busted. + pass + finally: + con.close() + + def _connect(self): + try: + return self.driver.connect( + *self.connect_args,**self.connect_kw_args + ) + except AttributeError: + self.fail("No connect method found in self.driver module") + + def test_connect(self): + con = self._connect() + con.close() + + def test_apilevel(self): + try: + # Must exist + apilevel = self.driver.apilevel + # Must equal 2.0 + self.assertEqual(apilevel,'2.0') + except AttributeError: + self.fail("Driver doesn't define apilevel") + + def test_threadsafety(self): + try: + # Must exist + threadsafety = self.driver.threadsafety + # Must be a valid value + self.failUnless(threadsafety in (0,1,2,3)) + except AttributeError: + self.fail("Driver doesn't define threadsafety") + + def test_paramstyle(self): + try: + # Must exist + paramstyle = self.driver.paramstyle + # Must be a valid value + self.failUnless(paramstyle in ( + 'qmark','numeric','named','format','pyformat' + )) + except AttributeError: + self.fail("Driver doesn't define paramstyle") + + def test_Exceptions(self): + # Make sure required exceptions exist, and are in the + # defined heirarchy. + self.failUnless(issubclass(self.driver.Warning,StandardError)) + self.failUnless(issubclass(self.driver.Error,StandardError)) + self.failUnless( + issubclass(self.driver.InterfaceError,self.driver.Error) + ) + self.failUnless( + issubclass(self.driver.DatabaseError,self.driver.Error) + ) + self.failUnless( + issubclass(self.driver.OperationalError,self.driver.Error) + ) + self.failUnless( + issubclass(self.driver.IntegrityError,self.driver.Error) + ) + self.failUnless( + issubclass(self.driver.InternalError,self.driver.Error) + ) + self.failUnless( + issubclass(self.driver.ProgrammingError,self.driver.Error) + ) + self.failUnless( + issubclass(self.driver.NotSupportedError,self.driver.Error) + ) + + def test_ExceptionsAsConnectionAttributes(self): + # OPTIONAL EXTENSION + # Test for the optional DB API 2.0 extension, where the exceptions + # are exposed as attributes on the Connection object + # I figure this optional extension will be implemented by any + # driver author who is using this test suite, so it is enabled + # by default. + con = self._connect() + drv = self.driver + self.failUnless(con.Warning is drv.Warning) + self.failUnless(con.Error is drv.Error) + self.failUnless(con.InterfaceError is drv.InterfaceError) + self.failUnless(con.DatabaseError is drv.DatabaseError) + self.failUnless(con.OperationalError is drv.OperationalError) + self.failUnless(con.IntegrityError is drv.IntegrityError) + self.failUnless(con.InternalError is drv.InternalError) + self.failUnless(con.ProgrammingError is drv.ProgrammingError) + self.failUnless(con.NotSupportedError is drv.NotSupportedError) + + + def test_commit(self): + con = self._connect() + try: + # Commit must work, even if it doesn't do anything + con.commit() + finally: + con.close() + + def test_rollback(self): + con = self._connect() + # If rollback is defined, it should either work or throw + # the documented exception + if hasattr(con,'rollback'): + try: + con.rollback() + except self.driver.NotSupportedError: + pass + + def test_cursor(self): + con = self._connect() + try: + cur = con.cursor() + finally: + con.close() + + def test_cursor_isolation(self): + con = self._connect() + try: + # Make sure cursors created from the same connection have + # the documented transaction isolation level + cur1 = con.cursor() + cur2 = con.cursor() + self.executeDDL1(cur1) + cur1.execute("insert into %sbooze values ('Victoria Bitter')" % ( + self.table_prefix + )) + cur2.execute("select name from %sbooze" % self.table_prefix) + booze = cur2.fetchall() + self.assertEqual(len(booze),1) + self.assertEqual(len(booze[0]),1) + self.assertEqual(booze[0][0],'Victoria Bitter') + finally: + con.close() + + def test_description(self): + con = self._connect() + try: + cur = con.cursor() + self.executeDDL1(cur) + self.assertEqual(cur.description,None, + 'cursor.description should be none after executing a ' + 'statement that can return no rows (such as DDL)' + ) + cur.execute('select name from %sbooze' % self.table_prefix) + self.assertEqual(len(cur.description),1, + 'cursor.description describes too many columns' + ) + self.assertEqual(len(cur.description[0]),7, + 'cursor.description[x] tuples must have 7 elements' + ) + self.assertEqual(cur.description[0][0].lower(),'name', + 'cursor.description[x][0] must return column name' + ) + self.assertEqual(cur.description[0][1],self.driver.STRING, + 'cursor.description[x][1] must return column type. Got %r' + % cur.description[0][1] + ) + + # Make sure self.description gets reset + self.executeDDL2(cur) + self.assertEqual(cur.description,None, + 'cursor.description not being set to None when executing ' + 'no-result statements (eg. DDL)' + ) + finally: + con.close() + + def test_rowcount(self): + con = self._connect() + try: + cur = con.cursor() + self.executeDDL1(cur) + self.assertEqual(cur.rowcount,-1, + 'cursor.rowcount should be -1 after executing no-result ' + 'statements' + ) + cur.execute("insert into %sbooze values ('Victoria Bitter')" % ( + self.table_prefix + )) + self.failUnless(cur.rowcount in (-1,1), + 'cursor.rowcount should == number or rows inserted, or ' + 'set to -1 after executing an insert statement' + ) + cur.execute("select name from %sbooze" % self.table_prefix) + self.failUnless(cur.rowcount in (-1,1), + 'cursor.rowcount should == number of rows returned, or ' + 'set to -1 after executing a select statement' + ) + self.executeDDL2(cur) + self.assertEqual(cur.rowcount,-1, + 'cursor.rowcount not being reset to -1 after executing ' + 'no-result statements' + ) + finally: + con.close() + + lower_func = 'lower' + def test_callproc(self): + con = self._connect() + try: + cur = con.cursor() + if self.lower_func and hasattr(cur,'callproc'): + r = cur.callproc(self.lower_func,('FOO',)) + self.assertEqual(len(r),1) + self.assertEqual(r[0],'FOO') + r = cur.fetchall() + self.assertEqual(len(r),1,'callproc produced no result set') + self.assertEqual(len(r[0]),1, + 'callproc produced invalid result set' + ) + self.assertEqual(r[0][0],'foo', + 'callproc produced invalid results' + ) + finally: + con.close() + + def test_close(self): + con = self._connect() + try: + cur = con.cursor() + finally: + con.close() + + # cursor.execute should raise an Error if called after connection + # closed + self.assertRaises(self.driver.Error,self.executeDDL1,cur) + + # connection.commit should raise an Error if called after connection' + # closed.' + self.assertRaises(self.driver.Error,con.commit) + + # connection.close should raise an Error if called more than once + self.assertRaises(self.driver.Error,con.close) + + def test_execute(self): + con = self._connect() + try: + cur = con.cursor() + self._paraminsert(cur) + finally: + con.close() + + def _paraminsert(self,cur): + self.executeDDL1(cur) + cur.execute("insert into %sbooze values ('Victoria Bitter')" % ( + self.table_prefix + )) + self.failUnless(cur.rowcount in (-1,1)) + + if self.driver.paramstyle == 'qmark': + cur.execute( + 'insert into %sbooze values (?)' % self.table_prefix, + ("Cooper's",) + ) + elif self.driver.paramstyle == 'numeric': + cur.execute( + 'insert into %sbooze values (:1)' % self.table_prefix, + ("Cooper's",) + ) + elif self.driver.paramstyle == 'named': + cur.execute( + 'insert into %sbooze values (:beer)' % self.table_prefix, + {'beer':"Cooper's"} + ) + elif self.driver.paramstyle == 'format': + cur.execute( + 'insert into %sbooze values (%%s)' % self.table_prefix, + ("Cooper's",) + ) + elif self.driver.paramstyle == 'pyformat': + cur.execute( + 'insert into %sbooze values (%%(beer)s)' % self.table_prefix, + {'beer':"Cooper's"} + ) + else: + self.fail('Invalid paramstyle') + self.failUnless(cur.rowcount in (-1,1)) + + cur.execute('select name from %sbooze' % self.table_prefix) + res = cur.fetchall() + self.assertEqual(len(res),2,'cursor.fetchall returned too few rows') + beers = [res[0][0],res[1][0]] + beers.sort() + self.assertEqual(beers[0],"Cooper's", + 'cursor.fetchall retrieved incorrect data, or data inserted ' + 'incorrectly' + ) + self.assertEqual(beers[1],"Victoria Bitter", + 'cursor.fetchall retrieved incorrect data, or data inserted ' + 'incorrectly' + ) + + def test_executemany(self): + con = self._connect() + try: + cur = con.cursor() + self.executeDDL1(cur) + largs = [ ("Cooper's",) , ("Boag's",) ] + margs = [ {'beer': "Cooper's"}, {'beer': "Boag's"} ] + if self.driver.paramstyle == 'qmark': + cur.executemany( + 'insert into %sbooze values (?)' % self.table_prefix, + largs + ) + elif self.driver.paramstyle == 'numeric': + cur.executemany( + 'insert into %sbooze values (:1)' % self.table_prefix, + largs + ) + elif self.driver.paramstyle == 'named': + cur.executemany( + 'insert into %sbooze values (:beer)' % self.table_prefix, + margs + ) + elif self.driver.paramstyle == 'format': + cur.executemany( + 'insert into %sbooze values (%%s)' % self.table_prefix, + largs + ) + elif self.driver.paramstyle == 'pyformat': + cur.executemany( + 'insert into %sbooze values (%%(beer)s)' % ( + self.table_prefix + ), + margs + ) + else: + self.fail('Unknown paramstyle') + self.failUnless(cur.rowcount in (-1,2), + 'insert using cursor.executemany set cursor.rowcount to ' + 'incorrect value %r' % cur.rowcount + ) + cur.execute('select name from %sbooze' % self.table_prefix) + res = cur.fetchall() + self.assertEqual(len(res),2, + 'cursor.fetchall retrieved incorrect number of rows' + ) + beers = [res[0][0],res[1][0]] + beers.sort() + self.assertEqual(beers[0],"Boag's",'incorrect data retrieved') + self.assertEqual(beers[1],"Cooper's",'incorrect data retrieved') + finally: + con.close() + + def test_fetchone(self): + con = self._connect() + try: + cur = con.cursor() + + # cursor.fetchone should raise an Error if called before + # executing a select-type query + self.assertRaises(self.driver.Error,cur.fetchone) + + # cursor.fetchone should raise an Error if called after + # executing a query that cannnot return rows + self.executeDDL1(cur) + self.assertRaises(self.driver.Error,cur.fetchone) + + cur.execute('select name from %sbooze' % self.table_prefix) + self.assertEqual(cur.fetchone(),None, + 'cursor.fetchone should return None if a query retrieves ' + 'no rows' + ) + self.failUnless(cur.rowcount in (-1,0)) + + # cursor.fetchone should raise an Error if called after + # executing a query that cannnot return rows + cur.execute("insert into %sbooze values ('Victoria Bitter')" % ( + self.table_prefix + )) + self.assertRaises(self.driver.Error,cur.fetchone) + + cur.execute('select name from %sbooze' % self.table_prefix) + r = cur.fetchone() + self.assertEqual(len(r),1, + 'cursor.fetchone should have retrieved a single row' + ) + self.assertEqual(r[0],'Victoria Bitter', + 'cursor.fetchone retrieved incorrect data' + ) + self.assertEqual(cur.fetchone(),None, + 'cursor.fetchone should return None if no more rows available' + ) + self.failUnless(cur.rowcount in (-1,1)) + finally: + con.close() + + samples = [ + 'Carlton Cold', + 'Carlton Draft', + 'Mountain Goat', + 'Redback', + 'Victoria Bitter', + 'XXXX' + ] + + def _populate(self): + ''' Return a list of sql commands to setup the DB for the fetch + tests. + ''' + populate = [ + "insert into %sbooze values ('%s')" % (self.table_prefix,s) + for s in self.samples + ] + return populate + + def test_fetchmany(self): + con = self._connect() + try: + cur = con.cursor() + + # cursor.fetchmany should raise an Error if called without + #issuing a query + self.assertRaises(self.driver.Error,cur.fetchmany,4) + + self.executeDDL1(cur) + for sql in self._populate(): + cur.execute(sql) + + cur.execute('select name from %sbooze' % self.table_prefix) + r = cur.fetchmany() + self.assertEqual(len(r),1, + 'cursor.fetchmany retrieved incorrect number of rows, ' + 'default of arraysize is one.' + ) + cur.arraysize=10 + r = cur.fetchmany(3) # Should get 3 rows + self.assertEqual(len(r),3, + 'cursor.fetchmany retrieved incorrect number of rows' + ) + r = cur.fetchmany(4) # Should get 2 more + self.assertEqual(len(r),2, + 'cursor.fetchmany retrieved incorrect number of rows' + ) + r = cur.fetchmany(4) # Should be an empty sequence + self.assertEqual(len(r),0, + 'cursor.fetchmany should return an empty sequence after ' + 'results are exhausted' + ) + self.failUnless(cur.rowcount in (-1,6)) + + # Same as above, using cursor.arraysize + cur.arraysize=4 + cur.execute('select name from %sbooze' % self.table_prefix) + r = cur.fetchmany() # Should get 4 rows + self.assertEqual(len(r),4, + 'cursor.arraysize not being honoured by fetchmany' + ) + r = cur.fetchmany() # Should get 2 more + self.assertEqual(len(r),2) + r = cur.fetchmany() # Should be an empty sequence + self.assertEqual(len(r),0) + self.failUnless(cur.rowcount in (-1,6)) + + cur.arraysize=6 + cur.execute('select name from %sbooze' % self.table_prefix) + rows = cur.fetchmany() # Should get all rows + self.failUnless(cur.rowcount in (-1,6)) + self.assertEqual(len(rows),6) + self.assertEqual(len(rows),6) + rows = [r[0] for r in rows] + rows.sort() + + # Make sure we get the right data back out + for i in range(0,6): + self.assertEqual(rows[i],self.samples[i], + 'incorrect data retrieved by cursor.fetchmany' + ) + + rows = cur.fetchmany() # Should return an empty list + self.assertEqual(len(rows),0, + 'cursor.fetchmany should return an empty sequence if ' + 'called after the whole result set has been fetched' + ) + self.failUnless(cur.rowcount in (-1,6)) + + self.executeDDL2(cur) + cur.execute('select name from %sbarflys' % self.table_prefix) + r = cur.fetchmany() # Should get empty sequence + self.assertEqual(len(r),0, + 'cursor.fetchmany should return an empty sequence if ' + 'query retrieved no rows' + ) + self.failUnless(cur.rowcount in (-1,0)) + + finally: + con.close() + + def test_fetchall(self): + con = self._connect() + try: + cur = con.cursor() + # cursor.fetchall should raise an Error if called + # without executing a query that may return rows (such + # as a select) + self.assertRaises(self.driver.Error, cur.fetchall) + + self.executeDDL1(cur) + for sql in self._populate(): + cur.execute(sql) + + # cursor.fetchall should raise an Error if called + # after executing a a statement that cannot return rows + self.assertRaises(self.driver.Error,cur.fetchall) + + cur.execute('select name from %sbooze' % self.table_prefix) + rows = cur.fetchall() + self.failUnless(cur.rowcount in (-1,len(self.samples))) + self.assertEqual(len(rows),len(self.samples), + 'cursor.fetchall did not retrieve all rows' + ) + rows = [r[0] for r in rows] + rows.sort() + for i in range(0,len(self.samples)): + self.assertEqual(rows[i],self.samples[i], + 'cursor.fetchall retrieved incorrect rows' + ) + rows = cur.fetchall() + self.assertEqual( + len(rows),0, + 'cursor.fetchall should return an empty list if called ' + 'after the whole result set has been fetched' + ) + self.failUnless(cur.rowcount in (-1,len(self.samples))) + + self.executeDDL2(cur) + cur.execute('select name from %sbarflys' % self.table_prefix) + rows = cur.fetchall() + self.failUnless(cur.rowcount in (-1,0)) + self.assertEqual(len(rows),0, + 'cursor.fetchall should return an empty list if ' + 'a select query returns no rows' + ) + + finally: + con.close() + + def test_mixedfetch(self): + con = self._connect() + try: + cur = con.cursor() + self.executeDDL1(cur) + for sql in self._populate(): + cur.execute(sql) + + cur.execute('select name from %sbooze' % self.table_prefix) + rows1 = cur.fetchone() + rows23 = cur.fetchmany(2) + rows4 = cur.fetchone() + rows56 = cur.fetchall() + self.failUnless(cur.rowcount in (-1,6)) + self.assertEqual(len(rows23),2, + 'fetchmany returned incorrect number of rows' + ) + self.assertEqual(len(rows56),2, + 'fetchall returned incorrect number of rows' + ) + + rows = [rows1[0]] + rows.extend([rows23[0][0],rows23[1][0]]) + rows.append(rows4[0]) + rows.extend([rows56[0][0],rows56[1][0]]) + rows.sort() + for i in range(0,len(self.samples)): + self.assertEqual(rows[i],self.samples[i], + 'incorrect data retrieved or inserted' + ) + finally: + con.close() + + def help_nextset_setUp(self,cur): + ''' Should create a procedure called deleteme + that returns two result sets, first the + number of rows in booze then "name from booze" + ''' + raise NotImplementedError,'Helper not implemented' + #sql=""" + # create procedure deleteme as + # begin + # select count(*) from booze + # select name from booze + # end + #""" + #cur.execute(sql) + + def help_nextset_tearDown(self,cur): + 'If cleaning up is needed after nextSetTest' + raise NotImplementedError,'Helper not implemented' + #cur.execute("drop procedure deleteme") + + def test_nextset(self): + con = self._connect() + try: + cur = con.cursor() + if not hasattr(cur,'nextset'): + return + + try: + self.executeDDL1(cur) + sql=self._populate() + for sql in self._populate(): + cur.execute(sql) + + self.help_nextset_setUp(cur) + + cur.callproc('deleteme') + numberofrows=cur.fetchone() + assert numberofrows[0]== len(self.samples) + assert cur.nextset() + names=cur.fetchall() + assert len(names) == len(self.samples) + s=cur.nextset() + assert s == None,'No more return sets, should return None' + finally: + self.help_nextset_tearDown(cur) + + finally: + con.close() + + def test_nextset(self): + raise NotImplementedError,'Drivers need to override this test' + + def test_arraysize(self): + # Not much here - rest of the tests for this are in test_fetchmany + con = self._connect() + try: + cur = con.cursor() + self.failUnless(hasattr(cur,'arraysize'), + 'cursor.arraysize must be defined' + ) + finally: + con.close() + + def test_setinputsizes(self): + con = self._connect() + try: + cur = con.cursor() + cur.setinputsizes( (25,) ) + self._paraminsert(cur) # Make sure cursor still works + finally: + con.close() + + def test_setoutputsize_basic(self): + # Basic test is to make sure setoutputsize doesn't blow up + con = self._connect() + try: + cur = con.cursor() + cur.setoutputsize(1000) + cur.setoutputsize(2000,0) + self._paraminsert(cur) # Make sure the cursor still works + finally: + con.close() + + def test_setoutputsize(self): + # Real test for setoutputsize is driver dependant + raise NotImplementedError,'Driver need to override this test' + + def test_None(self): + con = self._connect() + try: + cur = con.cursor() + self.executeDDL1(cur) + cur.execute('insert into %sbooze values (NULL)' % self.table_prefix) + cur.execute('select name from %sbooze' % self.table_prefix) + r = cur.fetchall() + self.assertEqual(len(r),1) + self.assertEqual(len(r[0]),1) + self.assertEqual(r[0][0],None,'NULL value not returned as None') + finally: + con.close() + + def test_Date(self): + d1 = self.driver.Date(2002,12,25) + d2 = self.driver.DateFromTicks(time.mktime((2002,12,25,0,0,0,0,0,0))) + # Can we assume this? API doesn't specify, but it seems implied + # self.assertEqual(str(d1),str(d2)) + + def test_Time(self): + t1 = self.driver.Time(13,45,30) + t2 = self.driver.TimeFromTicks(time.mktime((2001,1,1,13,45,30,0,0,0))) + # Can we assume this? API doesn't specify, but it seems implied + # self.assertEqual(str(t1),str(t2)) + + def test_Timestamp(self): + t1 = self.driver.Timestamp(2002,12,25,13,45,30) + t2 = self.driver.TimestampFromTicks( + time.mktime((2002,12,25,13,45,30,0,0,0)) + ) + # Can we assume this? API doesn't specify, but it seems implied + # self.assertEqual(str(t1),str(t2)) + + def test_Binary(self): + b = self.driver.Binary('Something') + b = self.driver.Binary('') + + def test_STRING(self): + self.failUnless(hasattr(self.driver,'STRING'), + 'module.STRING must be defined' + ) + + def test_BINARY(self): + self.failUnless(hasattr(self.driver,'BINARY'), + 'module.BINARY must be defined.' + ) + + def test_NUMBER(self): + self.failUnless(hasattr(self.driver,'NUMBER'), + 'module.NUMBER must be defined.' + ) + + def test_DATETIME(self): + self.failUnless(hasattr(self.driver,'DATETIME'), + 'module.DATETIME must be defined.' + ) + + def test_ROWID(self): + self.failUnless(hasattr(self.driver,'ROWID'), + 'module.ROWID must be defined.' + ) + diff --git a/psycopg2/tests/extras_dictcursor.py b/psycopg2/tests/extras_dictcursor.py new file mode 100644 index 00000000..270d37f5 --- /dev/null +++ b/psycopg2/tests/extras_dictcursor.py @@ -0,0 +1,47 @@ +# extras_dictcursor - test if DictCursor extension class works +# +# Copyright (C) 2004 Federico Di Gregorio <fog@debian.org> +# +# 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 the +# Free Software Foundation; either version 2, or (at your option) any later +# version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. + +import psycopg2 +import psycopg2.extras +from unittest import TestCase, TestSuite, main + + +class ExtrasDictCursorTests(TestCase): + """Test if DictCursor extension class works.""" + + def setUp(self): + self.conn = psycopg2.connect("dbname=test") + curs = self.conn.cursor() + curs.execute("CREATE TABLE ExtrasDictCursorTests (foo text)") + + def testDictCursor(self): + curs = self.conn.cursor(cursor_factory=psycopg2.extras.DictCursor) + curs.execute("INSERT INTO ExtrasDictCursorTests VALUES ('bar')") + curs.execute("SELECT * FROM ExtrasDictCursorTests") + row = curs.fetchone() + self.failUnless(row['foo'] == 'bar') + self.failUnless(row[0] == 'bar') + +class ExtrasDictCursorSuite(TestSuite): + """Build a suite of all tests.""" + + def __init__(self): + """Build a list of tests.""" + self.tests = [x for x in dir(ExtrasDictCursorTests) + if x.startswith('test')] + TestSuite.__init__(self, map(TestModule, self.tests)) + + +if __name__ == "__main__": + main() diff --git a/psycopg2/tests/test_psycopg2_dbapi20.py b/psycopg2/tests/test_psycopg2_dbapi20.py new file mode 100644 index 00000000..028b718c --- /dev/null +++ b/psycopg2/tests/test_psycopg2_dbapi20.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python +import dbapi20 +import unittest +import psycopg2 +import popen2 + +class test_Psycopg(dbapi20.DatabaseAPI20Test): + driver = psycopg2 + connect_args = () + connect_kw_args = {'dsn': 'dbname=dbapi20_test'} + + lower_func = 'lower' # For stored procedure test + + def setUp(self): + # Call superclass setUp In case this does something in the + # future + dbapi20.DatabaseAPI20Test.setUp(self) + + try: + con = self._connect() + con.close() + except: + cmd = "psql -c 'create database dbapi20_test' template1" + cout,cin = popen2.popen2(cmd) + cin.close() + cout.read() + + def tearDown(self): + dbapi20.DatabaseAPI20Test.tearDown(self) + + def test_nextset(self): pass + def test_setoutputsize(self): pass + +if __name__ == '__main__': + unittest.main() diff --git a/psycopg2/tests/types_basic.py b/psycopg2/tests/types_basic.py new file mode 100644 index 00000000..446ad153 --- /dev/null +++ b/psycopg2/tests/types_basic.py @@ -0,0 +1,87 @@ +# types_basic.py - tests for basic types conversions +# +# Copyright (C) 2004 Federico Di Gregorio <fog@debian.org> +# +# 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 the +# Free Software Foundation; either version 2, or (at your option) any later +# version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. + +import sys +try: + import decimal +except: + pass +import psycopg2 +from unittest import TestCase, TestSuite, main + + +class TypesBasicTests(TestCase): + """Test presence of mandatory attributes and methods.""" + + def setUp(self): + self.conn = psycopg2.connect("dbname=test") + + def execute(self, *args): + curs = self.conn.cursor() + curs.execute(*args) + return curs.fetchone()[0] + + def testQuoting(self): + s = "Quote'this\\! ''ok?''" + self.failUnless(self.execute("SELECT %s AS foo", (s,)) == s, + "wrong quoting: " + s) + + def testUnicode(self): + s = u"Quote'this\\! ''ok?''" + self.failUnless(self.execute("SELECT %s AS foo", (s,)) == s, + "wrong unicode quoting: " + s) + + def testNumber(self): + s = self.execute("SELECT %s AS foo", (1971,)) + self.failUnless(s == 1971, "wrong integer quoting: " + str(s)) + s = self.execute("SELECT %s AS foo", (1971L,)) + self.failUnless(s == 1971L, "wrong integer quoting: " + str(s)) + # Python 2.4 defaults to Decimal? + if sys.version_info[0] >= 2 and sys.version_info[1] >= 4: + s = self.execute("SELECT %s AS foo", (19.10,)) + self.failUnless(s - decimal.Decimal("19.10") == 0, + "wrong decimal quoting: " + str(s)) + else: + s = self.execute("SELECT %s AS foo", (19.10,)) + self.failUnless(abs(s - 19.10) < 0.001, + "wrong float quoting: " + str(s)) + + def testBinary(self): + s = ''.join([chr(x) for x in range(256)]) + b = psycopg2.Binary(s) + r = str(self.execute("SELECT %s::bytea AS foo", (b,))) + self.failUnless(r == s, "wrong binary quoting") + # test to make sure an empty Binary is converted to an empty string + b = psycopg2.Binary('') + self.assertEqual(str(b), "''") + + def testArray(self): + s = self.execute("SELECT %s AS foo", ([[1,2],[3,4]],)) + self.failUnless(s == [[1,2],[3,4]], "wrong array quoting " + str(s)) + s = self.execute("SELECT %s AS foo", (['one', 'two', 'three'],)) + self.failUnless(s == ['one', 'two', 'three'], + "wrong array quoting " + str(s)) + + +class TypesBasicSuite(TestSuite): + """Build a suite of all tests.""" + + def __init__(self): + """Build a list of tests.""" + self.tests = [x for x in dir(TypesBasicTests) if x.startswith('test')] + TestSuite.__init__(self, map(TestModule, self.tests)) + + +if __name__ == "__main__": + main() -- 2.47.0