Simplify captcha build_tiles() in module soge
This commit is contained in:
parent
8694bcbcde
commit
53a2ea8e54
1 changed files with 6 additions and 11 deletions
|
|
@ -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,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue