From 9d812430bf63b44cd0c32488c72874fe54d8055f Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 29 May 2007 16:11:07 +0100 Subject: [PATCH] services/presence/psutils.py: don't bother using sugar.util, it's easier to use hexdigest or sha directly --- services/presence/psutils.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/services/presence/psutils.py b/services/presence/psutils.py index 04e7eecd..25b24b98 100644 --- a/services/presence/psutils.py +++ b/services/presence/psutils.py @@ -17,12 +17,15 @@ import logging from string import ascii_letters, digits +try: + from hashlib import sha1 +except ImportError: + # Python < 2.5 + from sha import new as sha1 import dbus import gobject -from sugar import util - _logger = logging.getLogger('s-p-s.psutils') @@ -39,7 +42,7 @@ def pubkey_to_keyid(key): :Returns: The key ID as a string of hex digits """ - return util.printable_hash(util._sha_data(key)) + return sha1(key).hexdigest() def escape_identifier(identifier):