ahira-justice / chess-board

A chess board library for presenting game positions
https://pypi.org/project/chess-board
GNU General Public License v3.0
19 stars 12 forks source link

display.update() function is not working #2

Closed robotrobo closed 4 years ago

robotrobo commented 4 years ago

When calling the update function, the gameboard object is None, since the start function does not change the global gameboard object and creates a local copy of it instead, this can be easy fixed by adding the line global gameboard at the start of the start function in display.py

ahira-justice commented 4 years ago

Great looking out @robotrobo . Could you create a pr for this fix? Alternatively, I will get down to fixing it and putting out v0.2.1 soon. I've been real busy of recent.

robotrobo commented 4 years ago

Sure, i’ll do that, Its just that it’ll be my first time doing this😅. Also, do u plan to add mouse support to the library soon or know some library which does this?

ahira-justice commented 4 years ago

I'm not sure how mouse support would fit into chess-board currently, I wrote it to be a display module sitting on top of lower level chess inputs. chess-board currently takes input from PGN notation and and updates the display when provided a new PGN string. It's actually a fancy PGN parser at the moment.

Introducing mouse input would require rethinking the design. I'll add it to my to-do for a major release..

robotrobo commented 4 years ago

Created a PR. :)

ahira-justice commented 4 years ago

I'll review it soon and create a new PyPI package. I really need to set up CI/CD for this.

Travis-Barton commented 3 years ago

Adding global gameboard at the top of the file display.py did not fix this issue for me /: any updates? I just installed the package yesterday so I'm up to date.

RaspNewby commented 2 years ago

I still face the same issue:

Traceback (most recent call last): File "ChessApp.py", line 71, in display.update(validfen) File "C:\Users\slvni\ChessApp\lib\site-packages\chessboard\display.py", line 79, in update gameboard.displayBoard() AttributeError: 'NoneType' object has no attribute 'displayBoard'