Skip to content

Commit 621d68c

Browse files
author
James William Pye
committed
Fix postgresq.cluster and add some basic tests.
* configfile.ConfigFile api.Settings implementation didn't implement all the interfaces. * Make Cluster.wait_until_stopped poll the daemon process if it's available; apparantly, the process would zombie until Python quit. Seems strange.. * Add various, basic connectivity interfaces to Cluster. * Add test_cluster; still needs tests, but this covers the basic initialization, start, connect, and stop functionality. [pq3] * Only incur further fetches and expansions if the position in the buffer reaches a certain point. Prior, it would fetch another set each time a read occurred.
1 parent ef645f2 commit 621d68c

8 files changed

Lines changed: 370 additions & 121 deletions

File tree

postgresql/__init__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,24 @@
55
"""
66
py-postgresql
77
=============
8+
9+
py-postgresql is a Python library for using PostgreSQL. This includes low-level
10+
protocol tools, a driver(PG-API and DB-API), and cluster management tools.
811
"""
912
__author__ = "James William Pye <x@jwp.name>"
1013
__date__ = "2009-01-19 21:15:00-07"
1114

15+
__project__ = 'py-postgresql'
16+
__project_id__ = 'http://python.projects.postgresql.org'
17+
1218
__version__ = "0.8dev"
1319
version_info = (0, 8, 0, 'dev', 0)
1420

21+
##
22+
# IRI to base reference documentation.
23+
__pkg_documentation__ = __project_id__ + '/v' + '.'.join([
24+
str(x) for x in version_info[:2]
25+
]) + '/'
26+
1527
#'PGGSSLIB' : 'gsslib',
1628
#'PGLOCALEDIR' : 'localedir',

postgresql/api.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,18 +383,20 @@ def ife_snapshot_text(self):
383383
"line {1!s}, in {2!s}".format(*loc)
384384
)
385385

386+
code = (os.linesep + "CODE: " + self.code) if self.code else ""
387+
386388
sev = details.get('severity')
387389
sevmsg = os.linesep
388390
if sev:
389391
sevmsg = os.linesep + "SEVERITY: " + sev.upper()
390392
detailstr = os.linesep.join((
391-
': '.join((k.upper(), v))
393+
': '.join((k.upper(), str(v)))
392394
for k, v in sorted(details.items(), key = itemgetter(0))
393395
if k not in ('message', 'severity', 'file', 'function', 'line')
394396
))
395397
if detailstr:
396398
detailstr = os.linesep + detailstr
397-
return self.message + sevmsg + detailstr + locstr
399+
return self.message + code + sevmsg + detailstr + locstr
398400

399401
def emit(self):
400402
self.snapshot = self.ife_lineage_snapshot_text()

0 commit comments

Comments
 (0)