Closed fmhall closed 1 year ago
The source in python is available. Both python source and exe worked in windows. I have not tried it yet with linux or mac. Please submit a PR if you can.
Task is in progress.
This small fix for OSX works to get engines directory filled with right content.
In get_engines add .DS_Store to the ignore list
def get_engines(self):
"""
Get engine filenames [a.exe, b.exe, ...]
:return: list of engine filenames
"""
engine_list = []
engine_path = Path('Engines')
files = os.listdir(engine_path)
for file in files:
if not file.endswith('.gz') and not file.endswith('.dll') \
and not file.endswith('.DS_Store') \
and not file.endswith('.bin') \
and not file.endswith('.dat'):
engine_list.append(file)
return engine_list
Thanks I will update it.
This small fix for OSX works to get engines directory filled with right content.
In get_engines add .DS_Store to the ignore list
This is now implemented in Python Easy Chess GUI v1.13.
Task is in progress.
- [x] Don't crash the program if there is no linux engine in Engines folder
- [x] Able to run linux engine and get its id name
- [ ] Fix window.Disable(), by PySimpleGUI library
This is the current fix to window.Disable(). Tested to work in windows and linux (WSL ubuntu 20.04). Might also work in osx. I don't have access to osx so I cannot test it.
Modify pysimplegui.py with the following change:
def disable(self):
"""
Disables window from taking any input from the user
"""
if not self._is_window_created():
return
self.TKroot.grab_release() # Only 'disables' an already 'enabled' window. Does nothing to a normal window
# self.TKroot.attributes('-disabled', 1)
# self.TKroot.grab_set_global()
def enable(self):
"""
Re-enables window to take user input after having it be Disabled previously
"""
if not self._is_window_created():
return
self.TKroot.grab_set # I read grab_set_global messes with all open windows so I wanted to avoid that
# self.TKroot.attributes('-disabled', 0)
# self.TKroot.grab_release()
This is not yet officially supported by pysimplegui.
Recently installed this on Ubuntu 20.04 and when I want to select engine it closes down. It happens the same for all the other menu options but for game and help. I have re downloaded it but still the same error. Any other fix available?
Could you post the log file?. Let us see what is in there.
These are the lines I see in the pecg_log.txt file. Is there other log or place where this will be registered: 2022-11-03 12:21:29,050 :: get_default_engine_opponent :: line: 2554 :: WARNING :: list index out of range 2022-11-03 12:21:29,050 :: set_default_adviser_engine :: line: 2543 :: WARNING : : list index out of range
There is no other log.
Looks like there is no engine. Check the Engines
folder, there should be a linux engine there.
Engines ls CDrill_1800_32bit.exe Deuterium_v2019.2.37.73_64bit_pop.exe Deuterium_v2019.1.36.50_32bit.exe Deuterium_v2020.1.38.5_linux_64bit ➜ Engines tree . ├── CDrill_1800_32bit.exe ├── Deuterium_v2019.1.36.50_32bit.exe ├── Deuterium_v2019.2.37.73_64bit_pop.exe └── Deuterium_v2020.1.38.5_linux_64bit
0 directories, 4 files
how can I hardcode the engine? If I try to select/install from the menu, it crashes ....
Did you use PySimpleGUI==4.49.0
?
Checking....
➜ Python-Easy-Chess-GUI-master pip list | grep PySimpleGUI PySimpleGUI 4.60.4
When I tried it last time, I only use 4.49.0
This is its requirements.txt
chess==1.6.1
pyperclip==1.8.2
PySimpleGUI==4.49.0
I confirm nothing works on Linux. I use Linux Mint 21 Cinnamon. python3
I need to install tkinter, else it spits an error: sudo apt-get install python3-tk
Even with the good dependecies, it has the same behavior: Play asks to install engine. Help shows the windows. Any other button crashes the window...
I tried both as root and user.
I will check this issue once I have a linux machine.
@Romain-Revel
Can you try this fix?
https://github.com/fsmosca/Python-Easy-Chess-GUI/issues/35#issuecomment-824499803
@Pichetraful
Can you try this fix?
https://github.com/fsmosca/Python-Easy-Chess-GUI/issues/35#issuecomment-824499803
Where exactly should I place the code(fix)? I see many classes with different def's..... Would it be ok to place it in : class EasyChessGui: .....?
Ignore it. I updated the code to use HIde()/UnHide() instead of Disable()/Enable() in 41a4ae236dc0c8ba0644b8eb7cde7ad55acf8977
Based from test, it works on windows and linux/ubuntu.
It works.
But you should add in the install section the need to chmod +x the linux UCI engine, else it can't import name nor add it.
@fsmosca, so... should I download the code again or what exactly do I need to do?
@fsmosca, so... should I download the code again or what exactly do I need to do?
Download the code again.
For example you can use the git clone command.
git clone https://github.com/fsmosca/Python-Easy-Chess-GUI.git
It works.
But you should add in the install section the need to chmod +x the linux UCI engine, else it can't import name nor add it.
Thanks.
I just tested on my ubuntu and it works.... Thanks!
Since .exes are used, this doesnt seem to work on UNIX based systems. What is involved in making that possible? I can submit a PR.