예제 #1
0
    def jugarPosicion(self):
        position, from_sq, to_sq = self.um.active_base_position()
        game = Game.Game(ini_posicion=position)
        dic_sended = {"ISWHITE": position.is_white, "GAME": game.save()}

        fichero = Code.configuration.ficheroTemporal("pk")
        Util.save_pickle(fichero, dic_sended)

        XRun.run_lucas("-play", fichero)
예제 #2
0
    def gmMostrar(self):
        pgn = self.pgnActual()
        if pgn:
            fpgn = Util.ficheroTemporal("Tmp", "pgn")
            f = codecs.open(fpgn, "w", "utf-8", 'ignore')
            f.write(pgn)
            f.close()

            # Se lanza otro LC con ese PGN
            QTUtil2.mensajeTemporal(self, _("One moment please..."), 0.3)

            XRun.run_lucas(fpgn)
예제 #3
0
 def gm_launch(self):
     self.grabar()
     worker_plant = os.path.join(
         self.configuracion.folder_tournaments_workers(), "worker.%05d")
     pos = 1
     while True:
         wfile = worker_plant % pos
         if Util.exist_file(wfile):
             if not Util.remove_file(wfile):
                 pos += 1
                 continue
         break
     XRun.run_lucas("-tournament", self.torneo.file, wfile)
예제 #4
0
    def gmMostrar(self):
        li = self.gridGames.recnosSeleccionados()
        if not li:
            return
        pgn = self.torneo.grabaPGNgames(li[:1])
        if pgn:
            fpgn = Util.ficheroTemporal("Tmp", "pgn")
            f = codecs.open(fpgn, "w", "utf-8", 'ignore')
            f.write(pgn)
            f.close()

            # Se lanza otro LC con ese PGN
            QTUtil2.mensajeTemporal(self, _("One moment please..."), 0.3)

            XRun.run_lucas(fpgn)
예제 #5
0
 def gm_launch(self):
     if self.torneo.num_games_queued() == 0:
         QTUtil2.message(self, _("You must create some games (Queued Games tab/ New)"))
         return
     self.grabar()
     worker_plant = os.path.join(self.configuration.folder_tournaments_workers(), "worker.%05d")
     pos = 1
     while True:
         wfile = worker_plant % pos
         if Util.exist_file(wfile):
             if not Util.remove_file(wfile):
                 pos += 1
                 continue
         break
     XRun.run_lucas("-tournament", self.torneo.file, wfile)
예제 #6
0
    def __init__(self, huella_kibitzer):
        configuration = Code.configuration

        fdb = configuration.ficheroTemporal("db")

        self.ipc = UtilSQL.IPC(fdb, True)

        orden = Orden()
        orden.key = KIBRUN_CONFIGURATION
        orden.dv["USER"] = configuration.user
        orden.dv["HUELLA"] = huella_kibitzer

        self.escribe(orden)

        self.popen = XRun.run_lucas("-kibitzer", fdb)
예제 #7
0
    def __init__(self):

        fdb = VarGen.configuracion.ficheroTemporal("db")

        self.ipc = Util.IPC(fdb, True)

        orden = Orden()
        orden.clave = self.DATABASE
        orden.ponVar("FICHERO", VarGen.configuracion.ficheroSounds)
        orden.ponVar("TABLA", "general")

        self.escribe(orden)
        self.siSonando = False

        self.popen = XRun.run_lucas("-sound", fdb)
예제 #8
0
    def __init__(self, numkibitzer):
        configuracion = Code.configuracion

        fdb = configuracion.ficheroTemporal("db")

        self.ipc = UtilSQL.IPC(fdb, True)

        orden = Orden()
        orden.key = KIBRUN_CONFIGURACION
        orden.dv["USER"] = configuracion.user
        orden.dv["NUMKIBITZER"] = numkibitzer

        self.escribe(orden)

        self.popen = XRun.run_lucas("-kibitzer", fdb)
    def __init__(self, gestor, numkibitzer):
        configuracion = gestor.configuracion

        fdb = configuracion.ficheroTemporal("db")

        self.ipc = Util.IPC(fdb, True)

        orden = Orden()
        orden.clave = self.CONFIGURACION
        orden.dv["USER"] = configuracion.user
        orden.dv["NUMKIBITZER"] = numkibitzer

        self.escribe(orden)

        self.popen = XRun.run_lucas("-kibitzer", fdb)
예제 #10
0
def xVoyager(wowner, configuracion, partida=None, fen=None, siFen=False):
    fdb = configuracion.ficheroTemporal("db")
    db = Util.DicRaw(fdb)
    db["USER"] = configuracion.user
    if partida:
        db["PARTIDA"] = partida.guardaEnTexto()
    if siFen:
        db["FEN"] = fen
    db["MODO_PARTIDA"] = partida is not None

    popen = XRun.run_lucas("-voyager", fdb)

    popen.wait()

    txtp = db["RESULT"]
    db.close()
    return txtp
예제 #11
0
    def __init__(self, gestor, kibitzer):

        fdb = VarGen.configuracion.ficheroTemporal("db")

        self.ipc = Util.IPC(fdb, True)

        motor = kibitzer["MOTOR"]
        if kibitzer["TIPO"] == "I":
            motor = "rodentII"
        configMotor = gestor.configuracion.buscaRivalExt(motor)

        orden = Orden()
        orden.clave = self.CONFIGURACION
        orden.dv["CONFIGURACION"] = gestor.configuracion
        orden.dv["TITULO"] = kibitzer["NOMBRE"]
        orden.dv["FVIDEO"] = kibitzer["FVIDEO"]
        orden.dv["TIPO"] = kibitzer["TIPO"]
        orden.dv["CONFIG_MOTOR"] = configMotor

        self.escribe(orden)

        self.popen = XRun.run_lucas("-kibitzer", fdb)
예제 #12
0
    def jugarPosicion(self):
        posicion, desde, hasta = self.um.posicionBaseActual()
        fen = posicion.fen()

        XRun.run_lucas("-play", fen)
예제 #13
0
    def jugarPosicion(self):
        position, from_sq, to_sq = self.um.active_base_position()
        fen = position.fen()

        XRun.run_lucas("-play", fen)