MediaWiki REL1_31
captcha Namespace Reference

Functions

 gen_captcha (text, fontname, fontsize, file_name)
 
 gen_subdir (basedir, md5hash, levels)
 
 pick_word (words, blacklist, verbose, nwords, min_length, max_length)
 
 read_wordlist (filename)
 
 run_in_thread (object)
 
 try_pick_word (words, blacklist, verbose, nwords, min_length, max_length)
 
 wobbly_copy (src, wob, col, scale, ang)
 

Variables

 action
 
 args
 
 blacklist = read_wordlist(opts.blacklist)
 
int chunks = 1
 
 count = opts.count
 
list data = []
 
 default
 
 dirs = opts.dirs
 
 fill = opts.fill
 
 font = opts.font
 
 fontsize = opts.font_size
 
 help
 
 key = opts.key
 
 metavar
 
 nonalpha = re.compile('[^a-z]')
 
 opts
 
 output = opts.output
 
 p = multiprocessing.Pool(threads);
 
 parser = OptionParser()
 
 script_dir = os.path.dirname(os.path.realpath(__file__))
 
 threads = opts.threads
 
 type
 
 verbose = opts.verbose
 
 wordlist = opts.wordlist
 
 words = None
 

Function Documentation

◆ gen_captcha()

captcha.gen_captcha ( text,
fontname,
fontsize,
file_name )
Generate a captcha image

Definition at line 76 of file captcha.py.

References wobbly_copy().

Referenced by run_in_thread().

◆ gen_subdir()

captcha.gen_subdir ( basedir,
md5hash,
levels )
Generate a subdirectory path out of the first _levels_
    characters of _hash_, and ensure the directories exist
    under _basedir_.

Definition at line 130 of file captcha.py.

Referenced by run_in_thread().

◆ pick_word()

captcha.pick_word ( words,
blacklist,
verbose,
nwords,
min_length,
max_length )

Definition at line 184 of file captcha.py.

References try_pick_word().

Referenced by run_in_thread().

◆ read_wordlist()

captcha.read_wordlist ( filename)

Definition at line 191 of file captcha.py.

◆ run_in_thread()

captcha.run_in_thread ( object)

Definition at line 197 of file captcha.py.

References gen_captcha(), gen_subdir(), pick_word(), and print.

◆ try_pick_word()

captcha.try_pick_word ( words,
blacklist,
verbose,
nwords,
min_length,
max_length )

Definition at line 146 of file captcha.py.

References print.

Referenced by pick_word().

◆ wobbly_copy()

captcha.wobbly_copy ( src,
wob,
col,
scale,
ang )

Definition at line 51 of file captcha.py.

Referenced by gen_captcha().

Variable Documentation

◆ action

captcha.action

Definition at line 229 of file captcha.py.

◆ args

captcha.args

Definition at line 244 of file captcha.py.

◆ blacklist

captcha.blacklist = read_wordlist(opts.blacklist)

Definition at line 265 of file captcha.py.

◆ chunks

tuple captcha.chunks = 1

Definition at line 287 of file captcha.py.

◆ count

captcha.count = opts.count

Definition at line 266 of file captcha.py.

◆ data

list captcha.data = []

Definition at line 293 of file captcha.py.

◆ default

captcha.default

Definition at line 233 of file captcha.py.

◆ dirs

captcha.dirs = opts.dirs

Definition at line 268 of file captcha.py.

◆ fill

captcha.fill = opts.fill

Definition at line 267 of file captcha.py.

◆ font

captcha.font = opts.font

Definition at line 261 of file captcha.py.

◆ fontsize

captcha.fontsize = opts.font_size

Definition at line 270 of file captcha.py.

◆ help

captcha.help

Definition at line 228 of file captcha.py.

◆ key

captcha.key = opts.key

Definition at line 253 of file captcha.py.

◆ metavar

captcha.metavar

Definition at line 228 of file captcha.py.

◆ nonalpha

captcha.nonalpha = re.compile('[^a-z]')

Definition at line 48 of file captcha.py.

◆ opts

captcha.opts

Definition at line 244 of file captcha.py.

◆ output

captcha.output = opts.output

Definition at line 257 of file captcha.py.

◆ p

captcha.p = multiprocessing.Pool(threads);

Definition at line 292 of file captcha.py.

◆ parser

captcha.parser = OptionParser()

Definition at line 227 of file captcha.py.

◆ script_dir

captcha.script_dir = os.path.dirname(os.path.realpath(__file__))

Definition at line 226 of file captcha.py.

◆ threads

int captcha.threads = opts.threads

Definition at line 271 of file captcha.py.

◆ type

captcha.type

Definition at line 233 of file captcha.py.

◆ verbose

captcha.verbose = opts.verbose

Definition at line 269 of file captcha.py.

◆ wordlist

captcha.wordlist = opts.wordlist

Definition at line 247 of file captcha.py.

◆ words

list captcha.words = None

Definition at line 276 of file captcha.py.