X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fhandle.py;h=0db35fe033438e6580808cd8e065fe8aadb8cefb;hb=de06f51c7500af5a758dd8314a01b45047a6da70;hp=5fc4e98ef6e98131d3232f5d6d6286f270f84b13;hpb=b71048b78ae57f1d4f32189f106838188d4a777b;p=theonering diff --git a/src/handle.py b/src/handle.py index 5fc4e98..0db35fe 100644 --- a/src/handle.py +++ b/src/handle.py @@ -4,10 +4,10 @@ import weakref import telepathy import tp -import util.misc as util_misc +import util.misc as misc_utils -_moduleLogger = logging.getLogger("handle") +_moduleLogger = logging.getLogger(__name__) class TheOneRingHandle(tp.Handle): @@ -42,7 +42,7 @@ class ConnectionHandle(TheOneRingHandle): class ContactHandle(TheOneRingHandle): def __init__(self, connection, id, phoneNumber): - self._phoneNumber = util_misc.normalize_number(phoneNumber) + self._phoneNumber = misc_utils.normalize_number(phoneNumber) handleType = telepathy.HANDLE_TYPE_CONTACT handleName = self._phoneNumber @@ -72,7 +72,7 @@ def create_handle_factory(): cache = weakref.WeakValueDictionary() - def create_handle(connection, type, *args): + def _create_handle(connection, type, *args): Handle = _HANDLE_TYPE_MAPPING[type] key = Handle, connection.username, args try: @@ -84,11 +84,12 @@ def create_handle_factory(): cache[key] = handle isNewHandle = True connection._handles[handle.get_type(), handle.get_id()] = handle - handleStatus = "Is New!" if isNewHandle else "From Cache" - _moduleLogger.debug("Created Handle: %r (%s)" % (handle, handleStatus)) + if isNewHandle: + handleStatus = "Is New!" if isNewHandle else "From Cache" + _moduleLogger.debug("Created Handle: %r (%s)" % (handle, handleStatus)) return handle - return create_handle + return _create_handle create_handle = create_handle_factory()