MediaWiki  1.33.0
captcha Namespace Reference

Functions

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

Variables

 action
 
 args
 
def 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()

def 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()

def 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()

def 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()

def captcha.read_wordlist (   filename)

Definition at line 191 of file captcha.py.

References Makefile.open.

◆ run_in_thread()

def captcha.run_in_thread (   object)

Definition at line 197 of file captcha.py.

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

◆ try_pick_word()

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

Definition at line 146 of file captcha.py.

Referenced by pick_word().

◆ wobbly_copy()

def 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

def 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.