当前位置: 首页>>代码示例>>Python>>正文


Python SIPSimpleSettings.strip方法代码示例

本文整理汇总了Python中sipsimple.configuration.settings.SIPSimpleSettings.strip方法的典型用法代码示例。如果您正苦于以下问题:Python SIPSimpleSettings.strip方法的具体用法?Python SIPSimpleSettings.strip怎么用?Python SIPSimpleSettings.strip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sipsimple.configuration.settings.SIPSimpleSettings的用法示例。


在下文中一共展示了SIPSimpleSettings.strip方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _addIncomingSession

# 需要导入模块: from sipsimple.configuration.settings import SIPSimpleSettings [as 别名]
# 或者: from sipsimple.configuration.settings.SIPSimpleSettings import strip [as 别名]

#.........这里部分代码省略.........

        acceptB.cell().setRepresentedObject_(NSNumber.numberWithInt_(0))
        otherB.cell().setRepresentedObject_(NSNumber.numberWithInt_(1))
        rejectB.cell().setRepresentedObject_(NSNumber.numberWithInt_(2))
        busyB.cell().setRepresentedObject_(NSNumber.numberWithInt_(3))

        # no Busy or partial accept option for Stream Update Proposals
        busyB.setHidden_(is_update_proposal or is_file_transfer)
        otherB.setHidden_(is_update_proposal)
        if is_file_transfer:
            busyB.setAttributedTitle_("")

        panelAcceptB = self.panel.contentView().viewWithTag_(10)
        panelOtherB = self.panel.contentView().viewWithTag_(11)

        panelRejectB = self.panel.contentView().viewWithTag_(12)
        panelBusyB = self.panel.contentView().viewWithTag_(13)
        if is_update_proposal:
            subject, accept, other = self.format_subject_for_incoming_reinvite(session, streams)
            other = ""
        else:
            subject, accept, other = self.format_subject_for_incoming_invite(session, streams)
        captionT.setStringValue_(subject)

        frame = captionT.frame()
        frame.size.width = NSWidth(self.sessionsListView.frame()) - 80 - 40 * typeCount
        captionT.setFrame_(frame)

        caller_contact = NSApp.delegate().contactsWindowController.getContactMatchingURI(session.remote_identity.uri)
        if caller_contact:
            if caller_contact.icon:
                photoImage.setImage_(caller_contact.icon)

            if caller_contact.auto_answer:
                BlinkLogger().log_info(u"Auto answer enabled for this contact")
                self.enableAutoAnswer(view, session)

        fromT.setStringValue_(u"%s" % format_identity_to_string(session.remote_identity, check_contact=True, format='full'))
        fromT.sizeToFit()

        has_audio_streams = any(s for s in reduce(lambda a,b:a+b, [session.proposed_streams for session in self.sessions.keys()], []) if s.type=="audio")
        if has_audio_streams:
            outdev = SIPSimpleSettings().audio.output_device
            indev = SIPSimpleSettings().audio.input_device
            if outdev == u"system_default":
                outdev = u"System Default"
            if indev == u"system_default":
                indev = u"System Default"
            if outdev != indev:
                self.deviceLabel.setStringValue_(u"Selected Output Device is %s, Input is %s" % (outdev.strip(), indev.strip()))
            else:
                self.deviceLabel.setStringValue_(u"Selected Audio Device is %s" % outdev.strip())

            BlinkLogger().log_info(u"Selected audio input/output devices: %s/%s" % (indev, outdev))

            self.deviceLabel.sizeToFit()
            self.deviceLabel.setHidden_(False)
        else:
            self.deviceLabel.setHidden_(True)

        acceptB.setTitle_(accept or "")
        otherB.setTitle_(other or "")

        if False and sum(a.enabled for a in AccountManager().iter_accounts())==1:
            destT.setHidden_(True)
        else:
            destT.setHidden_(False)
            if isinstance(session.account, BonjourAccount):
                destT.setStringValue_(u"To Bonjour account")
            else:
                destT.setStringValue_(u"To %s" % format_identity_to_string(session.account))
            destT.sizeToFit()

        if len(self.sessions) == 1:
            panelAcceptB.setTitle_(accept)
            panelAcceptB.setHidden_(False)
            panelOtherB.setTitle_(other or "")
            panelOtherB.setHidden_(not other)
            panelRejectB.setTitle_("Reject")

            panelAcceptB.cell().setRepresentedObject_(NSNumber.numberWithInt_(0))
            panelRejectB.cell().setRepresentedObject_(NSNumber.numberWithInt_(2))
            panelBusyB.cell().setRepresentedObject_(NSNumber.numberWithInt_(3))
            panelOtherB.cell().setRepresentedObject_(NSNumber.numberWithInt_(1))

            panelBusyB.setHidden_(is_update_proposal or is_file_transfer)

            for i in (5, 6, 7, 8):
                view.viewWithTag_(i).setHidden_(True)
        else:
            panelAcceptB.setHidden_(False)
            panelAcceptB.setTitle_("Accept All")
            panelOtherB.setHidden_(True)
            panelBusyB.setHidden_(is_update_proposal or is_file_transfer)
            panelRejectB.setTitle_("Reject All")

            for v in self.sessions.values():
                for i in (5, 6, 7, 8):
                    btn = v.viewWithTag_(i)
                    btn.setHidden_(len(btn.attributedTitle()) == 0)
开发者ID:wilane,项目名称:blink-cocoa,代码行数:104,代码来源:AlertPanel.py


注:本文中的sipsimple.configuration.settings.SIPSimpleSettings.strip方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。