def convierteTablero(id, tamDef, txt): ct = BaseConfig.ConfigTablero(id, tamDef) tema = ct._tema base = ct._base li = txt.split("#") nli = len(li) if nli >= 5: tema._colorExterior = int(li[0]) ct.anchoPieza(int(li[1])) tipoPieza = li[2] dic = {"c": "Chessicons", "m": "Merida", "i": "Internet", "s": "Spatial", "f": "Fantasy", "n": "NikNak", } base._nomPiezas = dic.get(tipoPieza, "NikNak") tema._colorBlancas = int(li[3]) tema._colorNegras = int(li[4]) tema._colorTexto = tema._colorBlancas tema._colorFrontera = tema._colorExterior if nli >= 6: txt = li[5] if txt.isdigit(): tema._fTransicion.color = int(txt) else: tema._fTransicion = Util.txt2dic(txt) if nli >= 7: # version 6.0 tema._colorTexto = int(li[6]) if nli >= 8: # version 6.1 tema._colorFrontera = int(li[7]) if nli >= 9: # version 6.2 ct.anchoPieza(32) return ct
def confTablero(self, xid, tamDef, padre="BASE"): if xid == "BASE": ct = BaseConfig.ConfigTablero(xid, tamDef) else: ct = BaseConfig.ConfigTablero(xid, tamDef, padre=padre) ct.anchoPieza(tamDef) if xid in self.dicConfTableros: ct.lee(self.dicConfTableros[xid]) else: db = Util.DicSQL(self.ficheroConfTableros) self.dicConfTableros[xid] = db[xid] = ct.graba() db.close() ct._anchoPiezaDef = tamDef return ct
def genEnginesIrina(self): cmbase = self.configuracion.buscaRival("irina") li = [] for name, trans, ico in QTVarios.list_irina(): cm = BaseConfig.ConfigMotor(name, cmbase.autor, cmbase.version, cmbase.url) cm.nombre = trans cm.icono = ico cm.carpeta = cmbase.carpeta cm.path = cmbase.path cm.ordenUCI("Personality", name) li.append(cm) return li
def __init__(self, user): self.ponCarpetas(user) self.user = user self.siMain = user == "" self.id = Util.creaID() self.jugador = "" self.dirSalvados = "" self.dirPGN = "" self.dirJS = "" self.traductor = "" self.estilo = "Cleanlooks" self.vistaTutor = kTutorH self.efectosVisuales = True self.rapidezMovPiezas = 100 self.guardarVariantesTutor = True self.siAtajosRaton = False # predictivo=True self.showCandidates = False self.siActivarCapturas = False self.siActivarInformacion = False self.tutorActivoPorDefecto = True self.version = "" self.elo = 0 self.eloNC = 1600 self.michelo = 1600 self.micheloNC = 1600 self.fics = 1200 self.ficsNC = 1200 self.fide = 1600 self.fideNC = 1600 self.lichess = 1600 self.lichessNC = 1600 self.siDGT = False self.opacityToolBoard = 10 self.positionToolBoard = "T" self.directorIcon = False self.coloresPGNdefecto() self.tablaSelBackground = None self.tamFontRotulos = 10 self.anchoPGN = 283 self.puntosPGN = 10 self.altoFilaPGN = 22 self.figurinesPGN = True self.autocoronacion = False self.showVariantes = False self.tipoMaterial = "D" self.familia = "" self.puntosMenu = 11 self.boldMenu = False self.puntosTB = 11 self.boldTB = False self.iconsTB = Qt.ToolButtonTextUnderIcon self.centipawns = False self.cursorThinking = True self.salvarGanados = False self.salvarPerdidos = False self.salvarAbandonados = False self.salvarFichero = "" self.salvarCSV = "" self.liTrasteros = [] self.liFavoritos = [] self.liPersonalidades = [] self.dicRivales = Engines.leeRivales() self.rivalInicial = "rocinante" if VarGen.isLinux else "tarrasch" self.rival = self.buscaRival(self.rivalInicial) self.tutorInicial = "mcbrain" self.tutor = self.buscaRival(self.tutorInicial) self.tutorMultiPV = 10 # 0: maximo self.tutorDifPts = 0 self.tutorDifPorc = 0 self.tiempoTutor = 3000 self.depthTutor = 0 self.siSuenaBeep = False self.siSuenaNuestro = False self.siSuenaJugada = False self.siSuenaResultados = False self.siNomPiezasEN = False self.siAplazada = False self.notbackground = False self.bmi2 = False self.checkforupdate = False self.siLogEngines = False self.palette = {} self.perfomance = Perfomance() self.grupos = BaseConfig.Grupos(self) self.grupos.nuevo("TarraschToy", 0, 1999, 0) self.grupos.nuevo("Bikjump", 2000, 2400, 600) self.grupos.nuevo("Greko", 2401, 2599, 1800) self.grupos.nuevo("Alaric", 2600, 2799, 3600) self.grupos.nuevo("Rybka", 2800, 3400, 6000)
def iconoTema(tema, tam): svg = """<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!-- Created with Inkscape (http://www.inkscape.org/) --> <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="388pt" height="388pt" viewBox="0 0 388 388" id="svg2"> <metadata id="metadata117"> <rdf:RDF> <cc:Work rdf:about=""> <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> <dc:title></dc:title> </cc:Work> </rdf:RDF> </metadata> <defs id="defs115" /> <g id="layer3" style="display:inline"> <rect width="486.81006" height="486.81006" x="0" y="-0.35689625" transform="scale(0.8,0.8)" id="rect4020" style="fill:FONDO;fill-opacity:1;fill-rule:nonzero;stroke:none" /> </g> <g id="layer1" style="display:inline"> <rect width="316.67606" height="317.12463" ry="0" x="35.708782" y="34.520344" id="rect3095" style="fill:BLANCAS;stroke:RECUADRO;stroke-width:4.54554987;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" /> </g> <g id="layer2" style="display:inline"> <rect width="38.841644" height="39.047188" x="154.92021" y="36.90279" id="rect3104" style="fill:NEGRAS;fill-opacity:1;stroke:NEGRAS;stroke-width:0.16;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" /> <use transform="translate(-78.883927,0)" id="use3887" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(-118.64494,118.02342)" id="use3889" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(-39.492576,196.10726)" id="use3891" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(-118.64494,274.01176)" id="use3893" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(78.161342,3.0019919e-8)" id="use3903" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(156.08573,78.779427)" id="use3905" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(-118.64494,196.10726)" id="use3907" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(38.395272,274.01176)" id="use3909" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(156.08573,3.0019984e-8)" id="use3919" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(0,78.779427)" id="use3921" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(-78.883927,156.79797)" id="use3923" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(-39.492576,274.01176)" id="use3925" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(-118.64494,39.217809)" id="use3935" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(78.161342,78.779427)" id="use3937" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(0,156.79797)" id="use3939" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(0,235.54546)" id="use3941" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(-39.492576,39.217809)" id="use3951" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(-39.492576,118.02342)" id="use3953" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(38.395272,196.10726)" id="use3955" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(78.161342,235.54546)" id="use3957" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(38.395272,39.217809)" id="use3967" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(38.395272,118.02342)" id="use3969" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(78.161342,156.79797)" id="use3971" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(156.08573,235.54546)" id="use3973" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(116.52539,39.217809)" id="use3983" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(116.52539,118.02342)" id="use3985" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(116.52539,196.10726)" id="use3987" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(116.52539,274.01176)" id="use3989" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(-78.883927,78.779427)" id="use3999" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(156.08573,156.79797)" id="use4001" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> <use transform="translate(-78.883927,235.54546)" id="use4003" x="0" y="0" width="388" height="388" xlink:href="#rect3104" /> </g> </svg> """ confTema = BaseConfig.ConfigTabTema() confTema.lee(tema["TEXTO"]) thumbail = confTema._png64Thumb if thumbail: pm = QtGui.QPixmap() png = base64.b64decode(thumbail) pm.loadFromData(png) icono = QtGui.QIcon(pm) return icono def ccolor(ncolor): x = QtGui.QColor(ncolor) return x.name() svg = svg.replace("BLANCAS", ccolor(confTema._colorBlancas)) svg = svg.replace("NEGRAS", ccolor(confTema._colorNegras)) svg = svg.replace("FONDO", ccolor(confTema._colorExterior)) svg = svg.replace("RECUADRO", ccolor(confTema._colorFrontera)) return svg2ico(svg, tam)