Making the code slightly easier to maintain
authorEd Page <eopage@byu.net>
Tue, 23 Feb 2010 00:53:50 +0000 (18:53 -0600)
committerEd Page <eopage@byu.net>
Tue, 23 Feb 2010 00:53:50 +0000 (18:53 -0600)
25 files changed:
src/aliasing.py
src/autogv.py
src/avatars.py
src/capabilities.py
src/channel/call.py
src/channel/contact_list.py
src/channel/debug_log.py
src/channel/debug_prompt.py
src/channel/text.py
src/channel_manager.py
src/connection.py
src/connection_manager.py
src/contacts.py
src/gvoice/addressbook.py
src/gvoice/backend.py
src/gvoice/browser_emu.py
src/gvoice/conversations.py
src/gvoice/session.py
src/gvoice/state_machine.py
src/handle.py
src/location.py
src/presence.py
src/requests.py
src/simple_presence.py
src/theonering.py

index d1b9500..c34fdcb 100644 (file)
@@ -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):
index 525ecaf..346f48c 100644 (file)
@@ -22,7 +22,7 @@ import util.misc as misc_utils
 import gvoice
 
 
-_moduleLogger = logging.getLogger("autogv")
+_moduleLogger = logging.getLogger(__name__)
 
 
 class NewGVConversations(object):
index aef73f5..0aa8ad4 100644 (file)
@@ -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):
index 7474eb0..9657b8b 100644 (file)
@@ -6,7 +6,7 @@ import tp
 import util.misc as misc_utils
 
 
-_moduleLogger = logging.getLogger('capabilities')
+_moduleLogger = logging.getLogger(__name__)
 
 
 class CapabilitiesMixin(tp.ConnectionInterfaceCapabilities):
index 0999a1a..065ace1 100644 (file)
@@ -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(
index e184d2d..598368a 100644 (file)
@@ -8,7 +8,7 @@ import util.misc as misc_utils
 import handle
 
 
-_moduleLogger = logging.getLogger("channel.contact_list")
+_moduleLogger = logging.getLogger(__name__)
 
 
 class AllContactsListChannel(
index 82b7130..b6325a9 100644 (file)
@@ -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):
index 803bbcb..ce284e0 100644 (file)
@@ -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):
index d01b1af..2b34ee5 100644 (file)
@@ -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):
index ee844c0..592a59c 100644 (file)
@@ -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):
index 30350ed..c209370 100644 (file)
@@ -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
index cddba2a..d21c8a7 100644 (file)
@@ -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):
index fd41265..9906a10 100644 (file)
@@ -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):
index f5fa02e..2f6c7e2 100644 (file)
@@ -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):
index 0279b79..02ea1df 100755 (executable)
@@ -48,7 +48,7 @@ except ImportError:
 import browser_emu
 
 
-_moduleLogger = logging.getLogger("gvoice.backend")
+_moduleLogger = logging.getLogger(__name__)
 
 
 class NetworkError(RuntimeError):
index 3436e55..f45b204 100644 (file)
@@ -32,7 +32,7 @@ import logging
 import socket
 
 
-_moduleLogger = logging.getLogger("gvoice.browser_emu")
+_moduleLogger = logging.getLogger(__name__)
 socket.setdefaulttimeout(20)
 
 
index f6fe4b2..f64c9f7 100644 (file)
@@ -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):
index db97f95..3a7de00 100644 (file)
@@ -10,7 +10,7 @@ import conversations
 import state_machine
 
 
-_moduleLogger = logging.getLogger("gvoice.session")
+_moduleLogger = logging.getLogger(__name__)
 
 
 class Session(object):
index f7eb8ba..6d184d0 100644 (file)
@@ -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):
index b800fa5..cfbcecc 100644 (file)
@@ -7,7 +7,7 @@ import tp
 import util.misc as misc_utils
 
 
-_moduleLogger = logging.getLogger("handle")
+_moduleLogger = logging.getLogger(__name__)
 
 
 class TheOneRingHandle(tp.Handle):
index a77d0c7..f8ecad5 100644 (file)
@@ -5,7 +5,7 @@ import telepathy
 import util.misc as misc_utils
 
 
-_moduleLogger = logging.getLogger('location')
+_moduleLogger = logging.getLogger(__name__)
 
 
 #class LocationMixin(tp.ConnectionInterfaceLocation):
index c73a061..986abe8 100644 (file)
@@ -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):
index 39a81f8..68d335a 100644 (file)
@@ -3,7 +3,7 @@ import logging
 import tp
 
 
-_moduleLogger = logging.getLogger('requests')
+_moduleLogger = logging.getLogger(__name__)
 
 
 class RequestsMixin(tp.ConnectionInterfaceRequests):
index ac8b875..bda9fed 100644 (file)
@@ -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):
index de0f8c0..9209162 100755 (executable)
@@ -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',
                )