Permalink
Browse files

A bunch of typos fixed in the examples by Josh Kupershmidt

  • Loading branch information...
1 parent c3914b8 commit b7214216330c4d5b77b2e3389893a3c66b88d218 @dvarrazzo committed Dec 15, 2011
View
2 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
View
4 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 @@
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()
View
4 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 @@
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()
View
2 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
View
2 examples/cursor.py
@@ -58,6 +58,6 @@ def fetchone(self):
try:
curs.fetchone()
except NoDataError, err:
- print "Exception caugth:", err
+ print "Exception caught:", err
conn.rollback()
View
6 examples/dialtone.py
@@ -104,10 +104,10 @@ def __init__(self):
- 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 @@ def __init__(self):
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).
View
6 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 @@
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 @@
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:
View
4 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 @@ def flatten(l):
# 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)
#
View
2 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
View
2 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
View
6 examples/threads.py
@@ -29,12 +29,12 @@
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()
View
2 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

0 comments on commit b721421

Please sign in to comment.