app.py 文件源码

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

项目:FitScan 作者: GunfighterJ 项目源码 文件源码
def getShipSlotMapping(self):
        qfile = QtCore.QFile(":db/shipMap.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')
                rig      = row[4].decode('utf-8')
                sub      = row[5].decode('utf-8')

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

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


问题


面经


文章

微信
公众号

扫码关注公众号