예제 #1
0
 def put(self, key, value):
     from twisted.internet import reactor
     expiration = value.expiration - time()
     if expiration > 0:
         self.data[key] = value
         reactor.callLater(limit(expiration, max=3600), self.data.pop, key,
                           None)
예제 #2
0
 def _NH_SIPAccountMWIDidGetSummary(self, notification):
     account = notification.sender
     summary = notification.data.message_summary
     action = (action for action in self.voicemail_menu.actions() if action.data().toPyObject() is account).next()
     action.setEnabled(account.voicemail_uri is not None)
     if summary.messages_waiting:
         try:
             new_messages = limit(int(summary.summaries['voice-message']['new_messages']), min=0, max=11)
         except (KeyError, ValueError):
             new_messages = 0
     else:
         new_messages = 0
     action.setIcon(self.mwi_icons[new_messages])
예제 #3
0
 def put(self, key, value):
     from twisted.internet import reactor
     expiration = value.expiration-time()
     if expiration > 0:
         self.data[key] = value
         reactor.callLater(limit(expiration, max=3600), self.data.pop, key, None)