本文整理汇总了Python中pychess.Players.engineNest.discoverer.save函数的典型用法代码示例。如果您正苦于以下问题:Python save函数的具体用法?Python save怎么用?Python save使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了save函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: spin_edited_cb
def spin_edited_cb(self, cell, path, new_text, model):
try:
model[path][1]["value"] = int(new_text)
discoverer.save()
except Exception:
pass
return
开发者ID:teacoffee2017,项目名称:pychess,代码行数:7,代码来源:enginesDialog.py
示例2: select_dir
def select_dir(button):
new_directory = dir_chooser_dialog.get_filename()
engine = discoverer.getEngineByName(self.cur_engine)
old_directory = engine.get("workingDirectory")
if new_directory != old_directory and new_directory != self.default_workdir:
engine["workingDirectory"] = new_directory
discoverer.save()
开发者ID:sally0813,项目名称:pychess,代码行数:7,代码来源:enginesDialog.py
示例3: args_changed
def args_changed(widget):
if self.cur_engine is not None:
new_args = self.widgets["engine_args_entry"].get_text().strip()
engine = discoverer.getEngineByName(self.cur_engine)
old_args = engine.get("args")
if new_args != old_args:
engine["args"] = new_args.split()
discoverer.save()
开发者ID:sally0813,项目名称:pychess,代码行数:8,代码来源:enginesDialog.py
示例4: remove
def remove(button):
if self.cur_engine is not None:
self.widgets['remove_engine_button'].set_sensitive(False)
engine = discoverer.getEngineByName(self.cur_engine)
discoverer.removeEngine(self.cur_engine)
discoverer.save()
update_store(discoverer)
# Notify playerCombos in NewGameTasker
discoverer.emit("all_engines_discovered")
ts = self.tv.get_selection()
ts.select_path((0,))
开发者ID:btrent,项目名称:knave,代码行数:11,代码来源:enginesDialog.py
示例5: name_edited
def name_edited(renderer, path, new_name):
if self.cur_engine is not None:
old_name = self.cur_engine
if new_name and new_name != old_name:
names = [engine["name"] for engine in discoverer.getEngines()]
if new_name not in names:
engine = discoverer.getEngineByName(self.cur_engine)
engine["name"] = new_name
discoverer.save()
self.cur_engine = new_name
update_store()
# Notify playerCombos in NewGameTasker
discoverer.emit("all_engines_discovered")
开发者ID:sally0813,项目名称:pychess,代码行数:13,代码来源:enginesDialog.py
示例6: remove
def remove(button):
if self.cur_engine is not None:
self.widgets['remove_engine_button'].set_sensitive(False)
engine = discoverer.getEngineByName(self.cur_engine)
discoverer.removeEngine(self.cur_engine)
discoverer.save()
selection = self.tv.get_selection()
result = selection.get_selected()
if result is not None:
model, iter = result
model.remove(iter)
# Notify playerCombos in NewGameTasker
discoverer.emit("all_engines_discovered")
开发者ID:sally0813,项目名称:pychess,代码行数:15,代码来源:enginesDialog.py
示例7: engine_default_options
def engine_default_options(button):
if self.cur_engine is not None and not self.selection:
engine = discoverer.getEngineByName(self.cur_engine)
options = engine.get("options")
if options:
dialog = Gtk.MessageDialog(mainwindow(), type=Gtk.MessageType.QUESTION, buttons=Gtk.ButtonsType.YES_NO)
dialog.set_markup(_("Do you really want to restore the default options of the engine ?"))
response = dialog.run()
dialog.destroy()
if response == Gtk.ResponseType.YES:
for option in options:
if "default" in option:
option["value"] = option["default"]
discoverer.save()
update_options()
开发者ID:teacoffee2017,项目名称:pychess,代码行数:15,代码来源:enginesDialog.py
示例8: cancel_event
def cancel_event(widget, with_confirmation, *args):
# Confirm if the changes need to be saved
modified = discoverer.hasChanged()
if modified and with_confirmation:
dialog = Gtk.MessageDialog(mainwindow(), type=Gtk.MessageType.QUESTION, buttons=Gtk.ButtonsType.YES_NO)
dialog.set_markup(_("You have unsaved changes. Do you want to save before leaving?"))
response = dialog.run()
dialog.destroy()
# if response == Gtk.ResponseType.CANCEL:
# return False
if response == Gtk.ResponseType.NO:
discoverer.restore()
if response == Gtk.ResponseType.YES:
discoverer.save()
# Close the window
widgets["manage_engines_dialog"].hide()
return True
开发者ID:leogregianin,项目名称:pychess,代码行数:18,代码来源:enginesDialog.py
示例9: country_changed
def country_changed(widget):
if self.cur_engine is not None and not self.selection:
engine = discoverer.getEngineByName(self.cur_engine)
old_country = discoverer.getCountry(engine)
new_country = ISO3166_LIST[widget.get_active()].iso2
if old_country != new_country:
engine["country"] = new_country
discoverer.save()
# Refresh the flag in the tree view
path = addDataPrefix("flags/%s.png" % new_country)
if not os.path.isfile(path):
path = addDataPrefix("flags/unknown.png")
item = self.tv.get_selection().get_selected()
if item is not None:
model, ts_iter = item
model[ts_iter][0] = get_pixbuf(path)
# Notify playerCombos in NewGameTasker
discoverer.emit("all_engines_discovered")
开发者ID:teacoffee2017,项目名称:pychess,代码行数:20,代码来源:enginesDialog.py
示例10: spin_edited_cb
def spin_edited_cb(self, cell, path, new_text, model):
model[path][1]["value"] = new_text
discoverer.save()
return
开发者ID:sally0813,项目名称:pychess,代码行数:4,代码来源:enginesDialog.py
示例11: toggled_cb
def toggled_cb(self, cell, path, model):
model[path][1]["value"] = not model[path][1]["value"]
discoverer.save()
return
开发者ID:sally0813,项目名称:pychess,代码行数:4,代码来源:enginesDialog.py
示例12: save_event
def save_event(widget, *args):
discoverer.save()
widgets["manage_engines_dialog"].hide()
return True
开发者ID:leogregianin,项目名称:pychess,代码行数:4,代码来源:enginesDialog.py
注:本文中的pychess.Players.engineNest.discoverer.save函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论