Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion testdroid/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-

import os, sys, requests, json, logging, time, httplib
from PIL import Image
from optparse import OptionParser
from urlparse import urljoin
from collections import namedtuple
Expand Down Expand Up @@ -569,9 +568,15 @@ def download_test_screenshots(self, project_id, test_run_id):
''' Earlier downloaded images are checked, and if needed re-downloaded.
'''
try:
from PIL import Image
im=Image.open(full_path)
im.verify()
logger.info("Screenshot %s already exists - skipping download" % full_path)
except ImportError:
if os.path.isfile(full_path):
logger.info("Screenshot %s already exists - skipping download" % full_path)
else:
raise # jumps to next block
except:
url = "me/projects/%s/runs/%s/device-runs/%s/screenshots/%s" % (project_id, test_run['id'], device_run['id'], screenshot['id'])
prog = DownloadProgressBar()
Expand Down