Commit 92d1d7cd authored by aknecht2's avatar aknecht2

Removed infinit while loop from loadSql O.O

parent 83c257b1
......@@ -219,9 +219,7 @@ class Stats:
if os.path.isfile(f):
conn = self._openConnection(f)
headers = self._getHeaders("images", conn)
col_set = itertools.islice(headers, 500)
while col_set:
cols = list(col_set)
for cols in (headers[pos:pos + size] for pos in xrange(0, len(headers), 500)):
for col in cols:
self._addColumn(col, "images")
result = conn.execute("select pegasusid," + ",".join(cols) + " from images")
......@@ -229,7 +227,6 @@ class Stats:
values = [tuple([row[col] for col in cols] + [row["pegasusid"]]) for row in result]
self.conn.executemany(query, values)
self.conn.commit()
col_set = itertools.islice(headers, 500)
self._closeConnection(conn)
else:
print "DB File: '%s' does not exist." % (f,)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment