editorset.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:chirp_fork 作者: mach327 项目源码 文件源码
def choose_sub_device(self, radio):
        devices = radio.get_sub_devices()
        choices = [x.VARIANT for x in devices]

        d = inputdialog.ChoiceDialog(choices)
        text = _("The {vendor} {model} has multiple independent sub-devices")
        d.label.set_text(text.format(vendor=radio.VENDOR, model=radio.MODEL) +
                         os.linesep + _("Choose one to import from:"))
        r = d.run()
        chosen = d.choice.get_active_text()
        d.destroy()
        if r == gtk.RESPONSE_CANCEL:
            raise Exception(_("Cancelled"))
        for d in devices:
            if d.VARIANT == chosen:
                return d

        raise Exception(_("Internal Error"))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号