Ejemplo n.º 1
0
 def __init__(self, game, delta = (0,0), position = (0,0), size = (120,20), parent = None, style = None, enabled = True):
     '''
     GoBoardTest Constructor
     '''
     
     self.turn = ""
     
     if (game.next_move == BLACK_COLOR):
         self.turn ="Black "
     else:
         self.turn ="White"
     
     #TODO funcion que cree los star points en funcion al size     
     self.star_points = []
     self.game = game
     self._board_size = game.board.size
     self.create_surfaces()    
     self.delta = delta
     
     defaultStyle.init(gui)
     self.gui = gui
     self.game_over_style = self.gui.gameOverStyle.copy()
     self.turn_style = self.gui.turn_style.copy()
     self.windows = None
     Widget.__init__(self,position,size,parent,style,enabled)    
     Container.__init__(self)
     self.turn_label = None
     self.black_pieces = []
     self.white_pieces = []
Ejemplo n.º 2
0
import sys
from PyQt5.QtWidgets import QApplication
from gui import Widget
import logging

def setup_logging_system():
    logging.basicConfig(filename='client.log',
                        level=logging.DEBUG,
                        format='%(asctime)s %(message)s',
                        datefmt='%m/%d/%Y %I:%M:%S %p')

    root = logging.getLogger()
    root.setLevel(logging.DEBUG)

    ch = logging.StreamHandler(sys.stdout)
    ch.setLevel(logging.DEBUG)
    formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
    ch.setFormatter(formatter)
    root.addHandler(ch)

if __name__ == "__main__":
    setup_logging_system()
    app = QApplication(sys.argv)
    main_window = Widget(None)
    main_window.showMaximized()
    app.exec_()