From b7214216330c4d5b77b2e3389893a3c66b88d218 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Thu, 15 Dec 2011 23:58:22 +0000 Subject: [PATCH] A bunch of typos fixed in the examples by Josh Kupershmidt --- README | 2 +- examples/binary.py | 4 ++-- examples/copy_from.py | 4 ++-- examples/copy_to.py | 2 +- examples/cursor.py | 2 +- examples/dialtone.py | 6 +++--- examples/dt.py | 6 +++--- examples/fetch.py | 4 ++-- examples/lastrowid.py | 2 +- examples/notify.py | 2 +- examples/threads.py | 6 +++--- examples/usercast.py | 2 +- 12 files changed, 21 insertions(+), 21 deletions(-) diff --git a/README b/README index 93d25d0c..7466bf91 100644 --- a/README +++ b/README @@ -8,7 +8,7 @@ and stable as a rock. psycopg2 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. psycopg2 also provide full asycronous operations and support +UPDATEs. psycopg2 also provides full asynchronous operations and support for coroutine libraries. psycopg2 can compile and run on Linux, FreeBSD, Solaris, MacOS X and diff --git a/examples/binary.py b/examples/binary.py index 89d5c739..804735b6 100644 --- a/examples/binary.py +++ b/examples/binary.py @@ -16,7 +16,7 @@ DSN = 'dbname=test' -## don't modify anything below tis line (except for experimenting) +## don't modify anything below this line (except for experimenting) import sys import psycopg2 @@ -79,7 +79,7 @@ for row in curs.fetchall(): 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 +# this rollback is required because we can't drop a table with a binary cusor # declared and still open conn.rollback() diff --git a/examples/copy_from.py b/examples/copy_from.py index 8dd7efd8..861dfdb8 100644 --- a/examples/copy_from.py +++ b/examples/copy_from.py @@ -17,7 +17,7 @@ DSN = 'dbname=test' -## don't modify anything below tis line (except for experimenting) +## don't modify anything below this line (except for experimenting) import sys import os @@ -165,7 +165,7 @@ try: curs.copy_from(data, 'test_copy') except StandardError, err: conn.rollback() - print " Catched error (as expected):\n", err + print " Caught error (as expected):\n", err conn.rollback() diff --git a/examples/copy_to.py b/examples/copy_to.py index 4c1398fd..ec647945 100644 --- a/examples/copy_to.py +++ b/examples/copy_to.py @@ -17,7 +17,7 @@ DSN = 'dbname=test' -## don't modify anything below tis line (except for experimenting) +## don't modify anything below this line (except for experimenting) import sys import os diff --git a/examples/cursor.py b/examples/cursor.py index f3b2addb..2d56fd73 100644 --- a/examples/cursor.py +++ b/examples/cursor.py @@ -58,6 +58,6 @@ print "Result of fetchone():", curs.fetchone() try: curs.fetchone() except NoDataError, err: - print "Exception caugth:", err + print "Exception caught:", err conn.rollback() diff --git a/examples/dialtone.py b/examples/dialtone.py index 3a55686d..a89021ce 100644 --- a/examples/dialtone.py +++ b/examples/dialtone.py @@ -104,10 +104,10 @@ 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 +adaptation is that it enables 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 +This recipe tries to focus 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. @@ -116,7 +116,7 @@ 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 +In these lines 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). diff --git a/examples/dt.py b/examples/dt.py index 3ab5ee8d..c876590a 100644 --- a/examples/dt.py +++ b/examples/dt.py @@ -16,7 +16,7 @@ DSN = 'dbname=test' -## don't modify anything below tis line (except for experimenting) +## don't modify anything below this line (except for experimenting) import sys import psycopg2 @@ -73,7 +73,7 @@ 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 + # this will work only if 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() @@ -87,7 +87,7 @@ 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 + # this will work only if psycopg has been compiled with datetime # as the default typecaster for date/time values s = repr(n) + "\n -> " + repr(x) + "\n -> " + x.isoformat() except: diff --git a/examples/fetch.py b/examples/fetch.py index 996f7b74..b47ed3f1 100644 --- a/examples/fetch.py +++ b/examples/fetch.py @@ -16,7 +16,7 @@ DSN = 'dbname=test' -## don't modify anything below tis line (except for experimenting) +## don't modify anything below this line (except for experimenting) import sys import psycopg2 @@ -52,7 +52,7 @@ 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 +# we don't need to DECLARE ourselves, psycopg now supports named # cursors (but we leave the code here, comments, as an example of # what psycopg is doing under the hood) # diff --git a/examples/lastrowid.py b/examples/lastrowid.py index 827f7c22..12c9174c 100644 --- a/examples/lastrowid.py +++ b/examples/lastrowid.py @@ -16,7 +16,7 @@ DSN = 'dbname=test' -## don't modify anything below tis line (except for experimenting) +## don't modify anything below this line (except for experimenting) import sys, psycopg2 diff --git a/examples/notify.py b/examples/notify.py index 2c2e1395..9b9a2d79 100644 --- a/examples/notify.py +++ b/examples/notify.py @@ -16,7 +16,7 @@ DSN = 'dbname=test' -## don't modify anything below tis line (except for experimenting) +## don't modify anything below this line (except for experimenting) import sys import select diff --git a/examples/threads.py b/examples/threads.py index 3c2ef0be..3f2c05fd 100644 --- a/examples/threads.py +++ b/examples/threads.py @@ -29,12 +29,12 @@ SELECT_STEP = 500 SELECT_DIV = 250 # the available modes are: -# 0 - one connection for all insert and one for all select threads +# 0 - one connection for all inserts 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) +## don't modify anything below this line (except for experimenting) import sys, psycopg2, threading from psycopg2.pool import ThreadedConnectionPool @@ -90,7 +90,7 @@ def insert_func(conn_or_pool, rows): 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) +## database (and transfer them, putting some pressure on the network) def select_func(conn_or_pool, z): name = threading.currentThread().getName() diff --git a/examples/usercast.py b/examples/usercast.py index 9540b28f..a0210f77 100644 --- a/examples/usercast.py +++ b/examples/usercast.py @@ -17,7 +17,7 @@ DSN = 'dbname=test' -## don't modify anything below tis line (except for experimenting) +## don't modify anything below this line (except for experimenting) import sys import psycopg2