annotate data_generation/transformations/pycaptcha/Captcha/Visual/Pictures.py @ 323:7a7615f940e8

finished code clean up and testing
author xaviermuller
date Thu, 08 Apr 2010 11:01:55 -0400
parents 1f5937e9e530
children
rev   line source
87
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
1 """ Captcha.Visual.Pictures
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
2
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
3 Random collections of images
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
4 """
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
5 #
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
6 # PyCAPTCHA Package
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
7 # Copyright (C) 2004 Micah Dowty <micah@navi.cx>
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
8 #
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
9
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
10 from Captcha import File
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
11 import Image
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
12
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
13
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
14 class ImageFactory(File.RandomFileFactory):
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
15 """A factory that generates random images from a list"""
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
16 extensions = [".png", ".jpeg"]
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
17 basePath = "pictures"
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
18
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
19
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
20 abstract = ImageFactory("abstract")
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
21 nature = ImageFactory("nature")
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
22
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
23 ### The End ###