[1] | 1 | GLOBALS = globals() |
---|
| 2 | PRODUCT_NAME = 'qPloneCaptchas' |
---|
| 3 | CAPTCHAS_COUNT = 165 |
---|
| 4 | LAYERS = ['captchas', 'plone_captchas'] |
---|
| 5 | LAYER_SENDTO_FORM = "captchas_sendto_form" |
---|
| 6 | LAYER_JOIN_FORM = 'captchas_join_form' |
---|
| 7 | LAYER_DISCUSSION = 'captchas_discussion' |
---|
| 8 | LAYER_FORMMAILER = 'captchas_ploneformmailer' |
---|
| 9 | LAYER_DYNAMIC_CAPTCHAS = 'plone_captchas/dynamic' |
---|
| 10 | LAYER_STATIC_CAPTCHAS = 'plone_captchas/static' |
---|
| 11 | ALL_LAYERS = LAYERS + [LAYER_DISCUSSION, LAYER_FORMMAILER, |
---|
| 12 | LAYER_STATIC_CAPTCHAS, LAYER_DYNAMIC_CAPTCHAS, LAYER_JOIN_FORM, LAYER_SENDTO_FORM] |
---|
| 13 | TOOL_ICON = 'tool.gif' |
---|
| 14 | TOOL_ID = 'portal_captchas' |
---|
| 15 | CONFIGLET_ID = "prefs_captchas_setup_form" |
---|
| 16 | CONFIGLET_NAME = "qPloneCaptchas setup" |
---|
| 17 | |
---|
| 18 | DEFAULT_IMAGE_SIZE = 27 |
---|
| 19 | DEFAULT_BG = 'gray' |
---|
| 20 | DEFAULT_FONT_COLOR = 'black' |
---|
| 21 | DEFAULT_PERIOD = 0.1 |
---|
| 22 | DEFAULT_AMPLITUDE = 5 |
---|
| 23 | DEFAULT_OFFSET = (0.5, 0.5) |
---|
| 24 | DEFAULT_DISTORTION = [DEFAULT_PERIOD, DEFAULT_AMPLITUDE, DEFAULT_OFFSET] |
---|
| 25 | |
---|
| 26 | PROPERTIES = (('image_size', DEFAULT_IMAGE_SIZE, 'int'), |
---|
| 27 | ('background', DEFAULT_BG, 'string'), |
---|
| 28 | ('font_color', DEFAULT_FONT_COLOR, 'string'), |
---|
| 29 | ('period', DEFAULT_PERIOD, 'float'), |
---|
| 30 | ('amplitude', DEFAULT_AMPLITUDE, 'float'), |
---|
| 31 | ('random_params', True, 'boolean')) |
---|
| 32 | |
---|
| 33 | try: |
---|
| 34 | import PIL |
---|
| 35 | havePIL = True |
---|
| 36 | except: |
---|
| 37 | havePIL = False |
---|