|
25 | 25 | from postgresql.protocol.buffer import pq_message_stream |
26 | 26 | import postgresql.protocol.typio as pg_typio |
27 | 27 |
|
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 | | - |
42 | 28 | def secure_socket( |
43 | 29 | connection, |
44 | 30 | keyfile = None, |
@@ -782,11 +768,6 @@ def prepare(self): |
782 | 768 | self.prime() |
783 | 769 | self.finish() |
784 | 770 |
|
785 | | - def reprepare(self): |
786 | | - self.close() |
787 | | - self.prime() |
788 | | - self.finish() |
789 | | - |
790 | 771 | def prime(self): |
791 | 772 | """ |
792 | 773 | Push initialization messages to the server, but don't wait for |
@@ -1431,9 +1412,9 @@ def wrap(self, callable, *args, **kw): |
1431 | 1412 | self.commit() |
1432 | 1413 | return xrob |
1433 | 1414 |
|
1434 | | -class PGAPI_Connection(pg_api.Connection): |
| 1415 | +class Connection(pg_api.Connection): |
1435 | 1416 | """ |
1436 | | - PGAPI_Connection(connector) -> PGAPI_Connection |
| 1417 | + Connection(connector) -> Connection |
1437 | 1418 |
|
1438 | 1419 | PG-API <- Driver -> PQ Protocol <- Socket -> PostgreSQL |
1439 | 1420 | """ |
@@ -2157,7 +2138,7 @@ def __init__(self, connector, *args, **kw): |
2157 | 2138 | self.settings.subscribe('TimeZone', self._update_timezone) |
2158 | 2139 | self.xact = TransactionManager(self) |
2159 | 2140 | self._reset() |
2160 | | -# class PGAPI_Connection |
| 2141 | +# class Connection |
2161 | 2142 |
|
2162 | 2143 | def format_message(msg): |
2163 | 2144 | loc = [ |
@@ -2196,15 +2177,15 @@ def stderr_notifier(c, msg, termstyle = termstyle): |
2196 | 2177 | def stderr_notifier(c, msg): |
2197 | 2178 | sys.stderr.write(format_message(msg)) |
2198 | 2179 |
|
2199 | | -class PGAPI_Connector(object): |
2200 | | - """PGAPI_Connector(**config) -> Connector |
| 2180 | +class Connector(object): |
| 2181 | + """Connector(**config) -> Connector |
2201 | 2182 |
|
2202 | 2183 | All arguments to Connector are keywords. At the very least, user, |
2203 | 2184 | and socket, may be provided. If socket, unix, or process is not |
2204 | 2185 | provided, host and port must be. |
2205 | 2186 | """ |
2206 | 2187 |
|
2207 | | - connection_class = PGAPI_Connection |
| 2188 | + connection_class = Connection |
2208 | 2189 | sslmode = 'prefer' |
2209 | 2190 | words = ( |
2210 | 2191 | 'user', |
@@ -2362,4 +2343,4 @@ def __init__(self, **kw): |
2362 | 2343 | tnkw['options'] = self.options |
2363 | 2344 |
|
2364 | 2345 | self._parameters = tnkw |
2365 | | -# class PGAPI_Connector |
| 2346 | +# class Connector |
0 commit comments