File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3232)
3333
3434pg_iri = pg_driver = pg_param = None
35- def open (iri = None , ** kw ):
35+ def open (iri = None , prompt_title = None , ** kw ):
3636 """
3737 Create a `postgresql.api.Connection` to the server referenced by the given
3838 `iri`::
@@ -44,9 +44,6 @@ def open(iri = None, **kw):
4444 # Connect to 'postgres' at localhost.
4545 >>> db = postgresql.open('localhost/postgres')
4646
47- If the URL starts with an '&', a connector will be returned instead of a
48- connection.
49-
5047 (Note: "pq" is the name of the protocol used to communicate with PostgreSQL)
5148 """
5249 global pg_iri , pg_driver , pg_param
@@ -72,7 +69,7 @@ def open(iri = None, **kw):
7269 list (pg_param .denormalize_parameters (kw ))
7370 )
7471 # Resolve the password, but never prompt.
75- pg_param .resolve_password (params , prompt_title = None )
72+ pg_param .resolve_password (params , prompt_title = prompt_title )
7673
7774 C = pg_driver .default .fit (** params )
7875 if return_connector is True :
Original file line number Diff line number Diff line change @@ -375,7 +375,7 @@ def rollback(self):
375375 self ._xact .start ()
376376
377377driver = pg_driver .Driver (connection = Connection )
378- def connect (** kw ):
378+ def connect (prompt_title = None , ** kw ):
379379 """
380380 Create a DB-API connection using the given parameters.
381381 """
@@ -385,5 +385,5 @@ def connect(**kw):
385385 list (pg_param .denormalize_parameters (kw ))
386386 )
387387 # Resolve the password, but never prompt.
388- pg_param .resolve_password (params , prompt_title = None )
388+ pg_param .resolve_password (params , prompt_title = prompt_title )
389389 return driver .connect (** params )
Original file line number Diff line number Diff line change 2424from abc import abstractmethod , abstractproperty
2525
2626from .. import lib as pg_lib
27- from ..lib import sys as pg_sys
2827
2928from .. import versionstring as pg_version
3029from .. import iri as pg_iri
@@ -1919,7 +1918,7 @@ def connect(self):
19191918 ),
19201919 )
19211920 # manual binding
1922- self .sys = pg_lib .Binding (self , pg_sys )
1921+ self .sys = pg_lib .Binding (self , pg_lib . sys )
19231922
19241923 # Get the *full* version string.
19251924 self .version = self .prepare ("SELECT pg_catalog.version()" ).first ()
You can’t perform that action at this time.
0 commit comments