From: Mike Bayer Date: Mon, 25 Sep 2006 16:22:32 +0000 (+0000) Subject: doc edits, moved object display in uowdumper to be hex, fixed test runner in parseconnect X-Git-Tag: rel_0_3_0~126 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=46dcf1fa5d15af427d718ede77466e2699f3c046;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git doc edits, moved object display in uowdumper to be hex, fixed test runner in parseconnect --- diff --git a/doc/build/content/sqlconstruction.txt b/doc/build/content/sqlconstruction.txt index a7c2ef23fb..ed8faae680 100644 --- a/doc/build/content/sqlconstruction.txt +++ b/doc/build/content/sqlconstruction.txt @@ -132,7 +132,7 @@ The object returned by `execute()` is a `sqlalchemy.engine.ResultProxy` object, # return the underlying connection resources back to # the connection pool. de-referencing the result # will also have the same effect. if an explicit Connection was - # used, then close() does nothing. + # used, then close() just closes the underlying cursor object. result.close() #### Using Column Labels {@name=labels} diff --git a/lib/sqlalchemy/engine/__init__.py b/lib/sqlalchemy/engine/__init__.py index 2cb94a90d6..e2a8edf695 100644 --- a/lib/sqlalchemy/engine/__init__.py +++ b/lib/sqlalchemy/engine/__init__.py @@ -38,7 +38,7 @@ def create_engine(*args, **kwargs): locates that strategy and invokes its create() method to produce the Engine. The strategies themselves are instances of EngineStrategy, and the built in ones are present in the sqlalchemy.engine.strategies module. Current implementations - include "plain" and "threadlocal". The default used by this function is "threadlocal". + include "plain" and "threadlocal". The default used by this function is "plain". "plain" provides support for a Connection object which can be used to execute SQL queries with a specific underlying DBAPI connection. diff --git a/lib/sqlalchemy/orm/uowdumper.py b/lib/sqlalchemy/orm/uowdumper.py index e08965ce1c..e284ebf324 100644 --- a/lib/sqlalchemy/orm/uowdumper.py +++ b/lib/sqlalchemy/orm/uowdumper.py @@ -108,7 +108,7 @@ class UOWDumper(unitofwork.UOWExecutor): super(UOWDumper, self).execute_per_element_childtasks(trans, task, isdelete) def execute_element_childtasks(self, trans, element, isdelete): - self.header("%s subelements of UOWTaskElement(%s)" % ((isdelete and "Delete" or "Save"), id(element))) + self.header("%s subelements of UOWTaskElement(%s)" % ((isdelete and "Delete" or "Save"), hex(id(element)))) super(UOWDumper, self).execute_element_childtasks(trans, element, isdelete) self.closeheader() @@ -122,7 +122,7 @@ class UOWDumper(unitofwork.UOWExecutor): self.buf.write(self._indent() + " |- %s attribute on %s (UOWDependencyProcessor(%d) processing %s)\n" % ( repr(proc.processor.key), ("%s's to be %s" % (self._repr_task_class(proc.targettask), deletes and "deleted" or "saved")), - id(proc), + hex(id(proc)), self._repr_task(proc.targettask)) ) elif False: @@ -143,11 +143,11 @@ class UOWDumper(unitofwork.UOWExecutor): objid = "(placeholder)" else: if attribute is not None: - objid = "%s(%d).%s" % (te.obj.__class__.__name__, id(te.obj), attribute) + objid = "%s(%s).%s" % (te.obj.__class__.__name__, hex(id(te.obj)), attribute) else: - objid = "%s(%d)" % (te.obj.__class__.__name__, id(te.obj)) + objid = "%s(%s)" % (te.obj.__class__.__name__, hex(id(te.obj))) if self.verbose: - return "%s (UOWTaskElement(%d, %s))" % (objid, id(te), (te.listonly and 'listonly' or (te.isdelete and 'delete' or 'save'))) + return "%s (UOWTaskElement(%s, %s))" % (objid, hex(id(te)), (te.listonly and 'listonly' or (te.isdelete and 'delete' or 'save'))) elif process: return "Process %s" % (objid) else: @@ -162,9 +162,9 @@ class UOWDumper(unitofwork.UOWExecutor): else: name = '(none)' if task.circular_parent: - return ("UOWTask(%d->%d, %s)" % (id(task.circular_parent), id(task), name)) + return ("UOWTask(%s->%s, %s)" % (hex(id(task.circular_parent)), hex(id(task)), name)) else: - return ("UOWTask(%d, %s)" % (id(task), name)) + return ("UOWTask(%s, %s)" % (hex(id(task)), name)) def _repr_task_class(self, task): if task.mapper is not None and task.mapper.__class__.__name__ == 'Mapper': @@ -173,7 +173,7 @@ class UOWDumper(unitofwork.UOWExecutor): return '(none)' def _repr(self, obj): - return "%s(%d)" % (obj.__class__.__name__, id(obj)) + return "%s(%s)" % (obj.__class__.__name__, hex(id(obj))) def _indent(self): return " |" * self.indent diff --git a/test/engine/parseconnect.py b/test/engine/parseconnect.py index 5fffb4ae74..9af594a98b 100644 --- a/test/engine/parseconnect.py +++ b/test/engine/parseconnect.py @@ -1,4 +1,5 @@ from testbase import PersistTest +import testbase import sqlalchemy.engine.url as url from sqlalchemy import * import unittest @@ -87,5 +88,5 @@ class MockCursor(object): mock_dbapi = MockDBAPI() if __name__ == "__main__": - unittest.main() + testbase.main() \ No newline at end of file