iro/joblist.py
changeset 61 04dfd43dfecc
parent 60 5ca3aa8d75e1
child 67 d1912509f375
equal deleted inserted replaced
60:5ca3aa8d75e1 61:04dfd43dfecc
    10 
    10 
    11 #You should have received a copy of the GNU General Public License
    11 #You should have received a copy of the GNU General Public License
    12 #along with this program; if not, see <http://www.gnu.org/licenses/>.
    12 #along with this program; if not, see <http://www.gnu.org/licenses/>.
    13 
    13 
    14 from anbieter import content
    14 from anbieter import content
    15 import md5, os,  time
    15 import hashlib, os,  time
    16 import logging
    16 import logging
    17 logger=logging.getLogger("iro.joblist");
    17 logger=logging.getLogger("iro.joblist");
    18 
    18 
    19 class Joblist:
    19 class Joblist:
    20     '''
    20     '''
    64     def _createID(self):
    64     def _createID(self):
    65         '''
    65         '''
    66         creats a random hash id
    66         creats a random hash id
    67         '''
    67         '''
    68         while True:
    68         while True:
    69             m = md5.new()
    69             m = hashlib.sha1()
    70             m.update(str(time.time()))
    70             m.update(str(time.time()))
    71             m.update(os.urandom(10))
    71             m.update(os.urandom(10))
    72             if not self.jobs.has_key(m.hexdigest):
    72             if not self.jobs.has_key(m.hexdigest):
    73                 if not self.dbconn:                    
    73                 if not self.dbconn:                    
    74                     self.jobs[m.hexdigest()]=None
    74                     self.jobs[m.hexdigest()]=None