Mercurial > repos > yufei-luo > s_mart
diff commons/core/writer/MySqlTranscriptWriter.py @ 46:169d364ddd91
Uploaded
author | m-zytnicki |
---|---|
date | Mon, 30 Sep 2013 03:19:26 -0400 |
parents | 44d5973c188c |
children |
line wrap: on
line diff
--- a/commons/core/writer/MySqlTranscriptWriter.py Wed Sep 18 08:51:22 2013 -0400 +++ b/commons/core/writer/MySqlTranscriptWriter.py Mon Sep 30 03:19:26 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()