Merge pull request #474 from sciunto/bool

Maint: minor patch on booleans + travis
This commit is contained in:
Alex Clark ☺ 2014-01-31 13:16:38 -08:00
commit 5750d5d6ef
7 changed files with 18 additions and 18 deletions

View File

@ -93,7 +93,7 @@ def Ghostscript(tile, size, fp, scale=1):
]
if gs_windows_binary is not None:
if gs_windows_binary is False:
if not gs_windows_binary:
raise WindowsError('Unable to locate Ghostscript on paths')
command[0] = gs_windows_binary

View File

@ -248,7 +248,7 @@ class OleFileIO:
if entry[1:2] == "Image":
fin = ole.openstream(entry)
fout = open(entry[0:1], "wb")
while 1:
while True:
s = fin.read(8192)
if not s:
break

View File

@ -182,7 +182,7 @@ class SpiderImageFile(ImageFile.ImageFile):
# given a list of filenames, return a list of images
def loadImageSeries(filelist=None):
" create a list of Image.images for use in montage "
if filelist == None or len(filelist) < 1:
if filelist is None or len(filelist) < 1:
return
imglist = []

View File

@ -1141,7 +1141,7 @@ def _save(im, fp, filename):
# print (im.mode, compression, a, im.encoderconfig)
e = Image._getencoder(im.mode, 'libtiff', a, im.encoderconfig)
e.setimage(im.im, (0,0)+im.size)
while 1:
while True:
l, s, d = e.encode(16*1024) # undone, change to self.decodermaxblock
if not _fp:
fp.write(d)

View File

@ -47,7 +47,7 @@ TEST_misc = False
#######################################################################
def outputImage(im, funcName = None):
# save or display the image, depending on value of SHOW_IMAGES
if SHOW == True:
if SHOW:
im.show()
else:
im.save(os.path.join(OUTPUTDIR, "%s.tif" %funcName))
@ -57,7 +57,7 @@ def outputImage(im, funcName = None):
# The tests themselves
#######################################################################
if TEST_error_catching == True:
if TEST_error_catching:
im = Image.open(IMAGE)
try:
#neither of these proifles exists (unless you make them), so we should
@ -70,7 +70,7 @@ if TEST_error_catching == True:
print("error catching test completed successfully (if you see the message \
above that we caught the error).")
if TEST_profileToProfile == True:
if TEST_profileToProfile:
# open the image file using the standard PIL function Image.open()
im = Image.open(IMAGE)
@ -84,7 +84,7 @@ if TEST_profileToProfile == True:
print("profileToProfile test completed successfully.")
if TEST_profileToProfile_inPlace == True:
if TEST_profileToProfile_inPlace:
# we'll do the same test as profileToProfile, but modify im in place
# instead of getting a new image returned to us
im = Image.open(IMAGE)
@ -94,7 +94,7 @@ if TEST_profileToProfile_inPlace == True:
outputMode = OUTMODE, inPlace = True)
# now that the image is converted, save or display it
if result == None:
if result is None:
# this is the normal result when modifying in-place
outputImage(im, "profileToProfile_inPlace")
else:
@ -103,7 +103,7 @@ if TEST_profileToProfile_inPlace == True:
print("profileToProfile in-place test completed successfully.")
if TEST_buildTransform == True:
if TEST_buildTransform:
# make a transform using the input and output profile path strings
transform = ImageCms.buildTransform(INPUT_PROFILE, OUTPUT_PROFILE, INMODE, \
OUTMODE)
@ -126,7 +126,7 @@ if TEST_buildTransform == True:
# Python should also do this automatically when it goes out of scope.
del(transform)
if TEST_buildTransformFromOpenProfiles == True:
if TEST_buildTransformFromOpenProfiles:
# we'll actually test a couple profile open/creation functions here too
# first, get a handle to an input profile, in this case we'll create
@ -160,7 +160,7 @@ if TEST_buildTransformFromOpenProfiles == True:
del(outputProfile)
del(transform)
if TEST_buildProofTransform == True:
if TEST_buildProofTransform:
# make a transform using the input and output and proof profile path
# strings
# images converted with this transform will simulate the appearance
@ -188,7 +188,7 @@ if TEST_buildProofTransform == True:
# Python should also do this automatically when it goes out of scope.
del(transform)
if TEST_getProfileInfo == True:
if TEST_getProfileInfo:
# get a profile handle
profile = ImageCms.getOpenProfile(INPUT_PROFILE)
@ -212,7 +212,7 @@ if TEST_getProfileInfo == True:
print("getProfileInfo test completed successfully.")
if TEST_misc == True:
if TEST_misc:
# test the versions, about, and copyright functions
print("Versions: %s" %str(ImageCms.versions()))
print("About:\n\n%s" %ImageCms.about())

View File

@ -4,10 +4,10 @@ from PIL import Image, EpsImagePlugin
import sys
import io
if EpsImagePlugin.gs_windows_binary == False:
# already checked. Not there.
if not EpsImagePlugin.gs_windows_binary:
# already checked. Not there.
skip()
if not sys.platform.startswith('win'):
import subprocess
try:

View File

@ -18,7 +18,7 @@ result = []
class Worker(threading.Thread):
def run(self):
while 1:
while True:
im = queue.get()
if im is None:
queue.task_done()