def parser(self): name = QFileDialog.getExistingDirectory(None, '选择文件夹') if os.path.exists(name): self.pars_fname = '' ls = parse(name) self.scene().clear() #self.from_dict(dc) for i in ls: if isinstance(i, model): self.scene().addItem(ModelGram(i.app, i.name, i.code)) elif isinstance(i, App): self.scene().addItem(AppGram(i.name, i.code))
def parser(self): name = QFileDialog.getExistingDirectory(None,'选择文件夹') if os.path.exists(name): self.pars_fname = '' ls = parse(name) self.scene().clear() #self.from_dict(dc) for i in ls: if isinstance(i,model): self.scene().addItem( ModelGram(i.app, i.name,i.code) ) elif isinstance(i,App): self.scene().addItem(AppGram(i.name,i.code))
def add_cst(self): name = QFileDialog.getExistingDirectory(None, '选择文件夹') if os.path.exists(name): self.pars_fname = '' ls = parse(name) for i in ls: gram = self.find_gram(i) if gram: continue else: if isinstance(i, model): self.scene().addItem(ModelGram(i.app, i.name, i.code)) elif isinstance(i, App): self.scene().addItem(AppGram(i.name, i.code))
def add_cst(self): name = QFileDialog.getExistingDirectory(None,'选择文件夹') if os.path.exists(name): self.pars_fname = '' ls = parse(name) for i in ls: gram = self.find_gram(i) if gram: continue else: if isinstance(i,model): self.scene().addItem( ModelGram(i.app, i.name,i.code) ) elif isinstance(i,App): self.scene().addItem(AppGram(i.name,i.code))