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

Commit

Permalink
Version 9.08
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasmonk committed Dec 8, 2015
1 parent a5840d0 commit 10e94fb
Show file tree
Hide file tree
Showing 20 changed files with 12,041 additions and 13,538 deletions.
2 changes: 1 addition & 1 deletion Code/DBgames.py
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ def get(label):
else:
duplicados += 1

dlTmp.actualiza(n + 1, erroneos, duplicados, importados)
dlTmp.actualiza(n, erroneos, duplicados, importados)

dlTmp.ponSaving()
self.dbf.commit()
Expand Down
3 changes: 0 additions & 3 deletions Code/EnginesMicElo.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Code.MotoresExternos as MotoresExternos


def leeMicEngines():
lme = MotoresExternos.ListaMotoresExternos("./IntFiles/michele.pkt")
lme.leer()
Expand All @@ -19,13 +18,11 @@ def leeMicEngines():
li.append(mt1)
return li


def listaGM():
li = [mtl for mtl in leeMicEngines() if mtl.nombre[0].isupper()]
li.sort(key=lambda uno: uno.nombre)
return li


def listaCompleta():
li = leeMicEngines()
li.sort(key=lambda uno: uno.elo)
Expand Down
4 changes: 2 additions & 2 deletions Code/EnginesWindows.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ def mas(cm):
cm.ponMultiPV(20, 40)
mas(cm)

cm = ConfigMotor("komodo", "Don Dailey, Larry Kaufman", "5.1r2 32bit", "http://komodochess.com/")
cm.path = "komodo51r2-32bit.exe"
cm = ConfigMotor("komodo", "Don Dailey, Larry Kaufman", "7a 32bit", "http://komodochess.com/")
cm.path = "komodo-7-32bit.exe"
cm.ordenUCI("Ponder", "false")
cm.ordenUCI("Hash", "32")
cm.elo = 3053
Expand Down
7 changes: 3 additions & 4 deletions Code/Gestor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1542,17 +1542,16 @@ def salvaFEN_PGN(self, extension, siFichero):
_("File") + " %s (*.%s)" % (extension, extension), False)
if resp:
try:

modo = "w"
if Util.existeFichero(resp):
yn = QTUtil2.preguntaCancelar(self.pantalla,
_X(_("The file %1 already exists, what do you want to do?"),
resp), si=_("Append"), no=_("Overwrite"))
if yn is None:
return
if yn:
modo = "a"
dato = "\n" * 2 + dato
if yn:
modo = "a"
dato = "\n" * 2 + dato
f = codecs.open(resp, modo, 'utf-8', 'ignore')
f.write(dato.replace("\n", "\r\n"))
f.close()
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.07d"
VERSION = "9.08"

import sys

Expand Down
11 changes: 2 additions & 9 deletions Code/QT/PantallaDailyTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import Code.QT.Grid as Grid
import Code.QT.FormLayout as FormLayout
import Code.QT.Tablero as Tablero
import Code.QT.PantallaPotencia as PantallaPotencia

# liFens = []

Expand Down Expand Up @@ -197,15 +198,7 @@ def empezar(self):
self.fns = ""

if not liR:
li = Util.recuperaVar("./IntFiles/lista60.dkv")
liR = []
dif = int(40 / self.pruebas)
ini = 10
for x in range(self.pruebas):
t0 = random.randint(ini, ini + dif - 1)
ini += dif
t1 = random.randint(0, len(li[t0]) - 1)
liR.append(li[t0][t1] + " 0 1")
liR = PantallaPotencia.leeVariasLineasMFN(self.pruebas)

# liR = liFens
w = WDailyTest(self, liR, self.motor, self.segundos, self.fns)
Expand Down
4 changes: 3 additions & 1 deletion Code/QT/PantallaPGN.py
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,9 @@ def xdic(k):
x = x.replace(".?", "").replace("?", "")
return x.strip()

fen = dicValores.get("FEN", fen0)
fen = dicValores.get("FEN")
if not fen:
fen = fen0
event = xdic("EVENT")
site = xdic("SITE")
date = xdic("DATE")
Expand Down
23 changes: 18 additions & 5 deletions Code/QT/PantallaPotencia.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def lee1LineaMFN(linea):
p = Partida.Partida()
p.leerPV(pv)
event = dic["Event"]
site = dic["Event"]
site = dic["Site"]
if site and site != event:
event += "-%s" % site
date = dic["Date"].replace(".?", "").replace("?", "")
Expand All @@ -44,10 +44,23 @@ def lee1LineaMFN(linea):

def leeLineaMFN():
npos = random.randint(0, 2999)
f = open("./IntFiles/games.mfn", "rb")
for num, linea in enumerate(f):
if num == npos:
return lee1LineaMFN(linea)
with open("./IntFiles/games.mfn") as f:
for num, linea in enumerate(f):
if num == npos:
return lee1LineaMFN(linea)

def leeVariasLineasMFN(nlineas): # PantallaDailyTest
liPos = random.sample(range(0,2999),nlineas)
liFEN = []
with open("./IntFiles/games.mfn") as f:
for num, linea in enumerate(f):
if num in liPos:
cabs, pv, jugada = linea.strip().split("||")
p = Partida.Partida()
p.leerPV(pv)
fen = p.jugada(int(jugada)).posicion.fen()
liFEN.append(fen)
return liFEN

class PotenciaHistorico:
def __init__(self, fichero):
Expand Down
15 changes: 8 additions & 7 deletions Code/QT/WBG_Moves.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
import Code.QT.WBG_Training as WBG_Training

class WN_LB(Controles.ED):
def __init__(self, wNavigator, id):
def __init__(self, wNavigator, xid):
Controles.ED.__init__(self, wNavigator)
self.id = id
self.id = xid
self.wNavigator = wNavigator

# self.soloLectura(True)
Expand Down Expand Up @@ -69,9 +69,9 @@ def __init__(self, wmoves):
layout = Colocacion.H().control(self.bt).relleno().margen(3)
self.setLayout(layout)

def pulsadoBT(self, id, siInicio, posicion=None, si2=False):
def pulsadoBT(self, xid, siInicio, posicion=None, si2=False):
if siInicio: # se muestra el item y se guarda el item
if self.historia:
if self.historia and len(self.historia)>1:
txt = self.bt.texto()[:posicion]
numMove = txt.count(" ") + 1
self.siWorking = True
Expand All @@ -84,7 +84,7 @@ def pulsadoBT(self, id, siInicio, posicion=None, si2=False):
self.siWorking = False
self.wmoves.tree.setCurrentItem(self.tmpItem)
else: # vuelve a ver el item ultimo
if self.historia:
if self.historia and len(self.historia)>1:
item = self.historia[-1].item()
self.wmoves.tree.setCurrentItem(item)
self.wmoves.tree.scrollToItem(item)
Expand Down Expand Up @@ -120,7 +120,8 @@ def __init__(self, procesador, winBookGuide):
# ToolBar
liAccionesWork = (
( _("Close"), Iconos.MainMenu(), self.tw_terminar ), None,
( _("Bookmarks"), Iconos.Favoritos(), self.tw_bookmarks ),
( _("Bookmarks"), Iconos.Favoritos(), self.tw_bookmarks ), None,
( _("Start position"), Iconos.Inicio(), self.tw_inicio ),
)
self.tbWork = Controles.TBrutina(self, liAccionesWork, tamIcon=24)

Expand All @@ -141,7 +142,7 @@ def __init__(self, procesador, winBookGuide):

# Navigator
self.navigator = WNavigator(self)
self.btInicial = Controles.PB(self, "", self.tw_inicio).ponIcono(Iconos.MoverInicio()).anchoFijo(16)
self.btInicial = Controles.PB(self, "", self.tw_inicio).ponIcono(Iconos.Inicio(), tamIcon=24).anchoFijo(24)
lyN = Colocacion.H().control(self.btInicial).control(self.navigator).relleno().margen(3)

lyTB = Colocacion.H().control(self.tbWork).relleno().control(self.tbGen)
Expand Down
1 change: 1 addition & 0 deletions Code/Util.py
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,7 @@ def __init__(self, nomDB, tabla="Data", maxCache=2048):
self.cache = collections.OrderedDict()

self._conexion = sqlite3.connect(nomDB)
self._conexion.text_factory = lambda x: unicode(x, "utf-8", "ignore")
atexit.register(self.close)

cursor = self._conexion.cursor()
Expand Down
1 change: 0 additions & 1 deletion Code/XKibitzers.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ def __init__(self, gestor, kibitzer):

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


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

motor = kibitzer["MOTOR"]
Expand Down
Loading

0 comments on commit 10e94fb

Please sign in to comment.