more xrange to range

pull/3/head
cybjit 2014-09-16 23:01:16 +02:00
parent 2639b15ef4
commit 515687e1bb
3 changed files with 7 additions and 7 deletions

View File

@ -45,7 +45,7 @@ class BMPWriter(object):
self.fp.write(struct.pack('BBBx', i, i, i))
elif ncols == 256:
# grayscale color table
for i in xrange(256):
for i in range(256):
self.fp.write(struct.pack('BBBx', i, i, i))
self.pos0 = self.fp.tell()
self.pos1 = self.pos0 + self.datasize
@ -98,7 +98,7 @@ class ImageWriter(object):
data = stream.get_data()
i = 0
width = (width+7)//8
for y in xrange(height):
for y in range(height):
bmp.write_line(y, data[i:i+width])
i += width
elif image.bits == 8 and image.colorspace is LITERAL_DEVICE_RGB:
@ -106,14 +106,14 @@ class ImageWriter(object):
data = stream.get_data()
i = 0
width = width*3
for y in xrange(height):
for y in range(height):
bmp.write_line(y, data[i:i+width])
i += width
elif image.bits == 8 and image.colorspace is LITERAL_DEVICE_GRAY:
bmp = BMPWriter(fp, 8, width, height)
data = stream.get_data()
i = 0
for y in xrange(height):
for y in range(height):
bmp.write_line(y, data[i:i+width])
i += width
else:

View File

@ -208,7 +208,7 @@ class PDFXRefFallback(PDFXRef):
except PSEOF:
pass
n = min(n, len(objs)//2)
for index in xrange(n):
for index in range(n):
objid1 = objs[index*2]
self.offsets[objid1] = (objid, index, 0)
return
@ -254,7 +254,7 @@ class PDFXRefStream(PDFBaseXRef):
def get_objids(self):
for (start, nobjs) in self.ranges:
for i in xrange(nobjs):
for i in range(nobjs):
offset = self.entlen * i
ent = self.data[offset:offset+self.entlen]
f1 = nunpack(ent[:self.fl1], 1)

View File

@ -806,7 +806,7 @@ def rijndaelSetupDecrypt(key, keybits):
j -= 4
# apply the inverse MixColumn transform to all round keys but the first and the last:
p = 0
for i in xrange(1, nrounds):
for i in range(1, nrounds):
p += 4
rk[p+0] = (
Td0[Te4[(rk[p+0] >> 24) ] & 0xff] ^