From 792c135e9aee821bf22640649228d3e5d035f568 Mon Sep 17 00:00:00 2001 From: Lucian Branescu Mihaila Date: Thu, 24 Jun 2010 11:52:15 +0000 Subject: Prototype implementation of downloadmanager. Fix initial load bug. Introduce many other bugs. Not tested enough. --- (limited to 'webactivity.py') diff --git a/webactivity.py b/webactivity.py index a68cc49..bb5a7c6 100644 --- a/webactivity.py +++ b/webactivity.py @@ -23,7 +23,6 @@ import gobject gobject.threads_init() import gtk -import sha import base64 import time import shutil @@ -31,6 +30,7 @@ import sqlite3 import cjson import gconf import locale +from hashlib import sha1 import webkit @@ -49,7 +49,7 @@ from sugar import mime PROFILE_VERSION = 2 _profile_version = 0 -_profile_path = os.path.join(activity.get_activity_root(), 'data/gecko') +_profile_path = os.path.join(activity.get_activity_root(), 'data/webkit') _version_file = os.path.join(_profile_path, 'version') if os.path.exists(_version_file): @@ -83,7 +83,7 @@ def _seed_xs_cookie(): pubkey = profile.get_profile().pubkey cookie_data = {'color': profile.get_color().to_string(), - 'pkey_hash': sha.new(pubkey).hexdigest()} + 'pkey_hash': sha1.new(pubkey).hexdigest()} db_path = os.path.join(_profile_path, 'cookies.sqlite') try: @@ -441,9 +441,9 @@ class WebActivity(activity.Activity): uri = browser.props.uri for link in self.model.data['shared_links']: - if link['hash'] == sha.new(uri).hexdigest(): + if link['hash'] == sha1.new(uri).hexdigest(): _logger.debug('_add_link: link exist already a=%s b=%s' %( - link['hash'], sha.new(uri).hexdigest())) + link['hash'], sha1.new(uri).hexdigest())) return buf = self._get_screenshot() timestamp = time.time() -- cgit v0.9.1