MediaWiki
1.29.2
|
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 | 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) |
count = opts.count | |
default | |
dirs = opts.dirs | |
string | filename = "image_%s_%s.png" % (salt, md5hash) |
fill = opts.fill | |
font = opts.font | |
fontsize = opts.font_size | |
help | |
key = opts.key | |
md5hash = hashlib.md5((key+salt+word+key+salt).encode('utf-8')).hexdigest()[:16] | |
metavar | |
nonalpha = re.compile('[^a-z]') | |
opts | |
output = opts.output | |
parser = OptionParser() | |
string | salt = "%08x" % random.randrange(2**32) |
script_dir = os.path.dirname(os.path.realpath(__file__)) | |
def | subdir = gen_subdir(output, md5hash, dirs) |
type | |
verbose = opts.verbose | |
def | word = pick_word(words, blacklist, verbose, opts.number_words, opts.min_length, opts.max_length) |
wordlist = opts.wordlist | |
words = None | |
def captcha.gen_captcha | ( | text, | |
fontname, | |||
fontsize, | |||
file_name | |||
) |
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 128 of file captcha.py.
def captcha.pick_word | ( | words, | |
blacklist, | |||
verbose, | |||
nwords, | |||
min_length, | |||
max_length | |||
) |
Definition at line 182 of file captcha.py.
References try_pick_word().
def captcha.read_wordlist | ( | filename | ) |
Definition at line 189 of file captcha.py.
References Makefile.open.
def captcha.try_pick_word | ( | words, | |
blacklist, | |||
verbose, | |||
nwords, | |||
min_length, | |||
max_length | |||
) |
Definition at line 144 of file captcha.py.
Referenced by pick_word().
def captcha.wobbly_copy | ( | src, | |
wob, | |||
col, | |||
scale, | |||
ang | |||
) |
Definition at line 49 of file captcha.py.
Referenced by gen_captcha().
captcha.action |
Definition at line 206 of file captcha.py.
captcha.args |
Definition at line 220 of file captcha.py.
def captcha.blacklist = read_wordlist(opts.blacklist) |
Definition at line 241 of file captcha.py.
captcha.count = opts.count |
Definition at line 242 of file captcha.py.
captcha.default |
Definition at line 210 of file captcha.py.
captcha.dirs = opts.dirs |
Definition at line 244 of file captcha.py.
captcha.filename = "image_%s_%s.png" % (salt, md5hash) |
Definition at line 263 of file captcha.py.
captcha.fill = opts.fill |
Definition at line 243 of file captcha.py.
captcha.font = opts.font |
Definition at line 237 of file captcha.py.
captcha.fontsize = opts.font_size |
Definition at line 246 of file captcha.py.
captcha.help |
Definition at line 205 of file captcha.py.
captcha.key = opts.key |
Definition at line 229 of file captcha.py.
Definition at line 262 of file captcha.py.
captcha.metavar |
Definition at line 205 of file captcha.py.
captcha.nonalpha = re.compile('[^a-z]') |
Definition at line 46 of file captcha.py.
captcha.opts |
Definition at line 220 of file captcha.py.
captcha.output = opts.output |
Definition at line 233 of file captcha.py.
captcha.parser = OptionParser() |
Definition at line 204 of file captcha.py.
string captcha.salt = "%08x" % random.randrange(2**32) |
Definition at line 260 of file captcha.py.
captcha.script_dir = os.path.dirname(os.path.realpath(__file__)) |
Definition at line 203 of file captcha.py.
def captcha.subdir = gen_subdir(output, md5hash, dirs) |
Definition at line 265 of file captcha.py.
captcha.type |
Definition at line 210 of file captcha.py.
captcha.verbose = opts.verbose |
Definition at line 245 of file captcha.py.
def captcha.word = pick_word(words, blacklist, verbose, opts.number_words, opts.min_length, opts.max_length) |
Definition at line 259 of file captcha.py.
captcha.wordlist = opts.wordlist |
Definition at line 223 of file captcha.py.
list captcha.words = None |
Definition at line 251 of file captcha.py.