changeset 135:3abacbed0542 draft

Uploaded
author mzytnicki
date Fri, 20 Sep 2013 09:35:48 -0400
parents 83170a33618c
children 38f2699d3f0e
files commons/core/writer/MySqlTranscriptWriter.py
diffstat 1 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/commons/core/writer/MySqlTranscriptWriter.py	Fri Sep 20 08:18:51 2013 -0400
+++ b/commons/core/writer/MySqlTranscriptWriter.py	Fri Sep 20 09:35:48 2013 -0400
@@ -164,7 +164,7 @@
         @type  transcriptListParser: class L{TranscriptListParser<TranscriptListParser>}
         """
         self.transcriptListParser = transcriptListParser
-        self.mySqlConnection.executeManyFormattedQueriesIterator(self)
+        self.mySqlConnection.executeManyQueriesIterator(self)
             
             
     def getIterator(self):
@@ -178,8 +178,7 @@
                 self.createTable(chromosome)
             self.nbTranscriptsByChromosome[chromosome] = self.nbTranscriptsByChromosome.get(chromosome, 0) + 1
             values = transcript.getSqlValues()
-            #yield "INSERT INTO '%s' (%s) VALUES (%s)" % (self.tables[chromosome].name, ", ".join(self.tables[chromosome].variables), ", ".join([MySqlTable.formatSql(values[variable], self.tables[chromosome].types[variable], self.tables[chromosome].sizes[variable]) for variable in self.tables[chromosome].variables]))
-            yield ("INSERT INTO '%s' (%s) VALUES (%s)" % (self.tables[chromosome].name, ", ".join(self.tables[chromosome].variables), ", ".join(["?"] * len(self.tables[chromosome].variables))), [values[variable] for variable in self.tables[chromosome].variables])
+            yield "INSERT INTO '%s' (%s) VALUES (%s)" % (self.tables[chromosome].name, ", ".join(self.tables[chromosome].variables), ", ".join([MySqlTable.formatSql(values[variable], self.tables[chromosome].types[variable], self.tables[chromosome].sizes[variable]) for variable in self.tables[chromosome].variables]))
             progress.inc()
         progress.done()
             
@@ -191,7 +190,7 @@
         """
         for chromosome in self.transcriptValues:
             if chromosome in self.transcriptValues:
-                self.tables[chromosome].insertManyFormatted(self.transcriptValues[chromosome])
+                self.tables[chromosome].insertMany(self.transcriptValues[chromosome])
         self.transcriptValues = {}
         self.toBeWritten      = False
             
@@ -212,4 +211,4 @@
         Drop the tables
         """
         for chromosome in self.tables:
-            self.tables[chromosome].remove()
\ No newline at end of file
+            self.tables[chromosome].remove()