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

Commit

Permalink
Version 9.05
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasmonk committed May 31, 2015
1 parent 7626007 commit d2646b7
Show file tree
Hide file tree
Showing 18 changed files with 173 additions and 50 deletions.
2 changes: 1 addition & 1 deletion Code/Albums.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def __init__(self, clave, nombre, nivel, bien, aleatorio, captura, esquivo, simi
self.aterrizaje = int(aterrizaje)
self.mate = int(mate)

dic = {"t": "toga" if VarGen.isWindows else "fruit", "c": "critter", "k": "komodo", "s": "stockfish"}
dic = {"t": "fruit", "c": "critter", "k": "komodo", "s": "stockfish"}
self.engine = dic.get(engine, None)

self.apertura = apertura
Expand Down
10 changes: 5 additions & 5 deletions Code/Analisis.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,19 +596,19 @@ def puntuacionActual(self):
return rm.texto()

def complexity(self):
return get_complexity(self.jg.posicionBase, self.mrm)
return AnalisisIndexes.get_complexity(self.jg.posicionBase, self.mrm)

def winprobability(self):
return get_winprobability(self.jg.posicionBase, self.mrm)
return AnalisisIndexes.get_winprobability(self.jg.posicionBase, self.mrm)

def narrowness(self):
return get_narrowness(self.jg.posicionBase, self.mrm)
return AnalisisIndexes.get_narrowness(self.jg.posicionBase, self.mrm)

def efficientmobility(self):
return get_efficientmobility(self.jg.posicionBase, self.mrm)
return AnalisisIndexes.get_efficientmobility(self.jg.posicionBase, self.mrm)

def piecesactivity(self):
return get_piecesactivity(self.jg.posicionBase, self.mrm)
return AnalisisIndexes.get_piecesactivity(self.jg.posicionBase, self.mrm)

def posicionActual(self):
nMovs = self.partida.numJugadas()
Expand Down
6 changes: 3 additions & 3 deletions Code/Configuracion.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
import Code.CajonDesastre as CajonDesastre
import Code.TrListas as TrListas

LCFILEFOLDER = os.path.abspath("./lc.folder")
LCBASEFOLDER = os.path.abspath("./UsrData")
LCFILEFOLDER = "./lc.folder"
LCBASEFOLDER = "./UsrData"

def activeFolder():
if os.path.isfile(LCFILEFOLDER):
Expand All @@ -40,7 +40,7 @@ def isDefaultFolder():

def changeFolder(nueva):
if nueva:
if os.path.abspath(nueva) == LCBASEFOLDER:
if os.path.abspath(nueva) == os.path.abspath(LCBASEFOLDER):
return changeFolder(None)
f = open(LCFILEFOLDER, "wb")
f.write(nueva)
Expand Down
27 changes: 20 additions & 7 deletions Code/ControlPGN.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,17 +225,30 @@ def actual(self):

def actualGM(self):

gm = self.gestor.apertura.gm
siBlancas = self.gestor.apertura.siBlancas
oponente, fecha, apertura, result = self.gestor.apertura.datosActuales()
gm = self.gestor.gm
motorGM = self.gestor.motorGM

if siBlancas:
partidaGM = motorGM.getLastGame()

if partidaGM:
event = partidaGM.event
oponent = partidaGM.oponent
fecha = partidaGM.date
result = partidaGM.result
else:
event = "?"
oponent = "?"
fecha = "????.??.??"
result = "*"

if self.gestor.siBlancas:
blancas = gm
negras = oponente
negras = oponent
else:
blancas = oponente
blancas = oponent
negras = gm
resp = '[Event "?"]\n'

resp = '[Event "%s"]\n' % event
resp += '[Date "%s"]\n' % fecha
resp += '[White "%s"]\n' % blancas
resp += '[Black "%s"]\n' % negras
Expand Down
6 changes: 3 additions & 3 deletions Code/DBgames.py
Original file line number Diff line number Diff line change
Expand Up @@ -753,12 +753,12 @@ def leerPGN(self, fichero, dlTmp):
erroneos = duplicados = importados = 0

# 1.File pgn -> temporal clean
for n, g in enumerate(PGNreader.readGames(fichero)):
if n == 10000:
break
for n, g in enumerate(PGNreader.readGames(fichero),1):
if n % 100 == 0:
if not dlTmp.actualiza(n, erroneos, duplicados, importados):
break
if n%10000 == 0:
self.dbf.commit()
if g.erroneo:
erroneos += 1
continue
Expand Down
16 changes: 10 additions & 6 deletions Code/GM.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class GMpartida:
def __init__(self, linea):
xpv, self.site, self.oponent, self.date, self.opening, self.result, self.color = linea.split("|")
xpv, self.event, self.oponent, self.date, self.opening, self.result, self.color = linea.split("|")
self.liPV = xpv2pv(xpv).split(" ")
self.lenPV = len(self.liPV)

Expand Down Expand Up @@ -52,10 +52,14 @@ def __init__(self, carpeta, gm):
self.liGMPartidas = self.read()

self.ply = 0
self.lastGame = None

def __len__(self):
return len(self.liGMPartidas)

def getLastGame(self):
return self.lastGame

def read(self):
ficheroGM = self.gm + ".xgm"
f = open(os.path.join(self.carpeta, ficheroGM), "rb")
Expand Down Expand Up @@ -137,9 +141,9 @@ def resultado(self, partida):
apertura = partida.apertura.trNombre if partida.apertura else gPartida.opening

txt = _("Opponent") + " : <b>" + gPartida.oponent + "</b><br>"
site = gPartida.site
if site:
txt += _("Site") + " : <b>" + site + "</b><br>"
event = gPartida.event
if event:
txt += _("Event") + " : <b>" + event + "</b><br>"
txt += _("Date") + " : <b>" + gPartida.date + "</b><br>"
txt += _("Opening") + " : <b>" + apertura + "</b><br>"
txt += _("Result") + " : <b>" + gPartida.result + "</b><br>"
Expand All @@ -155,8 +159,8 @@ def resultado(self, partida):
else:
porc = 0

site = " - %s" % site if site else ""
txtResumen = "%s%s - %s - %s" % (gPartida.oponent, site, gPartida.date, gPartida.result)
event = " - %s" % event if event else ""
txtResumen = "%s%s - %s - %s" % (gPartida.oponent, event, gPartida.date, gPartida.result)

return txt, porc, txtResumen

Expand Down
5 changes: 3 additions & 2 deletions Code/GestorSolo.py
Original file line number Diff line number Diff line change
Expand Up @@ -789,8 +789,9 @@ def configurarGS(self):
elif resp == "motor":
self.ponRotulo1("")
if self.siJuegaMotor:
self.xrival.terminar()
self.xrival = None
if self.xrival:
self.xrival.terminar()
self.xrival = None
self.siJuegaMotor = False
else:
self.cambioRival()
Expand Down
2 changes: 1 addition & 1 deletion Code/Init.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
DEBUG = False
VERSION = "9.04"
VERSION = "9.05"

import sys

Expand Down
4 changes: 2 additions & 2 deletions Code/QT/PantallaBooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ def polyglotUnir(owner):
return

if VarGen.isWindows:
exe = 'engines/polyglot/polyglot.exe'
exe = 'EnginesWindows/polyglot/polyglot.exe'
else:
exe = 'enginesLinux/polyglot/polyglot'
exe = 'EnginesLinux/polyglot/polyglot'
li = [os.path.abspath(exe), 'merge-book', "-in1", f1, "-in2", f2, "-out", fr]
try:
os.remove(fr)
Expand Down
4 changes: 3 additions & 1 deletion Code/QT/WBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,11 @@ def gridDato(self, grid, fila, oColumna):
mate = analisis.mate
siW = jg.posicionBase.siBlancas
if mate:
if mate > 0:
mate -= 1
if not siW:
mate = -mate
info = "(M%+d)" % mate
info = ("(M%+d)" % mate) if mate else ""
else:
pts = analisis.puntos
if not siW:
Expand Down
16 changes: 0 additions & 16 deletions Code/RunSound.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,12 @@ def __init__(self):
self.dv = {}

class Replay():
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
def __init__(self):
self.CHUNK = 1024

self.dbw = {}
self.lock = 0

#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
def procesa(self, io, orden):
dv = orden.dv
if orden.clave == DATABASE:
Expand All @@ -51,9 +47,6 @@ def procesa(self, io, orden):

return None

#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
def add_db(self, fichero, tabla):
db = Util.DicBLOB(fichero, tabla)
keys = db.keys()
Expand All @@ -63,17 +56,11 @@ def add_db(self, fichero, tabla):

db.close()

#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
def add_bin(self, clave, bin):

f = StringIO.StringIO(bin)
self.add_wav(clave, f)

#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
def add_wav(self, clave, wav):

wf = wave.open(wav, 'rb')
Expand All @@ -90,11 +77,9 @@ def add_wav(self, clave, wav):
self.dbw[clave] = ( format, channels, rate, wf.readframes(wf.getnframes()) )
wf.close()

#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
def siClave(self, clave):
return clave in self.dbw

#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
def play(self, io, liClaves):

li = []
Expand Down Expand Up @@ -129,7 +114,6 @@ def play(self, io, liClaves):
p.terminate()

return orden
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

class IO():
def __init__(self, xcpu, fdb):
Expand Down
4 changes: 3 additions & 1 deletion Code/XMotorRespuesta.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,11 @@ def abrTextoPDT(self):
def abrTextoBase(self):
if self.mate != 0:
mt = self.mate
if mt > 0:
mt -= 1
if not self.siBlancas:
mt = -mt
return "M%+d" % mt
return ("M%+d" % mt) if mt else "M"
else:
pts = self.puntos
if not self.siBlancas:
Expand Down
Binary file modified EnginesWindows/stockfish/Windows/stockfish-6-32.exe
Binary file not shown.
Binary file modified Locale/fr/LC_MESSAGES/lucaschess.mo
Binary file not shown.
Binary file modified Locale/ru/LC_MESSAGES/lucaschess.mo
Binary file not shown.
11 changes: 10 additions & 1 deletion Lucas.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,18 @@
# Licence : GPL
# ==============================================================================

# 9.04


"""
1. Mate label in analysis. (dima d)
2. When program path includes cyrillic characters. (tserv)
3. Merging polyglot books.
4. Renaming a Personal opening guide. (Mario L)
5. Changed stockfish with a compilation valid to old pcs. (Jörg R)
6. Play like a GM, when saving to PGN. (Uli)
7. Cinnamon problems working with low fixed depths, detected but not fixed. (Xema)
"""

import os
import sys

Expand Down
2 changes: 1 addition & 1 deletion bug.log
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Version 9.04
Version 9.05
Loading

0 comments on commit d2646b7

Please sign in to comment.