Simplify captcha build_tiles() in module soge

This commit is contained in:
Jocelyn Jaubert 2010-11-28 19:43:59 +01:00 committed by Romain Bignon
commit 53a2ea8e54

View file

@ -58,12 +58,12 @@ class Captcha:
return s return s
def build_tiles(self): def build_tiles(self):
y = 0 for ty in xrange(0, self.nbc):
ty = 0 y = ty * 23
while y < self.ny:
x = 0 for tx in xrange(0, self.nbr):
tx = 0 x = tx * 24
while x < self.nx:
tile = self.tiles[tx][ty] tile = self.tiles[tx][ty]
for yy in xrange(y, y + 23): for yy in xrange(y, y + 23):
@ -75,11 +75,6 @@ class Captcha:
tile.valid = True tile.valid = True
self.map[num] = tile self.map[num] = tile
x += 24
tx += 1
y += 23
ty += 1
class Tile: class Tile:
hash = {'ff1441b2c5f90703ef04e688e399aca5': 1, hash = {'ff1441b2c5f90703ef04e688e399aca5': 1,