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

Commit

Permalink
Version 10.11.9 (tico-tico issue #29)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasmonk committed Mar 8, 2017
1 parent 716f95c commit 1c9e37f
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 12 deletions.
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 = "10.11.8"
VERSION = "10.11.9"

import os
import sys
Expand Down
1 change: 1 addition & 0 deletions Code/QT/PantallaTorneos.py
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,7 @@ def dispatch(valor):
for y in range(x + 1, nSel):
self.torneo.nuevoGame(liSel[x], liSel[y], minutos, segundos)
self.torneo.nuevoGame(liSel[y], liSel[x], minutos, segundos)
self.torneo.randomize()

self.gridGames.refresh()
self.gridGames.gobottom()
Expand Down
2 changes: 1 addition & 1 deletion Code/QT/WBG_InfoMove.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,11 @@ def colocatePartida(self, pos):
self.tablero.desactivaTodas()

def MoverInicio(self):
self.colocatePartida(-1)
if self.usoNormal:
self.posHistoria = -1
posicion = ControlPosicion.ControlPosicion().posInicial()
else:
# self.colocatePartida(-1)
self.posJugada = -1
posicion = self.partida.iniPosicion
self.tablero.ponPosicion(posicion)
Expand Down
11 changes: 6 additions & 5 deletions Code/QT/WBG_Summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,12 @@ def siguiente(self):
recno = self.grid.recno()
if recno >= 0:
dic = self.liMoves[recno]
pv = dic["pv"]
if pv.count(" ") > 0:
pv = "%s %s" % (self.pvBase, dic["pvmove"]) # transposition case
self.actualizaPV(pv)
self.cambiaInfoMove()
if "pv" in dic:
pv = dic["pv"]
if pv.count(" ") > 0:
pv = "%s %s" % (self.pvBase, dic["pvmove"]) # transposition case
self.actualizaPV(pv)
self.cambiaInfoMove()

def ponPV(self, pvMirar):
if not pvMirar:
Expand Down
14 changes: 10 additions & 4 deletions Code/SQL/Base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import atexit
import sqlite3

from Code import Util

import DBF
import DBFcache

Expand All @@ -13,8 +15,14 @@ class DBBase:

def __init__(self, nomFichero):
self.nomFichero = unicode(nomFichero)
existe = Util.existeFichero(nomFichero)
self.conexion = sqlite3.connect(self.nomFichero)
self.conexion.text_factory = lambda x: unicode(x, "utf-8", "ignore")
if not existe:
cursor = self.conexion.cursor()
cursor.execute("PRAGMA page_size = 4096")
cursor.execute("PRAGMA synchronous = NORMAL")
cursor.close()
atexit.register(self.cerrar)

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

def generarTabla(self, tb):
cursor = self.conexion.cursor()
tb.crearBase(cursor)
cursor.close()
cursor = self.conexion.cursor()
cursor.execute("PRAGMA page_size = 4096")
cursor.execute("PRAGMA synchronous = NORMAL")
cursor.execute("PRAGMA page_size = 8192")
tb.crearBase(cursor)
cursor.close()


Expand Down
11 changes: 11 additions & 0 deletions Code/Torneo.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,17 @@ def numGames(self):
def liGames(self):
return self._liGames

def randomize(self, n=0):
if n == 50:
return
random.shuffle(self._liGames)
prev = self._liGames[0]
for gm in self._liGames[1:]:
if gm.hwhite() == prev.hwhite() and gm.hblack() == prev.hblack():
return self.randomize(n+1)
prev = gm
return

def delGames(self, lista):
li = []
for x in range(len(self._liGames)):
Expand Down
2 changes: 1 addition & 1 deletion bug.log
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Version 10.11.8
Version 10.11.9

0 comments on commit 1c9e37f

Please sign in to comment.