services/presence/psutils.py: don't bother using sugar.util, it's easier to use hexdigest or sha directly
This commit is contained in:
parent
2f8ef7bd3b
commit
9d812430bf
@ -17,12 +17,15 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
from string import ascii_letters, digits
|
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 dbus
|
||||||
import gobject
|
import gobject
|
||||||
|
|
||||||
from sugar import util
|
|
||||||
|
|
||||||
|
|
||||||
_logger = logging.getLogger('s-p-s.psutils')
|
_logger = logging.getLogger('s-p-s.psutils')
|
||||||
|
|
||||||
@ -39,7 +42,7 @@ def pubkey_to_keyid(key):
|
|||||||
:Returns:
|
:Returns:
|
||||||
The key ID as a string of hex digits
|
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):
|
def escape_identifier(identifier):
|
||||||
|
Loading…
Reference in New Issue
Block a user