Skip to content

Commit b752992

Browse files
author
James William Pye
committed
Rename connection/connector (strip PGAPI).
Remove references to terminfo library. (probably add it back it once we see a 3.0 library.)
1 parent 38a5f0a commit b752992

1 file changed

Lines changed: 7 additions & 26 deletions

File tree

postgresql/driver/tracenull.py

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,6 @@
2525
from postgresql.protocol.buffer import pq_message_stream
2626
import postgresql.protocol.typio as pg_typio
2727

28-
try:
29-
import termstyle
30-
message_style = {
31-
'WARNING' : termstyle.FG_YELLOW,
32-
'INFO' : termstyle.FG_GREEN,
33-
'NOTICE' : termstyle.FG_BLUE,
34-
'DEBUG' : termstyle.FG_CYAN,
35-
'ERROR' : termstyle.FG_RED,
36-
'FATAL' : termstyle.FG_RED + termstyle.BOLD,
37-
'PANIC' : termstyle.FG_RED + termstyle.REVERSE,
38-
}
39-
except ImportError:
40-
pass
41-
4228
def secure_socket(
4329
connection,
4430
keyfile = None,
@@ -782,11 +768,6 @@ def prepare(self):
782768
self.prime()
783769
self.finish()
784770

785-
def reprepare(self):
786-
self.close()
787-
self.prime()
788-
self.finish()
789-
790771
def prime(self):
791772
"""
792773
Push initialization messages to the server, but don't wait for
@@ -1431,9 +1412,9 @@ def wrap(self, callable, *args, **kw):
14311412
self.commit()
14321413
return xrob
14331414

1434-
class PGAPI_Connection(pg_api.Connection):
1415+
class Connection(pg_api.Connection):
14351416
"""
1436-
PGAPI_Connection(connector) -> PGAPI_Connection
1417+
Connection(connector) -> Connection
14371418
14381419
PG-API <- Driver -> PQ Protocol <- Socket -> PostgreSQL
14391420
"""
@@ -2157,7 +2138,7 @@ def __init__(self, connector, *args, **kw):
21572138
self.settings.subscribe('TimeZone', self._update_timezone)
21582139
self.xact = TransactionManager(self)
21592140
self._reset()
2160-
# class PGAPI_Connection
2141+
# class Connection
21612142

21622143
def format_message(msg):
21632144
loc = [
@@ -2196,15 +2177,15 @@ def stderr_notifier(c, msg, termstyle = termstyle):
21962177
def stderr_notifier(c, msg):
21972178
sys.stderr.write(format_message(msg))
21982179

2199-
class PGAPI_Connector(object):
2200-
"""PGAPI_Connector(**config) -> Connector
2180+
class Connector(object):
2181+
"""Connector(**config) -> Connector
22012182
22022183
All arguments to Connector are keywords. At the very least, user,
22032184
and socket, may be provided. If socket, unix, or process is not
22042185
provided, host and port must be.
22052186
"""
22062187

2207-
connection_class = PGAPI_Connection
2188+
connection_class = Connection
22082189
sslmode = 'prefer'
22092190
words = (
22102191
'user',
@@ -2362,4 +2343,4 @@ def __init__(self, **kw):
23622343
tnkw['options'] = self.options
23632344

23642345
self._parameters = tnkw
2365-
# class PGAPI_Connector
2346+
# class Connector

0 commit comments

Comments
 (0)