pgtoolkit/toolbase.py
changeset 30 a8b7cd92f39f
parent 29 8636719a30f6
child 31 c2e6e24b83d9
--- a/pgtoolkit/toolbase.py	Tue Feb 14 18:15:56 2012 +0100
+++ b/pgtoolkit/toolbase.py	Mon Feb 27 15:12:40 2012 +0100
@@ -22,6 +22,7 @@
         self.config.add_argument('meta_query')
         
         self.pgm = pgmanager.get_instance()
+        self.target_isolation_level = None
         
     def init(self, *args):
         self.config.load('pgtoolkit.conf')
@@ -59,7 +60,9 @@
             row = curs.fetchone_dict()
             curs.connection.commit()
             if row:
-                self.pgm.create_conn(name=name, **row)
+                self.pgm.create_conn(name=name,
+                    isolation_level=self.target_isolation_level,
+                    **row)
                 return True
 
     def prepare_conn_from_config(self, name, lookup_name):
@@ -67,13 +70,15 @@
         if self.config.databases:
             if lookup_name in self.config.databases:
                 dsn = self.config.databases[lookup_name]
-                self.pgm.create_conn(name=name, dsn=dsn)
+                self.pgm.create_conn(name=name,
+                    isolation_level=self.target_isolation_level,
+                    dsn=dsn)
                 return True
 
     def prepare_conns(self, *pgm_names):
         if self.config.meta_db:
             self.pgm.create_conn(name='meta', dsn=self.config.meta_db)
-            
+        
         for name in pgm_names:
             lookup_name = self.args.__dict__[name]
             found = self.prepare_conn_from_config(name, lookup_name)