def setFigureInfo(self, opt_dict): self.doCheckLink(True, opt_dict) if 'showworkflow' in opt_dict: self.figure_type.setCurrentIndex(1) elif 'showtree' in opt_dict: self.figure_type.setCurrentIndex(2) else: self.figure_type.setCurrentIndex(0) if 'version' in opt_dict: self.figure_version.setText(str(opt_dict['version'])) else: self.figure_version.setText("") if 'tag' in opt_dict: self.figure_tag.setEditText(str(opt_dict['tag'])[1:-1]) else: self.figure_tag.setEditText("") if '_args' in opt_dict: self.graphicx_edit.setText(opt_dict['_args']) # build locator if 'filename' in opt_dict: # set using basedir of tex file fname = opt_dict['filename'] if not os.path.isabs(fname): source_dir = os.path.dirname(str(self.source_edit.text())) #print 'source_dir:', str(self.source_edit.text()), source_dir fname = os.path.join(source_dir, fname) locator = FileLocator(fname) elif 'host' in opt_dict: if 'port' not in opt_dict: opt_dict['port'] = '3306' port = int(opt_dict['port']) locator = DBLocator(opt_dict['host'], port, opt_dict['db'], '', '', obj_id=opt_dict['vtid']) else: locator = None if locator is not None: self.figure_ref.setText(locator.to_url()) else: self.figure_ref.setText("") self.figure_ref.locator = locator self.readImage(opt_dict)
def update_from_directory(self, directory): filenames = glob.glob(os.path.join(directory, '*.vt')) for filename in filenames: locator = FileLocator(filename) url = locator.to_url() self.updateVistrail(url)