From: Ed Page Date: Tue, 23 Feb 2010 00:53:50 +0000 (-0600) Subject: Making the code slightly easier to maintain X-Git-Url: http://git.maemo.org/git/?p=theonering;a=commitdiff_plain;h=548c58651ec7849619b9d823fdeee169be6c87b5 Making the code slightly easier to maintain --- diff --git a/src/aliasing.py b/src/aliasing.py index d1b9500..c34fdcb 100644 --- a/src/aliasing.py +++ b/src/aliasing.py @@ -7,7 +7,7 @@ import util.misc as misc_utils import handle -_moduleLogger = logging.getLogger('aliasing') +_moduleLogger = logging.getLogger(__name__) def _make_pretty_with_areacodde(phonenumber): diff --git a/src/autogv.py b/src/autogv.py index 525ecaf..346f48c 100644 --- a/src/autogv.py +++ b/src/autogv.py @@ -22,7 +22,7 @@ import util.misc as misc_utils import gvoice -_moduleLogger = logging.getLogger("autogv") +_moduleLogger = logging.getLogger(__name__) class NewGVConversations(object): diff --git a/src/avatars.py b/src/avatars.py index aef73f5..0aa8ad4 100644 --- a/src/avatars.py +++ b/src/avatars.py @@ -9,7 +9,7 @@ import tp import util.misc as misc_utils -_moduleLogger = logging.getLogger('avatars') +_moduleLogger = logging.getLogger(__name__) class AvatarsMixin(tp.server.ConnectionInterfaceAvatars): diff --git a/src/capabilities.py b/src/capabilities.py index 7474eb0..9657b8b 100644 --- a/src/capabilities.py +++ b/src/capabilities.py @@ -6,7 +6,7 @@ import tp import util.misc as misc_utils -_moduleLogger = logging.getLogger('capabilities') +_moduleLogger = logging.getLogger(__name__) class CapabilitiesMixin(tp.ConnectionInterfaceCapabilities): diff --git a/src/channel/call.py b/src/channel/call.py index 0999a1a..065ace1 100644 --- a/src/channel/call.py +++ b/src/channel/call.py @@ -1,7 +1,6 @@ import logging import dbus -import gobject import telepathy import tp @@ -9,7 +8,7 @@ import util.go_utils as gobject_utils import util.misc as misc_utils -_moduleLogger = logging.getLogger("channel.call") +_moduleLogger = logging.getLogger(__name__) class CallChannel( diff --git a/src/channel/contact_list.py b/src/channel/contact_list.py index e184d2d..598368a 100644 --- a/src/channel/contact_list.py +++ b/src/channel/contact_list.py @@ -8,7 +8,7 @@ import util.misc as misc_utils import handle -_moduleLogger = logging.getLogger("channel.contact_list") +_moduleLogger = logging.getLogger(__name__) class AllContactsListChannel( diff --git a/src/channel/debug_log.py b/src/channel/debug_log.py index 82b7130..b6325a9 100644 --- a/src/channel/debug_log.py +++ b/src/channel/debug_log.py @@ -10,7 +10,7 @@ import tp import util.misc as misc_utils -_moduleLogger = logging.getLogger("channel.debug_log") +_moduleLogger = logging.getLogger(__name__) class DebugLogChannel(tp.ChannelTypeFileTransfer): diff --git a/src/channel/debug_prompt.py b/src/channel/debug_prompt.py index 803bbcb..ce284e0 100644 --- a/src/channel/debug_prompt.py +++ b/src/channel/debug_prompt.py @@ -15,7 +15,7 @@ import util.misc as misc_utils import gvoice -_moduleLogger = logging.getLogger("channel.debug_prompt") +_moduleLogger = logging.getLogger(__name__) class DebugPromptChannel(tp.ChannelTypeText, cmd.Cmd): diff --git a/src/channel/text.py b/src/channel/text.py index d01b1af..2b34ee5 100644 --- a/src/channel/text.py +++ b/src/channel/text.py @@ -9,7 +9,7 @@ import util.misc as misc_utils import gvoice -_moduleLogger = logging.getLogger("channel.text") +_moduleLogger = logging.getLogger(__name__) class TextChannel(tp.ChannelTypeText): diff --git a/src/channel_manager.py b/src/channel_manager.py index ee844c0..592a59c 100644 --- a/src/channel_manager.py +++ b/src/channel_manager.py @@ -8,7 +8,7 @@ import channel import util.misc as misc_utils -_moduleLogger = logging.getLogger("channel_manager") +_moduleLogger = logging.getLogger(__name__) class ChannelManager(tp.ChannelManager): diff --git a/src/connection.py b/src/connection.py index 30350ed..c209370 100644 --- a/src/connection.py +++ b/src/connection.py @@ -24,7 +24,7 @@ import autogv import channel_manager -_moduleLogger = logging.getLogger("connection") +_moduleLogger = logging.getLogger(__name__) class TheOneRingOptions(object): @@ -217,11 +217,11 @@ class TheOneRingConnection( publishHandle = self.get_handle_by_name(telepathy.HANDLE_TYPE_LIST, "publish") publishProps = self.generate_props(telepathy.CHANNEL_TYPE_CONTACT_LIST, publishHandle, False) self.__channelManager.channel_for_props(publishProps, signal=True) - except gvoice.backend.NetworkError, e: + except gvoice.backend.NetworkError: _moduleLogger.exception("Connection Failed") self.disconnect(telepathy.CONNECTION_STATUS_REASON_NETWORK_ERROR) return - except Exception, e: + except Exception: _moduleLogger.exception("Connection Failed") self.disconnect(telepathy.CONNECTION_STATUS_REASON_AUTHENTICATION_FAILED) return diff --git a/src/connection_manager.py b/src/connection_manager.py index cddba2a..d21c8a7 100644 --- a/src/connection_manager.py +++ b/src/connection_manager.py @@ -9,7 +9,7 @@ import util.misc as misc_utils import connection -_moduleLogger = logging.getLogger("connection_manager") +_moduleLogger = logging.getLogger(__name__) class TheOneRingConnectionManager(tp.ConnectionManager): diff --git a/src/contacts.py b/src/contacts.py index fd41265..9906a10 100644 --- a/src/contacts.py +++ b/src/contacts.py @@ -6,7 +6,7 @@ import telepathy import util.misc as misc_utils -_moduleLogger = logging.getLogger('contacts') +_moduleLogger = logging.getLogger(__name__) class ContactsMixin(telepathy.server.ConnectionInterfaceContacts): diff --git a/src/gvoice/addressbook.py b/src/gvoice/addressbook.py index f5fa02e..2f6c7e2 100644 --- a/src/gvoice/addressbook.py +++ b/src/gvoice/addressbook.py @@ -7,7 +7,7 @@ import util.coroutines as coroutines import util.misc as misc_utils -_moduleLogger = logging.getLogger("gvoice.addressbook") +_moduleLogger = logging.getLogger(__name__) class Addressbook(object): diff --git a/src/gvoice/backend.py b/src/gvoice/backend.py index 0279b79..02ea1df 100755 --- a/src/gvoice/backend.py +++ b/src/gvoice/backend.py @@ -48,7 +48,7 @@ except ImportError: import browser_emu -_moduleLogger = logging.getLogger("gvoice.backend") +_moduleLogger = logging.getLogger(__name__) class NetworkError(RuntimeError): diff --git a/src/gvoice/browser_emu.py b/src/gvoice/browser_emu.py index 3436e55..f45b204 100644 --- a/src/gvoice/browser_emu.py +++ b/src/gvoice/browser_emu.py @@ -32,7 +32,7 @@ import logging import socket -_moduleLogger = logging.getLogger("gvoice.browser_emu") +_moduleLogger = logging.getLogger(__name__) socket.setdefaulttimeout(20) diff --git a/src/gvoice/conversations.py b/src/gvoice/conversations.py index f6fe4b2..f64c9f7 100644 --- a/src/gvoice/conversations.py +++ b/src/gvoice/conversations.py @@ -16,7 +16,7 @@ import util.coroutines as coroutines import util.misc as misc_utils -_moduleLogger = logging.getLogger("gvoice.conversations") +_moduleLogger = logging.getLogger(__name__) class Conversations(object): diff --git a/src/gvoice/session.py b/src/gvoice/session.py index db97f95..3a7de00 100644 --- a/src/gvoice/session.py +++ b/src/gvoice/session.py @@ -10,7 +10,7 @@ import conversations import state_machine -_moduleLogger = logging.getLogger("gvoice.session") +_moduleLogger = logging.getLogger(__name__) class Session(object): diff --git a/src/gvoice/state_machine.py b/src/gvoice/state_machine.py index f7eb8ba..6d184d0 100644 --- a/src/gvoice/state_machine.py +++ b/src/gvoice/state_machine.py @@ -7,7 +7,7 @@ import util.coroutines as coroutines import util.misc as misc_utils -_moduleLogger = logging.getLogger("gvoice.state_machine") +_moduleLogger = logging.getLogger(__name__) def to_milliseconds(**kwd): diff --git a/src/handle.py b/src/handle.py index b800fa5..cfbcecc 100644 --- a/src/handle.py +++ b/src/handle.py @@ -7,7 +7,7 @@ import tp import util.misc as misc_utils -_moduleLogger = logging.getLogger("handle") +_moduleLogger = logging.getLogger(__name__) class TheOneRingHandle(tp.Handle): diff --git a/src/location.py b/src/location.py index a77d0c7..f8ecad5 100644 --- a/src/location.py +++ b/src/location.py @@ -5,7 +5,7 @@ import telepathy import util.misc as misc_utils -_moduleLogger = logging.getLogger('location') +_moduleLogger = logging.getLogger(__name__) #class LocationMixin(tp.ConnectionInterfaceLocation): diff --git a/src/presence.py b/src/presence.py index c73a061..986abe8 100644 --- a/src/presence.py +++ b/src/presence.py @@ -5,7 +5,7 @@ import util.misc as misc_utils import simple_presence -_moduleLogger = logging.getLogger('presence') +_moduleLogger = logging.getLogger(__name__) class PresenceMixin(tp.ConnectionInterfacePresence, simple_presence.TheOneRingPresence): diff --git a/src/requests.py b/src/requests.py index 39a81f8..68d335a 100644 --- a/src/requests.py +++ b/src/requests.py @@ -3,7 +3,7 @@ import logging import tp -_moduleLogger = logging.getLogger('requests') +_moduleLogger = logging.getLogger(__name__) class RequestsMixin(tp.ConnectionInterfaceRequests): diff --git a/src/simple_presence.py b/src/simple_presence.py index ac8b875..bda9fed 100644 --- a/src/simple_presence.py +++ b/src/simple_presence.py @@ -8,7 +8,7 @@ import handle import gvoice.state_machine as state_machine -_moduleLogger = logging.getLogger("simple_presence") +_moduleLogger = logging.getLogger(__name__) class TheOneRingPresence(object): diff --git a/src/theonering.py b/src/theonering.py index de0f8c0..9209162 100755 --- a/src/theonering.py +++ b/src/theonering.py @@ -97,7 +97,7 @@ def main(logToFile): ) else: logging.basicConfig( - level=logging.INFO, + level=logging.DEBUG, format='(%(asctime)s) %(levelname)s:%(name)s:%(message)s', datefmt='%H:%M:%S', )