Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
aknecht2
Image Harvest
Commits
92d1d7cd
Commit
92d1d7cd
authored
May 05, 2016
by
aknecht2
Browse files
Removed infinit while loop from loadSql O.O
parent
83c257b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
ih/statistics.py
View file @
92d1d7cd
...
...
@@ -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
,)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment