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

Commit 1c9e37f

Browse files
committed
Version 10.11.9 (tico-tico issue #29)
1 parent 716f95c commit 1c9e37f

File tree

7 files changed

+31
-12
lines changed

7 files changed

+31
-12
lines changed

Code/Init.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
DEBUG = False
2-
VERSION = "10.11.8"
2+
VERSION = "10.11.9"
33

44
import os
55
import sys

Code/QT/PantallaTorneos.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,7 @@ def dispatch(valor):
707707
for y in range(x + 1, nSel):
708708
self.torneo.nuevoGame(liSel[x], liSel[y], minutos, segundos)
709709
self.torneo.nuevoGame(liSel[y], liSel[x], minutos, segundos)
710+
self.torneo.randomize()
710711

711712
self.gridGames.refresh()
712713
self.gridGames.gobottom()

Code/QT/WBG_InfoMove.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,11 +289,11 @@ def colocatePartida(self, pos):
289289
self.tablero.desactivaTodas()
290290

291291
def MoverInicio(self):
292-
self.colocatePartida(-1)
293292
if self.usoNormal:
294293
self.posHistoria = -1
295294
posicion = ControlPosicion.ControlPosicion().posInicial()
296295
else:
296+
# self.colocatePartida(-1)
297297
self.posJugada = -1
298298
posicion = self.partida.iniPosicion
299299
self.tablero.ponPosicion(posicion)

Code/QT/WBG_Summary.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -263,11 +263,12 @@ def siguiente(self):
263263
recno = self.grid.recno()
264264
if recno >= 0:
265265
dic = self.liMoves[recno]
266-
pv = dic["pv"]
267-
if pv.count(" ") > 0:
268-
pv = "%s %s" % (self.pvBase, dic["pvmove"]) # transposition case
269-
self.actualizaPV(pv)
270-
self.cambiaInfoMove()
266+
if "pv" in dic:
267+
pv = dic["pv"]
268+
if pv.count(" ") > 0:
269+
pv = "%s %s" % (self.pvBase, dic["pvmove"]) # transposition case
270+
self.actualizaPV(pv)
271+
self.cambiaInfoMove()
271272

272273
def ponPV(self, pvMirar):
273274
if not pvMirar:

Code/SQL/Base.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import atexit
22
import sqlite3
33

4+
from Code import Util
5+
46
import DBF
57
import DBFcache
68

@@ -13,8 +15,14 @@ class DBBase:
1315

1416
def __init__(self, nomFichero):
1517
self.nomFichero = unicode(nomFichero)
18+
existe = Util.existeFichero(nomFichero)
1619
self.conexion = sqlite3.connect(self.nomFichero)
1720
self.conexion.text_factory = lambda x: unicode(x, "utf-8", "ignore")
21+
if not existe:
22+
cursor = self.conexion.cursor()
23+
cursor.execute("PRAGMA page_size = 4096")
24+
cursor.execute("PRAGMA synchronous = NORMAL")
25+
cursor.close()
1826
atexit.register(self.cerrar)
1927

2028
def cerrar(self):
@@ -66,11 +74,9 @@ def dbfT(self, ctabla, select, condicion="", orden=""):
6674

6775
def generarTabla(self, tb):
6876
cursor = self.conexion.cursor()
69-
tb.crearBase(cursor)
70-
cursor.close()
71-
cursor = self.conexion.cursor()
77+
cursor.execute("PRAGMA page_size = 4096")
7278
cursor.execute("PRAGMA synchronous = NORMAL")
73-
cursor.execute("PRAGMA page_size = 8192")
79+
tb.crearBase(cursor)
7480
cursor.close()
7581

7682

Code/Torneo.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,17 @@ def numGames(self):
456456
def liGames(self):
457457
return self._liGames
458458

459+
def randomize(self, n=0):
460+
if n == 50:
461+
return
462+
random.shuffle(self._liGames)
463+
prev = self._liGames[0]
464+
for gm in self._liGames[1:]:
465+
if gm.hwhite() == prev.hwhite() and gm.hblack() == prev.hblack():
466+
return self.randomize(n+1)
467+
prev = gm
468+
return
469+
459470
def delGames(self, lista):
460471
li = []
461472
for x in range(len(self._liGames)):

bug.log

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Version 10.11.8
1+
Version 10.11.9

0 commit comments

Comments
 (0)