[Thuban-commits] r2681 - in trunk/thuban: . Thuban Thuban/Model

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon May 15 18:11:47 CEST 2006


Author: dpinte
Date: 2006-05-15 18:11:46 +0200 (Mon, 15 May 2006)
New Revision: 2681

Modified:
   trunk/thuban/ChangeLog
   trunk/thuban/Thuban/Model/transientdb.py
   trunk/thuban/Thuban/version.py
Log:
2006-05-15 Didrik Pinte <dpinte at itae.be>
  * Thuban/version.py : coding style correction
  * Thuban/Model/transientdb.py : coding style correction
    


Modified: trunk/thuban/ChangeLog
===================================================================
--- trunk/thuban/ChangeLog	2006-05-15 14:36:50 UTC (rev 2680)
+++ trunk/thuban/ChangeLog	2006-05-15 16:11:46 UTC (rev 2681)
@@ -1,4 +1,8 @@
 2006-05-15 Didrik Pinte <dpinte at itae.be>
+  * Thuban/version.py : coding style correction	
+	* Thuban/Model/transientdb.py : coding style correction
+
+2006-05-15 Didrik Pinte <dpinte at itae.be>
   * Thuban/version.py : Updated imports to support pysqlite2
 	
 	* Thuban/Model/transientdb.py : Updated imports to support pysqlite2

Modified: trunk/thuban/Thuban/Model/transientdb.py
===================================================================
--- trunk/thuban/Thuban/Model/transientdb.py	2006-05-15 14:36:50 UTC (rev 2680)
+++ trunk/thuban/Thuban/Model/transientdb.py	2006-05-15 16:11:46 UTC (rev 2681)
@@ -24,13 +24,13 @@
 # and named.
 # The sqlite2 boolean variable is used to manage specific part of the code
 try:
-	# Using SQLITE 2.x
-  sqlite2 = True
-  from pysqlite2 import dbapi2 as sqlite
+	  # Using SQLITE 2.x
+    sqlite2 = True
+    from pysqlite2 import dbapi2 as sqlite
 except ImportError:
-	# Using SQLITE 1.x
-  sqlite2 = False
-  import sqlite
+	  # Using SQLITE 1.x
+    sqlite2 = False
+    import sqlite
 	
 
 from base import TitledObject
@@ -367,7 +367,7 @@
             params = ()
         else:
             if sqlite2:
-              right_template = "?"
+                right_template = "?"
             else: right_template = "%s"
             params = (right,)
 
@@ -424,7 +424,7 @@
         id_key = max([len(col.name) for col in self.columns]) * "x"
 
         if sqlite2:
-          insert_template = "INSERT INTO %s (id, %s) VALUES (%s, %s);" \
+            insert_template = "INSERT INTO %s (id, %s) VALUES (%s, %s);" \
                                % (self.tablename,
                                   ", ".join([col.internal_name
                                              for col in self.columns]),
@@ -432,7 +432,7 @@
                                   ", ".join(["?" for col in self.columns]))
 
         else:
-          insert_template = "INSERT INTO %s (id, %s) VALUES (%%(%s)s, %s);" \
+            insert_template = "INSERT INTO %s (id, %s) VALUES (%%(%s)s, %s);" \
                                % (self.tablename,
                                   ", ".join([col.internal_name
                                              for col in self.columns]),
@@ -444,12 +444,12 @@
             row = table.ReadRowAsDict(i)
             row[id_key] = i
             if sqlite2:
-              params = [i]
-              for col in self.columns:
-                params.append(row[col.name])
-              cursor.execute(insert_template, params)
+                params = [i]
+                for col in self.columns:
+                  params.append(row[col.name])
+                cursor.execute(insert_template, params)
             else:  
-              cursor.execute(insert_template, row)
+                cursor.execute(insert_template, row)
         self.db.conn.commit()
 
 

Modified: trunk/thuban/Thuban/version.py
===================================================================
--- trunk/thuban/Thuban/version.py	2006-05-15 14:36:50 UTC (rev 2680)
+++ trunk/thuban/Thuban/version.py	2006-05-15 16:11:46 UTC (rev 2681)
@@ -112,17 +112,17 @@
 
 # PySQLite
 try:
-	from pysqlite2 import dbapi2 as sqlite
+    from pysqlite2 import dbapi2 as sqlite
 except ImportError:
-	import sqlite
+	  import sqlite
 versions['pysqlite'] = sqlite.version
 versions['pysqlite-tuple'] = make_tuple(sqlite.version)
 
 # SQLite
 try:
-	from pysqlite2._sqlite import sqlite_version
+	  from pysqlite2._sqlite import sqlite_version
 except ImportError:
-	from _sqlite import sqlite_version
+	  from _sqlite import sqlite_version
 versions['sqlite'] = sqlite_version
 versions['sqlite-tuple'] = make_tuple(sqlite_version)
 



More information about the Thuban-commits mailing list