def speakChatMessage(m, repeated=False, interrupt=False): if not m: return when=extras.getPrettyDate(m.Datetime) time=m.Datetime.strftime('%H:%M:%S') if config.conf['verbosity']['speakMessageTime'] and config.conf['verbosity']['speakContactNameWithMessage']: if repeated: if not when: output.speak(_("at %s, %s said: %s")%(time, m.FromDisplayName, m.Body), interrupt) else: output.speak(_("%s at %s, %s said: %s")%(when, time, m.FromDisplayName, m.Body), interrupt) else: if not when: output.speak(_("at %s, %s says: %s")%(time, m.FromDisplayName, m.Body), interrupt) else: output.speak(_("%s at %s, %s says: %s")%(when, time, m.FromDisplayName, m.Body), interrupt) elif config.conf['verbosity']['speakMessageTime'] and not config.conf['verbosity']['speakContactNameWithMessage']: if not when: output.speak(_("at %s: %s")%(time, m.Body), interrupt) else: output.speak(_("%s at %s: %s")%(when, time, m.Body), interrupt) elif not config.conf['verbosity']['speakMessageTime'] and config.conf['verbosity']['speakContactNameWithMessage']: if repeated: output.speak(_("%s said: %s")%(m.FromDisplayName, m.Body), interrupt) else: output.speak(_("%s says: %s")%(m.FromDisplayName, m.Body), interrupt) elif not config.conf['verbosity']['speakMessageTime'] and not config.conf['verbosity']['speakContactNameWithMessage']: output.speak(m.Body, interrupt) if m.Status==Skype4Py.cmsSending: output.speak(_("Message not delivered yet."))
def __init__(self, *args, **kwargs): loadContactList() self.contacts=contacts.available super(contactsManagerWindow, self).__init__(*args, **kwargs) self.selected=None self.index=None self.ListContacts=self.labeled_control(label=_("&Contact List"), control=CheckListCtrl) self.ListContacts.InsertColumn(0, _("Contact"), format=wx.LIST_FORMAT_LEFT, width=120) self.ListContacts.InsertColumn(1, _("Skype Name"), format=wx.LIST_FORMAT_LEFT, width=120) self.ListContacts.InsertColumn(2, _("Status"), format=wx.LIST_FORMAT_LEFT, width=120) self.ListContacts.InsertColumn(3, _("Mood Text"), format=wx.LIST_FORMAT_RIGHT, width=800) self.ListContacts.InsertColumn(4, _("Last seen"), format=wx.LIST_FORMAT_RIGHT, width=120) if len(self.contacts) != 0: for num, contact in enumerate(self.contacts): index = self.ListContacts.InsertStringItem(sys.maxint, extras.getPrintableUserName(contact.DisplayName, contact.FullName, contact.Handle)) self.ListContacts.SetStringItem(index, 1, contact.Handle) self.ListContacts.SetStringItem(index, 2, contacts.lstOnlineStatusMessages[contacts.lstOnlineStatus.index(contact.OnlineStatus)]) self.ListContacts.SetStringItem(index, 3, contact.MoodText) if contact.OnlineStatus==Skype4Py.olsOffline or contact.OnlineStatus==Skype4Py.olsInvisible: self.ListContacts.SetStringItem(index, 4, _("%s at %s")%(extras.getPrettyDate(contact.LastOnlineDatetime), contact.LastOnlineDatetime.strftime('%H:%M:%S'))) self.ListContacts.SetItemData(index, num) self.ListContacts.SetMinSize((900, 210)) self.ListContacts.SetSizerProps(expand=True) self.ListContacts.Select(0) self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnItemSelected, self.ListContacts) self.Bind(wx.EVT_CLOSE, lambda evt: self.unload()) self.SetEscapeId(wx.ID_CLOSE) self.finish_setup()
def navigate(dirBackwards=False): """ Navigates the event history. Parameters: @dirBackwards: Moves in opposite direction if set to True. """ try: if dirBackwards: allEvents(getIndex()-1) else: allEvents(getIndex()+1) when=getPrettyDate(currentEvent[0]) time=currentEvent[0].strftime('%H:%M:%S') if when: output.speak(_("%s (%s at %s)")%(currentEvent[1], when, time), True) else: output.speak(_("%s (just now at %s)")%(currentEvent[1], time), True) except: output.speak(_("No new events yet for this event type."))