[or-cvs] r19624: {torctl} DIAF SQLAlchemy. A token gesture at backwards compatibility (torctl/trunk/python/TorCtl)

mikeperry at seul.org mikeperry at seul.org
Wed Jun 3 20:31:16 UTC 2009


Author: mikeperry
Date: 2009-06-03 16:31:16 -0400 (Wed, 03 Jun 2009)
New Revision: 19624

Modified:
   torctl/trunk/python/TorCtl/SQLSupport.py
Log:

DIAF SQLAlchemy. A token gesture at backwards compatibility
wouldn't kill you, you know. Or at the very least, don't spit
stupid depricated warnigns at me when you do break it
needlessly and leave me with no other choice but to special
case for each version.




Modified: torctl/trunk/python/TorCtl/SQLSupport.py
===================================================================
--- torctl/trunk/python/TorCtl/SQLSupport.py	2009-06-03 20:18:39 UTC (rev 19623)
+++ torctl/trunk/python/TorCtl/SQLSupport.py	2009-06-03 20:31:16 UTC (rev 19624)
@@ -52,6 +52,11 @@
   if drop: drop_all()
   create_all()
 
+  if sqlalchemy.__version__ < "0.5.0":
+    # DIAF SQLAlchemy. A token gesture at backwards compatibility
+    # wouldn't kill you, you know.
+    tc_session.add = tc_session.save_or_update
+
 class Router(Entity):
   using_options(shortnames=True, order_by='-published', session=tc_session, metadata=tc_metadata)
   using_mapper_options(save_on_init=False)



More information about the tor-commits mailing list