Changeset 1692 in products


Ignore:
Timestamp:
Feb 10, 2010 2:15:35 PM (11 years ago)
Author:
liebster
Message:

Fixed imports by Plone4

Location:
quintagroup.plonecaptchas/trunk/quintagroup/plonecaptchas
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.plonecaptchas/trunk/quintagroup/plonecaptchas/CaptchaTool.py

    r797 r1692  
    11from Products.Transience.Transience import TransientObjectContainer 
    2 from Globals import InitializeClass 
    32from AccessControl import ClassSecurityInfo 
     3try: 
     4    from App.class_init import InitializeClass 
     5except ImportError: 
     6    from Globals import InitializeClass 
    47 
    58class CaptchaTool(TransientObjectContainer): 
  • quintagroup.plonecaptchas/trunk/quintagroup/plonecaptchas/utils.py

    r853 r1692  
    22import re 
    33import math 
    4 import md5 
    54from string import atoi 
    65from random import randint 
     
    1211 
    1312try: 
     13    import hashlib 
     14    def encrypt1(s): 
     15        return hashlib.new('md5', s).hexdigest().upper() 
     16except ImportError: 
     17    import md5 
     18    def encrypt1(s): 
     19        return md5.new(s).hexdigest().upper() 
     20 
     21try: 
    1422    import Crypto.Cipher.DES as Crypto 
    1523except: 
    1624    import Crypto 
    17  
    18 def encrypt1(s): 
    19     return md5.new(s).hexdigest().upper() 
    2025 
    2126def getTransform(x, y, a, p, o): 
Note: See TracChangeset for help on using the changeset viewer.