def mas(alias, autor, version, url, exe, elo, folder=None): if folder is None: folder = alias path_exe = os.path.join(folder_engines, folder, exe) engine = Engines.Engine(alias, autor, version, url, path_exe) engine.elo = elo dic_engines[alias] = engine return engine
def genEnginesIrina(self): cmbase = self.configuracion.buscaRival("irina") li = [] for name, trans, ico in QTVarios.list_irina(): cm = Engines.Engine(name, cmbase.autor, cmbase.version, cmbase.url, cmbase.path_exe) cm.name = trans cm.icono = ico cm.ordenUCI("Personality", name) li.append(cm) return li
def mas(clave, autor, version, url, exe, elo): path_exe = os.path.join(folder_engines, clave, exe) engine = Engines.Engine(clave, autor, version, url, path_exe) engine.elo = elo engine.ordenUCI("Log", "false") engine.ordenUCI("Ponder", "false") engine.ordenUCI("Hash", "16") engine.ordenUCI("Threads", "1") dic_engines[clave] = engine return engine
def mas(alias, autor, version, url, exe, elo, folder=None): if folder is None: folder = alias path_exe = os.path.join(folder_engines, folder, exe) engine = Engines.Engine(alias.lower(), autor, version, url, path_exe) engine.elo = elo engine.ordenUCI("Log", "false") engine.ordenUCI("Ponder", "false") engine.ordenUCI("Hash", "16") engine.ordenUCI("Threads", "1") dic_engines[alias] = engine return engine
def lee_motores_externos(self): li = Util.restore_pickle(self.file_external_engines()) if li: from Code.Engines import Engines for x in li: eng = Engines.Engine() eng.restore(x) key = eng.key n = 0 while eng.key in self.dic_engines: n += 1 eng.key = "%s-%d" % (key, n) eng.set_extern() self.dic_engines[eng.key] = eng
def command(self): separador = FormLayout.separador li_gen = [separador] li_gen.append(separador) config = FormLayout.Fichero(_("File"), "exe" if Code.is_windows else "*", False) li_gen.append((config, "")) for num in range(1, 11): li_gen.append(("%s:" % (_("Argument %d") % num), "")) li_gen.append(separador) resultado = FormLayout.fedit(li_gen, title=_("Command"), parent=self, anchoMinimo=600, icon=Iconos.Terminal()) if resultado: nada, resp = resultado command = resp[0] liArgs = [] if not command or not os.path.isfile(command): return for x in range(1, len(resp)): arg = resp[x].strip() if arg: liArgs.append(arg) um = QTUtil2.unMomento(self) me = Engines.Engine(path_exe=command, args=liArgs) li_uci = me.read_uci_options() um.final() if not li_uci: QTUtil2.message_bold( self, _X( _("The file %1 does not correspond to a UCI engine type." ), command)) return None # Editamos w = WEngine(self, self.lista_motores, me) if w.exec_(): self.lista_motores.append(me) self.grid.refresh() self.grid.gobottom(0) self.grabar()
def restore_state(self, dic): engine_rival = Engines.Engine() engine_rival.restore(dic["engine_rival"]) engine_rival.pgana = dic["pgana"] engine_rival.ptablas = dic["ptablas"] engine_rival.ppierde = dic["ppierde"] engine_rival.alias = dic["alias"] minutos = dic["minutos"] segundos = dic["segundos"] self.base_inicio(engine_rival, minutos, segundos) self.game.restore(dic["game_save"]) self.vtime[WHITE].restore(dic["time_white"]) self.vtime[BLACK].restore(dic["time_black"]) self.goto_end()
def mas(clave, autor, version, url, exe, elo): path_exe = os.path.join(folder_engines, clave, exe) engine = Engines.Engine(clave, autor, version, url, path_exe) engine.elo = elo dic_engines[clave] = engine return engine