try:
mergedConversations = self._conn.session.voicemails.get_conversation(self._contactKey)
except KeyError:
- _moduleLogger.info("Nothing in the conversation yet for %r" % (self._contactKey, ))
+ _moduleLogger.debug("Nothing in the conversation yet for %r" % (self._contactKey, ))
else:
self._report_conversation(mergedConversations)
try:
mergedConversations = self._conn.session.texts.get_conversation(self._contactKey)
except KeyError:
- _moduleLogger.info("Nothing in the conversation yet for %r" % (self._contactKey, ))
+ _moduleLogger.debug("Nothing in the conversation yet for %r" % (self._contactKey, ))
else:
self._report_conversation(mergedConversations)
def _on_conversations_updated(self, conv, conversationIds):
if self._contactKey not in conversationIds:
return
- _moduleLogger.info("Incoming messages from %r for existing conversation" % (self._contactKey, ))
+ _moduleLogger.debug("Incoming messages from %r for existing conversation" % (self._contactKey, ))
mergedConversations = conv.get_conversation(self._contactKey)
self._report_conversation(mergedConversations)
newConversations = self._filter_out_read(newConversations)
newConversations = list(newConversations)
if not newConversations:
- _moduleLogger.info(
+ _moduleLogger.debug(
"New messages for %r have already been read externally" % (self._contactKey, )
)
return
if newMessage.whoFrom != "Me:"
]
if not newConversations:
- _moduleLogger.info(
+ _moduleLogger.debug(
"All incoming messages were really outbound messages for %r" % (self._contactKey, )
)
return
for channel_type in self._requestable_channel_classes:
for chan in self._channels[channel_type].values():
try:
- _moduleLogger.info("Closing %s %s" % (channel_type, chan._object_path))
+ _moduleLogger.debug("Closing %s %s" % (channel_type, chan._object_path))
chan.Close()
except Exception:
_moduleLogger.exception("Shutting down %r" % (chan, ))
@gobject_utils.async
@gtk_toolbox.log_exception(_moduleLogger)
def _on_conversations_updated(self, conv, conversationIds):
- _moduleLogger.info("Incoming messages from: %r" % (conversationIds, ))
+ _moduleLogger.debug("Incoming messages from: %r" % (conversationIds, ))
for contactId, phoneNumber in conversationIds:
h = handle.create_handle(self, 'contact', contactId, phoneNumber)
# Just let the TextChannel decide whether it should be reported to the user or not
@return: The raw HTML page data
"""
- _moduleLogger.info("Performing download of %s" % url)
+ _moduleLogger.debug("Performing download of %s" % url)
if extraheaders is None:
extraheaders = {}
return self._read(openerdirector, trycount)
except urllib2.URLError, e:
- _moduleLogger.info("%s: %s" % (e, url))
+ _moduleLogger.debug("%s: %s" % (e, url))
cnt += 1
if (-1 < trycount) and (trycount < cnt):
raise
# Retry :-)
- _moduleLogger.info("MozillaEmulator: urllib2.URLError, retrying %d" % cnt)
+ _moduleLogger.debug("MozillaEmulator: urllib2.URLError, retrying %d" % cnt)
def _build_opener(self, url, postdata = None, extraheaders = None, forbidRedirect = False):
if extraheaders is None:
class GeometricStateStrategy(object):
def __init__(self, init, min, max):
- assert 0 < init or init == UpdateStateMachine.INFINITE_PERIOD
- assert 0 < min or min == UpdateStateMachine.INFINITE_PERIOD
+ assert 0 < init and init < max and init != UpdateStateMachine.INFINITE_PERIOD
+ assert 0 < min and min != UpdateStateMachine.INFINITE_PERIOD
assert min < max or max == UpdateStateMachine.INFINITE_PERIOD
self._min = min
self._max = max
self._init = init
- self._current = min / 2
+ self._actualInit = init
+ self._current = 0
def initialize_state(self):
self._current = self._min / 2
+ self._actualInit = self._init - self._min
def increment_state(self):
if self._max == UpdateStateMachine.INFINITE_PERIOD:
@property
def timeout(self):
- return self._init + self._current
+ return self._actualInit + self._current
class StateMachine(object):
self._strategy.initialize_state()
self._schedule_update()
+ @gtk_toolbox.log_exception(_moduleLogger)
def _on_timeout(self):
- _moduleLogger.info("%s Update" % (self._name))
+ _moduleLogger.debug("%s Update" % (self._name))
for item in self._updateItems:
try:
item.update(force=True)
)
else:
logging.basicConfig(
- level=logging.DEBUG,
+ level=logging.INFO,
format='(%(asctime)s) %(levelname)s:%(name)s:%(message)s',
datefmt='%H:%M:%S',
)
- logging.info("telepathy-theonering %s-%s" % (constants.__version__, constants.__build__))
- logging.info("OS: %s" % (os.uname()[0], ))
- logging.info("Kernel: %s (%s) for %s" % os.uname()[2:])
- logging.info("Hostname: %s" % os.uname()[1])
+ logging.debug("telepathy-theonering %s-%s" % (constants.__version__, constants.__build__))
+ logging.debug("OS: %s" % (os.uname()[0], ))
+ logging.debug("Kernel: %s (%s) for %s" % os.uname()[2:])
+ logging.debug("Hostname: %s" % os.uname()[1])
persist = 'THEONERING_PERSIST' in os.environ