Skip to content
This repository has been archived by the owner on May 4, 2021. It is now read-only.

Commit

Permalink
Version 11.09
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasmonk committed Jun 20, 2018
1 parent 5f23d94 commit 5c53141
Show file tree
Hide file tree
Showing 56 changed files with 885 additions and 375 deletions.
1 change: 0 additions & 1 deletion Code/AperturasStd.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@ def XPV(self, xpv):
last_ap = self.baseXPV(xpv)
return last_ap.trNombre if last_ap else ""


ap = ListaAperturasStd()
apTrain = ListaAperturasStd()

Expand Down
13 changes: 11 additions & 2 deletions Code/Configuracion.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ def __init__(self, user):
self.salvarAbandonados = False
self.salvarFichero = ""

self.folderOpenings = self.folderBaseOpenings

self.salvarCSV = ""

self.liTrasteros = []
Expand Down Expand Up @@ -360,8 +362,8 @@ def ponCarpetas(self, user):
if not Util.existeFichero(self.ficheroRecursos):
Util.copiaFichero("IntFiles/recursos.dbl", self.ficheroRecursos)

self.folderOpenings = os.path.join(self.carpeta, "OpeningLines")
Util.creaCarpeta(self.folderOpenings)
self.folderBaseOpenings = os.path.join(self.carpeta, "OpeningLines")
Util.creaCarpeta(self.folderBaseOpenings)

if os.path.isdir(self.carpeta + "/confvid"):
self.salto_version()
Expand Down Expand Up @@ -639,6 +641,8 @@ def graba(self, aplazamiento=None):

dic["PERFOMANCE"] = self.perfomance.save()

dic["FOLDEROPENINGS"] = self.folderOpenings

for clave, rival in self.dicRivales.iteritems():
dic["RIVAL_%s" % clave] = rival.graba()
if aplazamiento:
Expand Down Expand Up @@ -784,6 +788,11 @@ def lee(self):
if perf:
self.perfomance.restore(perf)

self.folderOpenings = dg("FOLDEROPENINGS", self.folderBaseOpenings)
if not os.path.isdir(self.folderOpenings):
self.folderOpenings = self.folderBaseOpenings


for k in dic.keys():
if k.startswith("RIVAL_"):
claveK = k[6:]
Expand Down
5 changes: 3 additions & 2 deletions Code/Constantes.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@
k_peliculaPGN, k_jugar, k_anterior, k_siguiente, k_trasteros,
k_ayuda, k_mateNivel, k_ayudaMover,
k_aceptar, k_cancelar,
k_configurar, k_utilidades, k_variantes, k_tools, k_elo, k_cambiar, k_libre, k_showtext, k_enviar, k_atajos
) = range(56)
k_configurar, k_utilidades, k_variantes, k_tools, k_elo, k_cambiar, k_libre, k_showtext, k_enviar, k_atajos,
k_forceEnd
) = range(57)

kMP_1, kMP_2, kMP_3, kMP_4, kMP_5, kMP_6, kMP_7 = range(7)

Expand Down
2 changes: 1 addition & 1 deletion Code/DBgames.py
Original file line number Diff line number Diff line change
Expand Up @@ -1065,7 +1065,7 @@ def leePartidaRaw(self, raw):
if xpgn:
xpgn = Util.blob2var(xpgn)
if type(xpgn) in (str, unicode): # Version -9
p.readPGN(VarGen.configuracion, xpgn)
p.readPGN(xpgn)
return p
if "RTAGS" in xpgn:
rtags = xpgn["RTAGS"]
Expand Down
3 changes: 1 addition & 2 deletions Code/DBgamesFEN.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

from Code import Partida
from Code import Util
from Code import VarGen

posA1 = LCEngine.posA1
a1Pos = LCEngine.a1Pos
Expand Down Expand Up @@ -308,7 +307,7 @@ def leePartidaRaw(self, raw):
if xpgn:
xpgn = Util.blob2var(xpgn)
if type(xpgn) in (str, unicode): # Version -9
p.readPGN(VarGen.configuracion, xpgn)
p.readPGN(xpgn)
return p
p.restore(xpgn["FULLGAME"])
return p
Expand Down
5 changes: 2 additions & 3 deletions Code/GM.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import operator
import os
import sys

from LCEngineV1 import xpv2pv, pv2xpv

Expand Down Expand Up @@ -68,9 +67,9 @@ def getLastGame(self):
return self.lastGame

def read(self):
#linux is case sensitive and can't find the xgm file because ficheroGM is all lower-case, but all
#(kupad fix) linux is case sensitive and can't find the xgm file because ficheroGM is all lower-case, but all
#the xgm files have the first letter capitalized (including ones recently downloaded)
ficheroGM = self.gm[0].upper() + self.gm[1:] + ".xgm"
ficheroGM = "%s%s.xgm"% (self.gm[0].upper(), self.gm[1:])
f = open(os.path.join(self.carpeta, ficheroGM), "rb")
li = []
for linea in f:
Expand Down
5 changes: 2 additions & 3 deletions Code/GestorGM.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,7 @@ def mueveHumano(self, desde, hasta, coronacion=None):

movimiento = jgUsu.movimiento()
posicion = self.partida.ultPosicion
analisis = None

isValid = self.motorGM.isValidMove(movimiento)

analisis = None

if not isValid:
Expand All @@ -296,6 +293,8 @@ def mueveHumano(self, desde, hasta, coronacion=None):
self.book = False
else:
siAnalizaJuez = self.siJuez and self.mostrar is None # None es ver siempre False no ver nunca True ver si diferentes
if len(movimiento) == 5:
coronacion = movimiento[4].lower()
desdeGM, hastaGM, coronacionGM = desde, hasta, coronacion

siBien, mens, jgGM = Jugada.dameJugada(posicion, desdeGM, hastaGM, coronacionGM)
Expand Down
30 changes: 27 additions & 3 deletions Code/GestorTorneo.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
from Code import Util
from Code import XGestorMotor
from Code.QT import QTUtil
from Code.QT import QTVarios
from Code.QT import Iconos
from Code.Constantes import *


Expand All @@ -25,7 +27,7 @@ def inicio(self, torneo, liGames):
self.mostrarIndicador(True)
self.siTerminar = False
self.siPausa = False
self.pantalla.ponToolBar((k_cancelar, k_peliculaPausa))
self.pantalla.ponToolBar((k_cancelar, k_peliculaPausa, k_forceEnd))
self.colorJugando = True
self.ponCapPorDefecto()

Expand Down Expand Up @@ -108,6 +110,7 @@ def siguienteJuego(self, gm, ngame, numGames):
self.refresh()

self.finPorTiempo = None
self.finForce = None
while self.siPausa or self.siguienteJugada():
QTUtil.refreshGUI()
if self.siPausa:
Expand Down Expand Up @@ -138,6 +141,9 @@ def compruebaFinal(self):
if self.finPorTiempo is not None:
result = self.finPorTiempo

elif self.finForce is not None:
result = self.finForce

else:
jgUlt = self.partida.last_jg()
result = None
Expand Down Expand Up @@ -193,6 +199,8 @@ def compruebaFinal(self):
termination = "normal"
if self.finPorTiempo:
termination = "time forfeit"
elif self.finForce:
termination = "adjudication"
elif adjudication:
termination = "adjudication"
self.gm.termination(termination)
Expand Down Expand Up @@ -294,10 +302,12 @@ def procesarAccion(self, clave):
self.siTerminar = True
elif clave == k_peliculaPausa:
self.siPausa = True
self.pantalla.ponToolBar((k_cancelar, k_peliculaSeguir))
self.pantalla.ponToolBar((k_cancelar, k_peliculaSeguir, k_forceEnd))
elif clave == k_peliculaSeguir:
self.siPausa = False
self.pantalla.ponToolBar((k_cancelar, k_peliculaPausa))
self.pantalla.ponToolBar((k_cancelar, k_peliculaPausa, k_forceEnd))
elif clave == k_forceEnd:
self.assignResult()

def finalX(self):
self.siTerminar = True
Expand Down Expand Up @@ -344,3 +354,17 @@ def masJugada(self, jg):
self.pgnRefresh(self.partida.ultPosicion.siBlancas)

self.refresh()

def assignResult(self):
menu = QTVarios.LCMenu(self.pantalla)
menu.opcion(0,"1/2-1/2", Iconos.Tablas())
menu.separador()
menu.opcion(1, "1-0", Iconos.Blancas())
menu.separador()
menu.opcion(2, "0-1", Iconos.Negras())
resp = menu.lanza()
if resp is not None:
self.finForce = resp



2 changes: 1 addition & 1 deletion Code/GestorTurnOnLights.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def finLinea(self):
self.total_time_used = 0

else:
if self.tol.go_fast:
if self.tol.go_fast == True or (self.tol.go_fast is None and self.tol.work_level > 0):
self.next_line_run()
return
QTUtil2.mensajeTemporal(self.pantalla, _("This line training is completed."), 1.3)
Expand Down
2 changes: 1 addition & 1 deletion Code/Init.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from Code.Constantes import *

DEBUG = False
VERSION = "11.08a"
VERSION = "11.09"

if DEBUG:
prlkn("DEBUG " * 20)
Expand Down
Loading

0 comments on commit 5c53141

Please sign in to comment.