roomba.py 文件源码

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

项目:Roomba980-Python 作者: NickWaterton 项目源码 文件源码
def read_config_file(self, file="./config.ini"):
        #read config file
        Config = configparser.ConfigParser()
        try:
            Config.read(file)
        except Exception as e:
            self.log.warn("Error reading config file %s" %e)
            self.log.info("No Roomba specified, and no config file found - "
                          "attempting discovery")
            if Password(self.address, file):
                return self.read_config_file(file)
            else:
                return False
        self.log.info("reading info from config file %s" % file)
        addresses = Config.sections()
        if self.address is None:
            if len(addresses) > 1:
                self.log.warn("config file has entries for %d Roombas, "
                              "only configuring the first!")
                self.address = addresses[0]
        self.blid = Config.get(self.address, "blid"),
        self.password = Config.get(self.address, "password")
        # self.roombaName = literal_eval(
        #     Config.get(self.address, "data"))["robotname"]
        return True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号