diff --git a/model.py b/model.py
index 7a8e4af..752ef4a 100644
a
|
b
|
|
17 | 17 | # |
18 | 18 | |
19 | 19 | import cjson |
20 | | import sha |
| 20 | import hashlib |
21 | 21 | import gobject |
22 | 22 | import base64 |
23 | 23 | |
… |
… |
class Model(gobject.GObject): |
44 | 44 | break |
45 | 45 | |
46 | 46 | self.data['shared_links'].insert(index, |
47 | | {'hash':sha.new(str(url)).hexdigest(), |
| 47 | {'hash':hashlib.sha1(str(url)).hexdigest(), |
48 | 48 | 'url':str(url), 'title':str(title), |
49 | 49 | 'thumb':base64.b64encode(thumb), |
50 | 50 | 'owner':str(owner), |
diff --git a/webactivity.py b/webactivity.py
index a7c55bb..e999c48 100644
a
|
b
|
import gobject |
23 | 23 | gobject.threads_init() |
24 | 24 | |
25 | 25 | import gtk |
26 | | import sha |
| 26 | import hashlib |
27 | 27 | import base64 |
28 | 28 | import time |
29 | 29 | import shutil |
… |
… |
def _seed_xs_cookie(): |
82 | 82 | |
83 | 83 | pubkey = profile.get_profile().pubkey |
84 | 84 | cookie_data = {'color': profile.get_color().to_string(), |
85 | | 'pkey_hash': sha.new(pubkey).hexdigest()} |
| 85 | 'pkey_hash': hashlib.sha1(pubkey).hexdigest()} |
86 | 86 | |
87 | 87 | db_path = os.path.join(_profile_path, 'cookies.sqlite') |
88 | 88 | try: |
… |
… |
class WebActivity(activity.Activity): |
464 | 464 | def _add_link(self): |
465 | 465 | ''' take screenshot and add link info to the model ''' |
466 | 466 | for link in self.model.data['shared_links']: |
467 | | if link['hash'] == sha.new(self.current).hexdigest(): |
| 467 | if link['hash'] == hashlib.sha1(self.current).hexdigest(): |
468 | 468 | _logger.debug('_add_link: link exist already a=%s b=%s' %( |
469 | | link['hash'], sha.new(self.current).hexdigest())) |
| 469 | link['hash'], hashlib.sha1(self.current).hexdigest())) |
470 | 470 | return |
471 | 471 | buf = self._get_screenshot() |
472 | 472 | timestamp = time.time() |