Esempio n. 1
0
def OnAttach(status):
	globalVars.attachStatus=status
	if status == Skype4Py.apiAttachPendingAuthorization:
		output.speak(_("Waiting for authorization..."), True)
	if status == Skype4Py.apiAttachRefused:
		output.speak(_("Authorization refused."))
		retryConnection()
	if status == Skype4Py.apiAttachAvailable:
		globalVars.Skype.Attach()
	if status == Skype4Py.apiAttachNotAvailable:
		output.speak(_("Error, API not available."))
		retryConnection()
	if status == Skype4Py.apiAttachSuccess:
		try:
			userName=extras.getPrintableUserName(globalVars.Skype.CurrentUser.DisplayName, globalVars.Skype.CurrentUser.FullName, globalVars.Skype.CurrentUser.Handle)
		except Skype4Py.errors.SkypeAPIError:
			retryConnection()
		output.speak(_("%s is ready. Currently logged on user is %s.")%(versionInfo.name, userName), True)
		try:
			globalVars.call=globalVars.Skype.ActiveCalls[-1]
		except IndexError: pass
		try:
			globalVars.transferringFile=globalVars.Skype.ActiveFileTransfers[-1]
		except IndexError: pass
		try:
			globalVars.voicemail=globalVars.Skype.Voicemails[-1]
		except IndexError: pass
		wx.CallAfter(updater.autoUpdate)
Esempio n. 2
0
	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 __init__(self, contact, *args, **kwargs):
		userName=extras.getPrintableUserName(contact.DisplayName, contact.FullName, contact.Handle)
		super(ProfileViewerDialog, self).__init__(*args, **kwargs)
		self.SetTitle(_("Profile Viewer for %s (%s)")%(userName, contact.Handle))
		self.SkypeName=self.labeled_control(_("Skype name:"), wx.TextCtrl, value=contact.Handle, style=wx.TE_READONLY|wx.TE_MULTILINE, size=(500, -1))
		if contact.FullName:
			self.FullName=self.labeled_control(_("Full name:"), wx.TextCtrl, value=contact.FullName, style=wx.TE_READONLY|wx.TE_MULTILINE, size=(500, -1))
		if contact.MoodText:
			self.MoodText=self.labeled_control(_("Mood:"), wx.TextCtrl, value=contact.MoodText, style=wx.TE_READONLY|wx.TE_MULTILINE, size=(500, -1))
		if contact.Birthday:
			self.Birthday=self.labeled_control(_("Birth date:"), wx.TextCtrl, value=contact.Birthday.strftime("%A, %d %B %Y"), style=wx.TE_READONLY|wx.TE_MULTILINE, size=(500, -1))
		if contact.Sex and contact.Sex!="UNKNOWN":
			if contact.Sex=="MALE": gender=_("Male")
			elif contact.Sex=="FEMALE": gender=_("Female")
			self.Gender=self.labeled_control(_("Gender:"), wx.TextCtrl, value=gender, style=wx.TE_READONLY|wx.TE_MULTILINE, size=(500, -1))
		if contact.Language and contact.LanguageCode:
			language="%s (%s)"%(contact.Language, contact.LanguageCode)
			self.Language=self.labeled_control(_("Language:"), wx.TextCtrl, value=language, style=wx.TE_READONLY|wx.TE_MULTILINE, size=(500, -1))
		if contact.City or contact.Province or contact.Country:
			location="%s, %s, %s (%s)"%(contact.City, contact.Province, contact.Country, contact.CountryCode)
			self.Location=self.labeled_control(_("Location:"), wx.TextCtrl, value=location, style=wx.TE_READONLY|wx.TE_MULTILINE, size=(500, -1))
		if contact.PhoneHome:
			self.HomePhone=self.labeled_control(_("Home phone:"), wx.TextCtrl, value=contact.PhoneHome, style=wx.TE_READONLY|wx.TE_MULTILINE, size=(500, -1))
		if contact.PhoneOffice:
			self.OfficePhone=self.labeled_control(_("Office phone:"), wx.TextCtrl, value=contact.PhoneOffice, style=wx.TE_READONLY|wx.TE_MULTILINE, size=(500, -1))
		if contact.PhoneMobile:
			self.MobilePhone=self.labeled_control(_("Mobile phone:"), wx.TextCtrl, value=contact.PhoneMobile, style=wx.TE_READONLY|wx.TE_MULTILINE, size=(500, -1))
		if contact.Homepage:
			self.HomePage=self.labeled_control(_("Home page:"), wx.TextCtrl, value=contact.Homepage, style=wx.TE_READONLY|wx.TE_MULTILINE, size=(500, -1))
		if contact.About:
			self.AboutMe=self.labeled_control(_("About me:"), wx.TextCtrl, value=contact.About, style=wx.TE_READONLY|wx.TE_MULTILINE, size=(500, -1))
		if contact.NumberOfAuthBuddies!=0:
			numberOfContacts="%d"%contact.NumberOfAuthBuddies
			self.NumberOfContacts=self.labeled_control(_("Number of contacts:"), wx.TextCtrl, value=numberOfContacts, style=wx.TE_READONLY|wx.TE_MULTILINE, size=(500, -1))
		OtherInfoList=[]
		if not contact.IsAuthorized:
			OtherInfoList.append(_("This user is not authorized to contact me.\n"))
		if contact.IsBlocked:
			OtherInfoList.append(_("This user is blocked.\n"))
		if not contact.HasCallEquipment:
			OtherInfoList.append(_("This user doesn't have a call equipment.\n"))
		if contact.IsCallForwardActive:
			OtherInfoList.append(_("This user has call forwarding activated.\n"))
		if contact.IsVideoCapable:
			OtherInfoList.append(_("This user has a camera.\n"))
		if contact.IsVoicemailCapable:
			OtherInfoList.append(_("This user can send and receive Voice Mail.\n"))
		if len(OtherInfoList)!=0:
			self.OtherInfo=self.labeled_control(_("Other information:"), wx.TextCtrl, style=wx.TE_READONLY|wx.TE_MULTILINE, size=(500, -1))
			for line in OtherInfoList: self.OtherInfo.WriteText(line)
			self.OtherInfo.SetInsertionPoint(0)
		self.SetEscapeId(wx.ID_CLOSE)
		self.finish_setup()
Esempio n. 4
0
def OnUserMood(user, MoodText):
    userName = extras.getPrintableUserName(user.DisplayName, user.FullName,
                                           user.Handle)
    if len(user.MoodText) == 0:
        events.registerNewEvent(events.EVT_USERS,
                                _("%s removed his/her Mood Text") % userName,
                                config.conf["alerts"]["userChangedMoodText"])
    else:
        events.registerNewEvent(
            events.EVT_USERS,
            _("%s changed his/her Mood Text to %s") %
            (userName, user.MoodText),
            config.conf["alerts"]["userChangedMoodText"])
Esempio n. 5
0
def OnOnlineStatus(user, status):
    userName = extras.getPrintableUserName(user.DisplayName, user.FullName,
                                           user.Handle)
    if status == Skype4Py.olsUnknown:
        events.registerNewEvent(
            events.EVT_STATUSCHANGES,
            _("%s's status is unknown") % userName,
            announce=config.conf['alerts']['onlineStatusUnknown'])
    elif status == Skype4Py.olsOffline:
        events.registerNewEvent(
            events.EVT_STATUSCHANGES,
            _("%s went Offline") % userName,
            announce=config.conf['alerts']['onlineStatusOffline'])
    elif status == Skype4Py.olsOnline:
        events.registerNewEvent(
            events.EVT_STATUSCHANGES,
            _("%s is Online") % userName,
            announce=config.conf['alerts']['onlineStatusOnline'])
    elif status == Skype4Py.olsAway:
        events.registerNewEvent(
            events.EVT_STATUSCHANGES,
            _("%s is Away") % userName,
            announce=config.conf['alerts']['onlineStatusAway'])
    elif status == Skype4Py.olsNotAvailable:
        events.registerNewEvent(
            events.EVT_STATUSCHANGES,
            _("%s is Not Available") % userName,
            announce=config.conf['alerts']['onlineStatusNotAvailable'])
    elif status == Skype4Py.olsDoNotDisturb:
        events.registerNewEvent(
            events.EVT_STATUSCHANGES,
            _("%s is Do Not Disturb") % userName,
            announce=config.conf['alerts']['onlineStatusDoNotDisturb'])
    elif status == Skype4Py.olsInvisible:
        events.registerNewEvent(
            events.EVT_STATUSCHANGES,
            _("%s went offline") % userName,
            announce=config.conf['alerts']['onlineStatusInvisible'])
    elif status == Skype4Py.olsSkypeMe:
        events.registerNewEvent(
            events.EVT_STATUSCHANGES,
            _("%s is Skype Me") % userName,
            announce=config.conf['alerts']['onlineStatusSkypeMe'])
    elif status == Skype4Py.olsSkypeOut:
        events.registerNewEvent(
            events.EVT_STATUSCHANGES,
            _("%s is Skype Out") % userName,
            announce=config.conf['alerts']['onlineStatusSkypeOut'])
Esempio n. 6
0
def OnOnlineStatus(user, status):
	userName=extras.getPrintableUserName(user.DisplayName, user.FullName, user.Handle)
	if status==Skype4Py.olsUnknown:
		events.registerNewEvent(events.EVT_STATUSCHANGES, _("%s's status is unknown")%userName, announce=config.conf['alerts']['onlineStatusUnknown'])
	elif status==Skype4Py.olsOffline:
		events.registerNewEvent(events.EVT_STATUSCHANGES, _("%s went Offline")%userName, announce=config.conf['alerts']['onlineStatusOffline'])
	elif status==Skype4Py.olsOnline:
		events.registerNewEvent(events.EVT_STATUSCHANGES, _("%s is Online")%userName, announce=config.conf['alerts']['onlineStatusOnline'])
	elif status==Skype4Py.olsAway:
		events.registerNewEvent(events.EVT_STATUSCHANGES, _("%s is Away")%userName, announce=config.conf['alerts']['onlineStatusAway'])
	elif status==Skype4Py.olsNotAvailable:
		events.registerNewEvent(events.EVT_STATUSCHANGES, _("%s is Not Available")%userName, announce=config.conf['alerts']['onlineStatusNotAvailable'])
	elif status==Skype4Py.olsDoNotDisturb:
		events.registerNewEvent(events.EVT_STATUSCHANGES, _("%s is Do Not Disturb")%userName, announce=config.conf['alerts']['onlineStatusDoNotDisturb'])
	elif status==Skype4Py.olsInvisible:
		events.registerNewEvent(events.EVT_STATUSCHANGES, _("%s went offline")%userName, announce=config.conf['alerts']['onlineStatusInvisible'])
	elif status==Skype4Py.olsSkypeMe:
		events.registerNewEvent(events.EVT_STATUSCHANGES, _("%s is Skype Me")%userName, announce=config.conf['alerts']['onlineStatusSkypeMe'])
	elif status==Skype4Py.olsSkypeOut:
		events.registerNewEvent(events.EVT_STATUSCHANGES, _("%s is Skype Out")%userName, announce=config.conf['alerts']['onlineStatusSkypeOut'])
Esempio n. 7
0
def OnAttach(status):
    globalVars.attachStatus = status
    if status == Skype4Py.apiAttachPendingAuthorization:
        output.speak(_("Waiting for authorization..."), True)
    if status == Skype4Py.apiAttachRefused:
        output.speak(_("Authorization refused."))
        retryConnection()
    if status == Skype4Py.apiAttachAvailable:
        globalVars.Skype.Attach()
    if status == Skype4Py.apiAttachNotAvailable:
        output.speak(_("Error, API not available."))
        retryConnection()
    if status == Skype4Py.apiAttachSuccess:
        try:
            userName = extras.getPrintableUserName(
                globalVars.Skype.CurrentUser.DisplayName,
                globalVars.Skype.CurrentUser.FullName,
                globalVars.Skype.CurrentUser.Handle)
        except Skype4Py.errors.SkypeAPIError:
            retryConnection()
        output.speak(
            _("%s is ready. Currently logged on user is %s.") %
            (versionInfo.name, userName), True)
        try:
            globalVars.call = globalVars.Skype.ActiveCalls[-1]
        except IndexError:
            pass
        try:
            globalVars.transferringFile = globalVars.Skype.ActiveFileTransfers[
                -1]
        except IndexError:
            pass
        try:
            globalVars.voicemail = globalVars.Skype.Voicemails[-1]
        except IndexError:
            pass
        wx.CallAfter(updater.autoUpdate)
Esempio n. 8
0
 def __init__(self, contact, *args, **kwargs):
     userName = extras.getPrintableUserName(contact.DisplayName,
                                            contact.FullName,
                                            contact.Handle)
     super(ProfileViewerDialog, self).__init__(*args, **kwargs)
     self.SetTitle(
         _("Profile Viewer for %s (%s)") % (userName, contact.Handle))
     self.SkypeName = self.labeled_control(_("Skype name:"),
                                           wx.TextCtrl,
                                           value=contact.Handle,
                                           style=wx.TE_READONLY
                                           | wx.TE_MULTILINE,
                                           size=(500, -1))
     if contact.FullName:
         self.FullName = self.labeled_control(_("Full name:"),
                                              wx.TextCtrl,
                                              value=contact.FullName,
                                              style=wx.TE_READONLY
                                              | wx.TE_MULTILINE,
                                              size=(500, -1))
     if contact.MoodText:
         self.MoodText = self.labeled_control(_("Mood:"),
                                              wx.TextCtrl,
                                              value=contact.MoodText,
                                              style=wx.TE_READONLY
                                              | wx.TE_MULTILINE,
                                              size=(500, -1))
     if contact.Birthday:
         self.Birthday = self.labeled_control(
             _("Birth date:"),
             wx.TextCtrl,
             value=contact.Birthday.strftime("%A, %d %B %Y"),
             style=wx.TE_READONLY | wx.TE_MULTILINE,
             size=(500, -1))
     if contact.Sex and contact.Sex != "UNKNOWN":
         if contact.Sex == "MALE": gender = _("Male")
         elif contact.Sex == "FEMALE": gender = _("Female")
         self.Gender = self.labeled_control(_("Gender:"),
                                            wx.TextCtrl,
                                            value=gender,
                                            style=wx.TE_READONLY
                                            | wx.TE_MULTILINE,
                                            size=(500, -1))
     if contact.Language and contact.LanguageCode:
         language = "%s (%s)" % (contact.Language, contact.LanguageCode)
         self.Language = self.labeled_control(_("Language:"),
                                              wx.TextCtrl,
                                              value=language,
                                              style=wx.TE_READONLY
                                              | wx.TE_MULTILINE,
                                              size=(500, -1))
     if contact.City or contact.Province or contact.Country:
         location = "%s, %s, %s (%s)" % (contact.City, contact.Province,
                                         contact.Country,
                                         contact.CountryCode)
         self.Location = self.labeled_control(_("Location:"),
                                              wx.TextCtrl,
                                              value=location,
                                              style=wx.TE_READONLY
                                              | wx.TE_MULTILINE,
                                              size=(500, -1))
     if contact.PhoneHome:
         self.HomePhone = self.labeled_control(_("Home phone:"),
                                               wx.TextCtrl,
                                               value=contact.PhoneHome,
                                               style=wx.TE_READONLY
                                               | wx.TE_MULTILINE,
                                               size=(500, -1))
     if contact.PhoneOffice:
         self.OfficePhone = self.labeled_control(_("Office phone:"),
                                                 wx.TextCtrl,
                                                 value=contact.PhoneOffice,
                                                 style=wx.TE_READONLY
                                                 | wx.TE_MULTILINE,
                                                 size=(500, -1))
     if contact.PhoneMobile:
         self.MobilePhone = self.labeled_control(_("Mobile phone:"),
                                                 wx.TextCtrl,
                                                 value=contact.PhoneMobile,
                                                 style=wx.TE_READONLY
                                                 | wx.TE_MULTILINE,
                                                 size=(500, -1))
     if contact.Homepage:
         self.HomePage = self.labeled_control(_("Home page:"),
                                              wx.TextCtrl,
                                              value=contact.Homepage,
                                              style=wx.TE_READONLY
                                              | wx.TE_MULTILINE,
                                              size=(500, -1))
     if contact.About:
         self.AboutMe = self.labeled_control(_("About me:"),
                                             wx.TextCtrl,
                                             value=contact.About,
                                             style=wx.TE_READONLY
                                             | wx.TE_MULTILINE,
                                             size=(500, -1))
     if contact.NumberOfAuthBuddies != 0:
         numberOfContacts = "%d" % contact.NumberOfAuthBuddies
         self.NumberOfContacts = self.labeled_control(
             _("Number of contacts:"),
             wx.TextCtrl,
             value=numberOfContacts,
             style=wx.TE_READONLY | wx.TE_MULTILINE,
             size=(500, -1))
     OtherInfoList = []
     if not contact.IsAuthorized:
         OtherInfoList.append(
             _("This user is not authorized to contact me.\n"))
     if contact.IsBlocked:
         OtherInfoList.append(_("This user is blocked.\n"))
     if not contact.HasCallEquipment:
         OtherInfoList.append(
             _("This user doesn't have a call equipment.\n"))
     if contact.IsCallForwardActive:
         OtherInfoList.append(
             _("This user has call forwarding activated.\n"))
     if contact.IsVideoCapable:
         OtherInfoList.append(_("This user has a camera.\n"))
     if contact.IsVoicemailCapable:
         OtherInfoList.append(
             _("This user can send and receive Voice Mail.\n"))
     if len(OtherInfoList) != 0:
         self.OtherInfo = self.labeled_control(_("Other information:"),
                                               wx.TextCtrl,
                                               style=wx.TE_READONLY
                                               | wx.TE_MULTILINE,
                                               size=(500, -1))
         for line in OtherInfoList:
             self.OtherInfo.WriteText(line)
         self.OtherInfo.SetInsertionPoint(0)
     self.SetEscapeId(wx.ID_CLOSE)
     self.finish_setup()
Esempio n. 9
0
def OnUserMood(user, MoodText):
	userName=extras.getPrintableUserName(user.DisplayName, user.FullName, user.Handle)
	if len(user.MoodText)==0:
		events.registerNewEvent(events.EVT_USERS, _("%s removed his/her Mood Text")%userName, config.conf["alerts"]["userChangedMoodText"])
	else:
		events.registerNewEvent(events.EVT_USERS, _("%s changed his/her Mood Text to %s")%(userName, user.MoodText), config.conf["alerts"]["userChangedMoodText"])