equal
deleted
inserted
replaced
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 |