summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2011-12-15 23:58:22 +0000
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2011-12-15 23:58:22 +0000
commitb7214216330c4d5b77b2e3389893a3c66b88d218 (patch)
tree53c192af5c8a898ccc1b0a56a0e0857347a928f7 /examples
parentc3914b8aa28d9de9834091bf509f5bb1d6f47781 (diff)
downloadpsycopg2-b7214216330c4d5b77b2e3389893a3c66b88d218.tar.gz
A bunch of typos fixed in the examples by Josh Kupershmidt
Diffstat (limited to 'examples')
-rw-r--r--examples/binary.py4
-rw-r--r--examples/copy_from.py4
-rw-r--r--examples/copy_to.py2
-rw-r--r--examples/cursor.py2
-rw-r--r--examples/dialtone.py6
-rw-r--r--examples/dt.py6
-rw-r--r--examples/fetch.py4
-rw-r--r--examples/lastrowid.py2
-rw-r--r--examples/notify.py2
-rw-r--r--examples/threads.py6
-rw-r--r--examples/usercast.py2
11 files changed, 20 insertions, 20 deletions
diff --git a/examples/binary.py b/examples/binary.py
index 89d5c73..804735b 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 8dd7efd..861dfdb 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 4c1398f..ec64794 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 f3b2add..2d56fd7 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 3a55686..a89021c 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 3ab5ee8..c876590 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 996f7b7..b47ed3f 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 827f7c2..12c9174 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 2c2e139..9b9a2d7 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 3c2ef0b..3f2c05f 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 9540b28..a0210f7 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