def create_params_file(self, fname):
msg = QMessageBox()
msg.setIcon(QMessageBox.Question)
msg.setText("Parameter file %r not found, do you want SpyKING CIRCUS to "
"create it for you?" % fname)
msg.setWindowTitle("Generate parameter file?")
msg.setInformativeText("This will create a parameter file from a "
"template file and open it in your system's "
"standard text editor. Fill properly before "
"launching the code. See the documentation "
"for details")
msg.setStandardButtons(QMessageBox.Yes | QMessageBox.No)
answer = msg.exec_()
if answer == QMessageBox.Yes:
user_path = os.path.join(os.path.expanduser('~'), 'spyking-circus')
if os.path.exists(user_path + 'config.params'):
config_file = os.path.abspath(user_path + 'config.params')
else:
config_file = os.path.abspath(
pkg_resources.resource_filename('circus', 'config.params'))
shutil.copyfile(config_file, fname)
self.params = fname
self.last_log_file = fname.replace('.params', '.log')
self.update_params()
评论列表
文章目录