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


Python SIPSimpleSettings.default_account方法代码示例

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


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

示例1: _set_default_account

# 需要导入模块: from sipsimple.configuration.settings import SIPSimpleSettings [as 别名]
# 或者: from sipsimple.configuration.settings.SIPSimpleSettings import default_account [as 别名]
 def _set_default_account(self, account):
     if account is not None and not account.enabled:
         raise ValueError("account %s is not enabled" % account.id)
     notification_center = NotificationCenter()
     settings = SIPSimpleSettings()
     with self._lock:
         old_account = self.accounts.get(settings.default_account, None)
         if account is old_account:
             return
         if account is None:
             settings.default_account = None
         else:
             settings.default_account = account.id
         settings.save()
         # we need to post the notification in the file-io thread in order to have it serialized after the
         # SIPAccountManagerDidAddAccount notification that is triggered when the account is saved the first
         # time, because save is executed in the file-io thread while this runs in the current thread. -Dan
         call_in_thread('file-io', notification_center.post_notification, 'SIPAccountManagerDidChangeDefaultAccount', sender=self, data=NotificationData(old_account=old_account, account=account))
开发者ID:acatighera,项目名称:python-sipsimple,代码行数:20,代码来源:__init__.py


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