app.py 文件源码

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

项目:FitScan 作者: GunfighterJ 项目源码 文件源码
def getSubsystemMapping(self):
        qfile = QtCore.QFile(":db/subsystemMap.csv")
        items = {}

        if qfile.open(QtCore.QIODevice.ReadOnly | QtCore.QIODevice.Text):
            data = qfile.readAll()
            content = StringIO.StringIO(data)
            reader = csv.reader(content, delimiter=',')

            for row in reader:
                shipName = row[0].decode('utf-8')
                high = row[1].decode('utf-8')
                mid = row[2].decode('utf-8')
                low = row[3].decode('utf-8')

                items[shipName] = {
                    "H": high,
                    "M": mid,
                    "L": low,
                }
            qfile.close()
            return items

        QMessageBox.critical(None, 'Database Failure', 'Failed to read subsystem mappings from database', QMessageBox.Ok)
        self.stop()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号