Skip to content

Commit c849de7

Browse files
committed
Follow PEP8 rules for whitespace
1 parent 04ea766 commit c849de7

14 files changed

Lines changed: 144 additions & 144 deletions

DBUtils/Docs/UsersGuide.de.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ <h2>PersistentDB</h2>
322322
<p>Wenn Sie beispielsweise <span class="docutils literal">pgdb</span> als DB-API-2-Datenbankadapter verwenden, und
323323
möchten, dass jede Verbindung Ihrer lokalen Datenbank <span class="docutils literal">meinedb</span> 1000 mal
324324
wiederverwendet werden soll, sieht die Initialisierung so aus:</p>
325-
<pre class="literal-block">import pgdb # importiere das verwendete DB-API-2-Modul
325+
<pre class="literal-block">import pgdb # importiere das verwendete DB-API-2-Modul
326326
from DBUtils.PersistentDB import PersistentDB
327327
persist = PersistentDB(pgdb, 1000, database='meinedb')</pre>
328328
<p>Nachdem Sie den Generator mit diesen Parametern eingerichtet haben, können
@@ -406,7 +406,7 @@ <h2>PooledDB</h2>
406406
<p>Wenn Sie beispielsweise <span class="docutils literal">pgdb</span> als DB-API-2-Datenbankadapter benutzen,
407407
und einen Pool von mindestens fünf Datenbankverbindungen zu Ihrer Datenbank
408408
<span class="docutils literal">meinedb</span> verwenden möchten, dann sieht die Initialisierung so aus:</p>
409-
<pre class="literal-block">import pgdb # importiere das verwendete DB-API-2-Modul
409+
<pre class="literal-block">import pgdb # importiere das verwendete DB-API-2-Modul
410410
from DBUtils.PooledDB import PooledDB
411411
pool = PooledDB(pgdb, 5, database='meinedb')</pre>
412412
<p>Nachdem Sie den Pool für Datenbankverbindungen so eingerichtet haben, können
@@ -436,8 +436,8 @@ <h2>PooledDB</h2>
436436
cur = db.cursor()
437437
cur.execute(...)
438438
res = cur.fetchone()
439-
cur.close() # oder del cur
440-
db.close() # oder del db</pre>
439+
cur.close() # oder del cur
440+
db.close() # oder del db</pre>
441441
<p>Bitte beachten Sie, dass Transaktionen explizit durch Aufruf der Methode
442442
<span class="docutils literal">begin()</span> eingeleiten werden müssen. Hierdurch wird sichergestellt,
443443
dass die Verbindung nicht mehr mit anderen Threads geteilt wird, dass das

DBUtils/Docs/UsersGuide.de.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ Wenn Sie beispielsweise ``pgdb`` als DB-API-2-Datenbankadapter verwenden, und
303303
möchten, dass jede Verbindung Ihrer lokalen Datenbank ``meinedb`` 1000 mal
304304
wiederverwendet werden soll, sieht die Initialisierung so aus::
305305

306-
import pgdb # importiere das verwendete DB-API-2-Modul
306+
import pgdb # importiere das verwendete DB-API-2-Modul
307307
from DBUtils.PersistentDB import PersistentDB
308308
persist = PersistentDB(pgdb, 1000, database='meinedb')
309309

@@ -405,7 +405,7 @@ Wenn Sie beispielsweise ``pgdb`` als DB-API-2-Datenbankadapter benutzen,
405405
und einen Pool von mindestens fünf Datenbankverbindungen zu Ihrer Datenbank
406406
``meinedb`` verwenden möchten, dann sieht die Initialisierung so aus::
407407

408-
import pgdb # importiere das verwendete DB-API-2-Modul
408+
import pgdb # importiere das verwendete DB-API-2-Modul
409409
from DBUtils.PooledDB import PooledDB
410410
pool = PooledDB(pgdb, 5, database='meinedb')
411411

@@ -447,8 +447,8 @@ sie gebraucht werden, etwa so::
447447
cur = db.cursor()
448448
cur.execute(...)
449449
res = cur.fetchone()
450-
cur.close() # oder del cur
451-
db.close() # oder del db
450+
cur.close() # oder del cur
451+
db.close() # oder del db
452452

453453
Bitte beachten Sie, dass Transaktionen explizit durch Aufruf der Methode
454454
``begin()`` eingeleiten werden müssen. Hierdurch wird sichergestellt,

DBUtils/Docs/UsersGuide.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ <h2>PersistentDB</h2>
204204
for this specific thread. When the thread closes the database connection,
205205
it will still be kept open so that the next time when a connection is
206206
requested by the same thread, this already opened connection can be used.
207-
The connecton will be closed automatically when the thread dies.</p>
207+
The connection will be closed automatically when the thread dies.</p>
208208
<p>In short: <span class="docutils literal">PersistentDB</span> tries to recycle database connections to
209209
increase the overall database access performance of your threaded application,
210210
but it makes sure that connections are never shared between threads.</p>
@@ -300,7 +300,7 @@ <h2>PersistentDB</h2>
300300
</ul>
301301
<p>For instance, if you are using <span class="docutils literal">pgdb</span> as your DB-API 2 database module and
302302
want every connection to your local database <span class="docutils literal">mydb</span> to be reused 1000 times:</p>
303-
<pre class="literal-block">import pgdb # import used DB-API 2 module
303+
<pre class="literal-block">import pgdb # import used DB-API 2 module
304304
from DBUtils.PersistentDB import PersistentDB
305305
persist = PersistentDB(pgdb, 1000, database='mydb')</pre>
306306
<p>Once you have set up the generator with these parameters, you can request
@@ -372,7 +372,7 @@ <h2>PooledDB</h2>
372372
</ul>
373373
<p>For instance, if you are using <span class="docutils literal">pgdb</span> as your DB-API 2 database module and
374374
want a pool of at least five connections to your local database <span class="docutils literal">mydb</span>:</p>
375-
<pre class="literal-block">import pgdb # import used DB-API 2 module
375+
<pre class="literal-block">import pgdb # import used DB-API 2 module
376376
from DBUtils.PooledDB import PooledDB
377377
pool = PooledDB(pgdb, 5, database='mydb')</pre>
378378
<p>Once you have set up the connection pool you can request database connections
@@ -398,8 +398,8 @@ <h2>PooledDB</h2>
398398
cur = db.cursor()
399399
cur.execute(...)
400400
res = cur.fetchone()
401-
cur.close() # or del cur
402-
db.close() # or del db</pre>
401+
cur.close() # or del cur
402+
db.close() # or del db</pre>
403403
<p>Note that you need to explicitly start transactions by calling the
404404
<span class="docutils literal">begin()</span> method. This ensures that the connection will not be shared
405405
with other threads, that the transparent reopening will be suspended

DBUtils/Docs/UsersGuide.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ connection to the database will be opened that will be used from now on
164164
for this specific thread. When the thread closes the database connection,
165165
it will still be kept open so that the next time when a connection is
166166
requested by the same thread, this already opened connection can be used.
167-
The connecton will be closed automatically when the thread dies.
167+
The connection will be closed automatically when the thread dies.
168168

169169
In short: ``PersistentDB`` tries to recycle database connections to
170170
increase the overall database access performance of your threaded application,
@@ -280,7 +280,7 @@ of ``PersistentDB``, passing the following parameters:
280280
For instance, if you are using ``pgdb`` as your DB-API 2 database module and
281281
want every connection to your local database ``mydb`` to be reused 1000 times::
282282

283-
import pgdb # import used DB-API 2 module
283+
import pgdb # import used DB-API 2 module
284284
from DBUtils.PersistentDB import PersistentDB
285285
persist = PersistentDB(pgdb, 1000, database='mydb')
286286

@@ -370,7 +370,7 @@ following parameters:
370370
For instance, if you are using ``pgdb`` as your DB-API 2 database module and
371371
want a pool of at least five connections to your local database ``mydb``::
372372

373-
import pgdb # import used DB-API 2 module
373+
import pgdb # import used DB-API 2 module
374374
from DBUtils.PooledDB import PooledDB
375375
pool = PooledDB(pgdb, 5, database='mydb')
376376

@@ -408,8 +408,8 @@ object stays alive as long as you are using it, like that::
408408
cur = db.cursor()
409409
cur.execute(...)
410410
res = cur.fetchone()
411-
cur.close() # or del cur
412-
db.close() # or del db
411+
cur.close() # or del cur
412+
db.close() # or del db
413413

414414
Note that you need to explicitly start transactions by calling the
415415
``begin()`` method. This ensures that the connection will not be shared

DBUtils/Examples/DBUtilsExample.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ class DBUtilsExample(ExamplePage):
4444
else:
4545
dbmod_name = 'Pooled'
4646
dbapi_name = config.pop('dbapi', 'pg')
47-
if dbapi_name == 'pg': # use the PyGreSQL classic DB API
47+
if dbapi_name == 'pg': # use the PyGreSQL classic DB API
4848
dbmod_name += 'Pg'
4949
if config.has_key('database'):
5050
config['dbname'] = config['database']
5151
del config['database']
5252
if config.has_key('password'):
5353
config['passwd'] = config['password']
5454
del config['password']
55-
else: # use a DB-API 2 compliant module
55+
else: # use a DB-API 2 compliant module
5656
dbmod_name += 'DB'
5757
dbapi = dbmod = dbclass = dbstatus = None
5858
try:

DBUtils/PersistentDB.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
1717
Measures are taken to make the database connections thread-affine.
1818
This means the same thread always uses the same cached connection,
19-
and no other thread will use it. So even if the underlying DB-API module
19+
and no other thread will use it. So even if the underlying DB-API module
2020
is not thread-safe at the connection level this will be no problem here.
2121
2222
For best performance, the application server should keep threads persistent.
@@ -56,14 +56,14 @@
5656
5757
The creator function or the connect function of the DB-API 2 compliant
5858
database module specified as the creator will receive any additional
59-
parameters such as the host, database, user, password etc. You may
59+
parameters such as the host, database, user, password etc. You may
6060
choose some or all of these parameters in your own creator function,
6161
allowing for sophisticated failover and load-balancing mechanisms.
6262
6363
For instance, if you are using pgdb as your DB-API 2 database module and want
6464
every connection to your local database 'mydb' to be reused 1000 times:
6565
66-
import pgdb # import used DB-API 2 module
66+
import pgdb # import used DB-API 2 module
6767
from DBUtils.PersistentDB import PersistentDB
6868
persist = PersistentDB(pgdb, 1000, database='mydb')
6969
@@ -73,17 +73,17 @@
7373
db = persist.connection()
7474
7575
You can use these connections just as if they were ordinary
76-
DB-API 2 connections. Actually what you get is the hardened
76+
DB-API 2 connections. Actually what you get is the hardened
7777
SteadyDB version of the underlying DB-API 2 connection.
7878
7979
Closing a persistent connection with db.close() will be silently
8080
ignored since it would be reopened at the next usage anyway and
81-
contrary to the intent of having persistent connections. Instead,
81+
contrary to the intent of having persistent connections. Instead,
8282
the connection will be automatically closed when the thread dies.
8383
You can change this behavior be setting the closeable parameter.
8484
8585
Note that you need to explicitly start transactions by calling the
86-
begin() method. This ensures that the transparent reopening will be
86+
begin() method. This ensures that the transparent reopening will be
8787
suspended until the end of the transaction, and that the connection
8888
will be rolled back before being reused by the same thread.
8989
@@ -199,7 +199,7 @@ def connection(self, shareable=False):
199199
"""Get a steady, persistent DB-API 2 connection.
200200
201201
The shareable parameter exists only for compatibility with the
202-
PooledDB connection method. In reality, persistent connections
202+
PooledDB connection method. In reality, persistent connections
203203
are of course never shared with other threads.
204204
205205
"""

DBUtils/PersistentPg.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
1717
Measures are taken to make the database connections thread-affine.
1818
This means the same thread always uses the same cached connection,
19-
and no other thread will use it. So the fact that the classic PyGreSQL
19+
and no other thread will use it. So the fact that the classic PyGreSQL
2020
pg module is not thread-safe at the connection level is no problem here.
2121
2222
For best performance, the application server should keep threads persistent.
@@ -63,19 +63,19 @@
6363
db = persist.connection()
6464
6565
You can use these connections just as if they were ordinary
66-
classic PyGreSQL API connections. Actually what you get is the
66+
classic PyGreSQL API connections. Actually what you get is the
6767
hardened SteadyPg version of a classic PyGreSQL connection.
6868
6969
Closing a persistent connection with db.close() will be silently
7070
ignored since it would be reopened at the next usage anyway and
71-
contrary to the intent of having persistent connections. Instead,
71+
contrary to the intent of having persistent connections. Instead,
7272
the connection will be automatically closed when the thread dies.
7373
You can change this behavior be setting the closeable parameter.
7474
7575
Note that you need to explicitly start transactions by calling the
76-
begin() method. This ensures that the transparent reopening will be
76+
begin() method. This ensures that the transparent reopening will be
7777
suspended until the end of the transaction, and that the connection
78-
will be rolled back before being reused in the same thread. To end
78+
will be rolled back before being reused in the same thread. To end
7979
transactions, use one of the end(), commit() or rollback() methods.
8080
8181
By setting the threadlocal parameter to threading.local, getting

0 commit comments

Comments
 (0)