Skip to content

Commit 697af09

Browse files
committed
Engine options bug fix, getting ready for release 0.2.0
1 parent 6a45e6a commit 697af09

File tree

4 files changed

+64
-54
lines changed

4 files changed

+64
-54
lines changed

README.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,20 @@ chmod +x cleartype-install-linux.bash
2828

2929
Keybindings:
3030

31-
| Key | Function |
32-
| ---------- | ---------------- |
33-
| ``<-`` | Move back |
34-
| ``->`` | Move forward |
35-
| ``f`` | Flip board |
36-
| ``s`` | Save database |
37-
| ``ctrl+n`` | Create game |
38-
| ``n`` | Next game |
39-
| ``b`` | Previous game |
40-
| ``e`` | Toggle engine |
41-
| ``o`` | Load a pgn |
42-
| ``x`` | Toggle explorer |
43-
| ``q`` | Quit application |
31+
| Key | Function |
32+
| ------------- | ---------------- |
33+
| ``<-`` | Move back |
34+
| ``->`` | Move forward |
35+
| ``ctrl + ->`` | Variation menu |
36+
| ``f`` | Flip board |
37+
| ``s`` | Save database |
38+
| ``ctrl + n`` | Create game |
39+
| ``n`` | Next game |
40+
| ``b`` | Previous game |
41+
| ``e`` | Toggle engine |
42+
| ``o`` | Load a pgn |
43+
| ``x`` | Toggle explorer |
44+
| ``q`` | Quit application |
4445

4546

4647
## Tests
@@ -54,7 +55,7 @@ make test
5455
- [x] Open source chess gui
5556
- [ ] Fully-featured
5657
- [x] Comments
57-
- [ ] Variations
58+
- [x] Variations
5859
- [ ] Annotations
5960
- [ ] Engine matches
6061
- [x] Engine options

gui.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import json
2+
import io
23
import os
34
import re
45
import sys
@@ -8,14 +9,19 @@
89
from pathlib import Path
910
from threading import Thread, Lock
1011

11-
import cpuinfo
12-
import pygame
13-
import pygame.gfxdraw
14-
import pygame_gui
12+
# Pygame sends a stdout message
13+
actual_stdout = sys.stdout
14+
with io.StringIO() as sys.stdout:
15+
import cpuinfo
16+
import pygame
17+
import pygame.gfxdraw
18+
import pygame_gui
19+
sys.stdout = actual_stdout
1520

1621
import lib
1722
from core import Database
1823

24+
1925
SQUARE_SIZE = 68
2026
pwd = Path.home() / ".waychess"
2127
img = pwd / "img"
@@ -540,6 +546,8 @@ def main():
540546

541547
if __name__ == "__main__":
542548
freeze_support()
549+
print("Welcome to WayChess. Please don't close this console!")
550+
543551
# Get pgn path
544552
try:
545553
if os.path.isfile(sys.argv[1]):

installer.spec

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
# -*- mode: python ; coding: utf-8 -*-
2-
3-
block_cipher = None
4-
5-
6-
a = Analysis(['installer.py'],
7-
pathex=['/mnt/c/Users/ronak/Documents/Workspace/WayChess'],
8-
binaries=[],
9-
datas=[],
10-
hiddenimports=[],
11-
hookspath=[],
12-
runtime_hooks=[],
13-
excludes=[],
14-
win_no_prefer_redirects=False,
15-
win_private_assemblies=False,
16-
cipher=block_cipher,
17-
noarchive=False)
18-
pyz = PYZ(a.pure, a.zipped_data,
19-
cipher=block_cipher)
20-
exe = EXE(pyz,
21-
a.scripts,
22-
a.binaries,
23-
a.zipfiles,
24-
a.datas,
25-
[],
26-
name='installer',
27-
debug=False,
28-
bootloader_ignore_signals=False,
29-
strip=False,
30-
upx=False,
31-
upx_exclude=[],
32-
runtime_tmpdir=None,
33-
console=True )
1+
# -*- mode: python ; coding: utf-8 -*-
2+
3+
block_cipher = None
4+
5+
6+
a = Analysis(['installer.py'],
7+
pathex=['C:\\Users\\ronak\\Documents\\Workspace\\WayChess'],
8+
binaries=[],
9+
datas=[],
10+
hiddenimports=[],
11+
hookspath=[],
12+
runtime_hooks=[],
13+
excludes=[],
14+
win_no_prefer_redirects=False,
15+
win_private_assemblies=False,
16+
cipher=block_cipher,
17+
noarchive=False)
18+
pyz = PYZ(a.pure, a.zipped_data,
19+
cipher=block_cipher)
20+
exe = EXE(pyz,
21+
a.scripts,
22+
a.binaries,
23+
a.zipfiles,
24+
a.datas,
25+
[],
26+
name='installer',
27+
debug=False,
28+
bootloader_ignore_signals=False,
29+
strip=False,
30+
upx=False,
31+
upx_exclude=[],
32+
runtime_tmpdir=None,
33+
console=True )

lib/enginelib.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,10 @@ class GUI:
144144
def clear_analysis(self):
145145
self.stdout("cleared")
146146

147-
@staticmethod
148-
def configure_engine_options():
149-
webbrowser.open(str(Path.home() / ".waychess" / "engineoptions.json"))
147+
def configure_engine_options(self):
148+
path = Path.home() / ".waychess" / "engineoptions.json"
149+
path.touch()
150+
self.stdout("[ENGINE CONFIGURE", webbrowser.open(str(path)))
150151

151152
def set_analysis(self):
152153
self.stdout("Set engine task")

0 commit comments

Comments
 (0)