diff options
author | Helmut Grohne <helmut@subdivi.de> | 2013-03-02 21:24:18 +0100 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2013-03-02 21:24:18 +0100 |
commit | 7c4864d4ccb40234138043b0aae3356f15eeacf5 (patch) | |
tree | b99331e851bf03a071ae9bcce5fbdba4a6bd561a /webapp.py | |
parent | aada0b97321a336a841385923145e1854fb36860 (diff) | |
download | debian-dedup-7c4864d4ccb40234138043b0aae3356f15eeacf5.tar.gz |
move fetchiter from webapp to dedup.utils
Diffstat (limited to 'webapp.py')
-rwxr-xr-x | webapp.py | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -9,6 +9,8 @@ from werkzeug.exceptions import HTTPException, NotFound from werkzeug.routing import Map, Rule, RequestRedirect from werkzeug.wrappers import Request, Response +from dedup.utils import fetchiter + hash_functions = [ ("sha512", "sha512"), ("image_sha512", "image_sha512"), @@ -140,13 +142,6 @@ index_template = jinjaenv.from_string( </ul> {% endblock %}""") -def fetchiter(cursor): - rows = cursor.fetchmany() - while rows: - for row in rows: - yield row - rows = cursor.fetchmany() - def encode_and_buffer(iterator): buff = b"" for elem in iterator: |