gui.py 文件源码

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

项目:high-quality-chat 作者: b6938236 项目源码 文件源码
def save_settings(self, setting1):
        children = self.ids.devices.children[:]
        index = 0
        while children:
            child = children.pop()
            if index == 0:
                self.app.config.update_setting("AudioSettings", "mic", child.text)
            if index == 1:
                self.app.config.update_setting("AudioSettings", "speakers", child.text)
            if index == 2 and child.text == "Default":
                self.app.config.update_setting("LQRecordingSettings", "codec", "Default")
            if index == 2 and child.text != "Codec":
                codec = child.text
                newcodec = [codec[0:codec.find(',')]]
                newcodec += [codec[(codec.find(',')+ 1): codec.find("bps")]]
                newcodec += [codec[(codec.find("bps") + 3): codec.find("channels")]]
                self.app.config.update_setting("LQRecordingSettings", "codec", codec)
            index += 1
        if setting1 != '':
            self.app.config.update_setting("ChatSettings", "username", setting1)
        self.parent.current = 'main'
        print self.app.config.get_section("AudioSettings")
        print self.app.config.get_section("LQRecordingSettings")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号