示例#1
0
 def initComboBox(self):
     """训练模型下拉框初始化, 从设置中读取配置"""
     conf = util.getConfig(CONFIG_PATH)
     modelList = conf.options(CONF_MODEL_LIST_NAME)
     for m in modelList:
         curModelPath = conf.get(CONF_MODEL_LIST_NAME, m)
         self.comboBox.addItem(m)
示例#2
0
 def initData(self):
     """初始化列表中的数据"""
     self.modelListView.clear()
     self.conf = util.getConfig(CONFIG_PATH)
     modelList = self.conf.options(CONF_MODEL_LIST_NAME)
     for m in modelList:
         curModelPath = self.conf.get(CONF_MODEL_LIST_NAME, m)
         self.modelListView.addItem("{}: '{}'".format(m, curModelPath))
示例#3
0
 def accept(self):
     """确认"""
     modelName = self.modelNameInput.text()
     conf = util.getConfig(CONFIG_PATH)
     # print(modelName, self.modelPath)
     if modelName != None and self.modelPath != None:
         conf.set(CONF_MODEL_LIST_NAME, modelName, self.modelPath)
     with open(CONFIG_PATH, 'w') as f:
         conf.write(f)
     self.close()
示例#4
0
 def initData(self):
     """初始化数据"""
     self.conf = util.getConfig(CONFIG_PATH)
     self.picDefaultLoadDir = self.conf.get(DEFAULT_LOAD_DIR,
                                            "pic-default-load-dir")