~qbzr-dev/qbzr/trunk2a

« back to all changes in this revision

Viewing changes to lib/annotate.py

  • Committer: Alexander Belchenko
  • Date: 2016-04-04 13:03:43 UTC
  • Revision ID: alexander.belchenko@gmail.com-20160404130343-d92mw99ykmc4wyia
fixed deprecation warning (using hashlib)

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
# TODO:
23
23
#  - better annotate algorithm on packs
24
24
 
25
 
import sys, time, md5
 
25
import sys, time, hashlib
26
26
from itertools import groupby
27
27
from PyQt4 import QtCore, QtGui
28
28
 
648
648
        h = self.__hashes.get(author_id)
649
649
        if h is None:
650
650
            h = abs(hash(author_id))
651
 
            #h = abs(hash(md5.md5(author_id).hexdigest())) # maybe increase enthropy via md5?
 
651
            #h = abs(hash(hashlib.md5(author_id).hexdigest())) # maybe increase enthropy via md5?
652
652
            # XXX [bialix 2012/03/30]
653
653
            # I don't really like how we create colors for annotation.
654
654
            # Also, abs(hash) loses 1 bit of the hash result.