Changeset 3685 in products for quintagroup.captcha.core
- Timestamp:
- Jun 20, 2013 6:54:31 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.captcha.core/trunk/quintagroup/captcha/core/utils.py
r3600 r3685 2 2 import re 3 3 import math 4 import inspect 5 import operator 4 6 try: 5 7 import hashlib as md5 … … 12 14 from DateTime import DateTime 13 15 16 from plone.memoize import forever 17 14 18 from quintagroup.captcha.core.data import basic_english 15 19 #import quintagroup.captcha.core configuration values … … 23 27 except ImportError: 24 28 import Crypto 29 30 31 @forever.memoize 32 def get_source_file_path(obj): 33 return inspect.getsourcefile(obj) 34 35 36 def detectInlineValidation(validation_module): 37 validation_module_path = get_source_file_path(validation_module) 38 path = operator.itemgetter(1) 39 return any(path(frame) == validation_module_path 40 for frame in inspect.stack()) 25 41 26 42
Note: See TracChangeset
for help on using the changeset viewer.