Esempio n. 1
0
    def _set_contactsoap(self, val):

        self._contactsoap = val

        if self.contactsoap is not None:
            phs = self.contactsoap.ContactInfo.Phones
            if phs is not None and phs.ContactPhone is not None:
                for phone in phs.ContactPhone:
                    if phone.ContactPhoneType == 'ContactPhoneMobile':
                        try:
                            num = normalize_sms(phone.Number)
                        except:
                            continue
                        else:
                            if not validate_sms(num):
                                continue

                        self.phone_mobile = num
Esempio n. 2
0
    def OnAddSMS(self, sms):
        blist   = self.blist
        smslist = blist.get_contact_info(self.info_key, 'sms')
        smslist = list(smslist) if smslist is not None else []

        try:
            sms = normalize_sms(sms)
        except ValueError:
            MessageBox(_('Please enter a valid SMS number (ie: 555-555-5555 or 5555555555)'),
                       _('Invalid SMS Number'), style = wx.ICON_ERROR)
        else:
            if sms not in smslist:
                smslist.append(sms)
                blist.set_contact_info(self.info_key, 'sms', smslist)
                self.OnLoseFocus()
                return sms
            else:
                MessageBox(_("That SMS number is already in this buddy's list."),
                           _('Add SMS Number'))
Esempio n. 3
0
    def OnAddSMS(self, sms):
        blist = self.blist
        smslist = blist.get_contact_info(self.info_key, 'sms')
        smslist = list(smslist) if smslist is not None else []

        try:
            sms = normalize_sms(sms)
        except ValueError:
            MessageBox(_(
                'Please enter a valid SMS number (ie: 555-555-5555 or 5555555555)'
            ),
                       _('Invalid SMS Number'),
                       style=wx.ICON_ERROR)
        else:
            if sms not in smslist:
                smslist.append(sms)
                blist.set_contact_info(self.info_key, 'sms', smslist)
                self.OnLoseFocus()
                return sms
            else:
                MessageBox(
                    _("That SMS number is already in this buddy's list."),
                    _('Add SMS Number'))