Skip to content

Commit

Permalink
Fix a bug in OS determination
Browse files Browse the repository at this point in the history
Fix issue #39
  • Loading branch information
fsmosca committed Apr 19, 2021
1 parent 8f8c2b8 commit cc4ec81
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions python_easy_chess_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
import chess.engine
import chess.polyglot
import logging
import platform as sys_plat


log_format = '%(asctime)s :: %(funcName)s :: line: %(lineno)d :: %(' \
Expand All @@ -61,11 +62,12 @@


APP_NAME = 'Python Easy Chess GUI'
APP_VERSION = 'v1.13'
APP_VERSION = 'v1.14'
BOX_TITLE = '{} {}'.format(APP_NAME, APP_VERSION)


platform = sys.platform
sys_os = sys_plat.system()


ico_path = {'win32': {'pecg': 'Icon/pecg.ico', 'enemy': 'Icon/enemy.ico',
Expand Down Expand Up @@ -442,7 +444,7 @@ def run(self):
folder = folder.parents[0]

try:
if platform == 'win32':
if sys_os == 'Windows':
self.engine = chess.engine.SimpleEngine.popen_uci(
self.engine_path_and_file, cwd=folder,
creationflags=subprocess.CREATE_NO_WINDOW)
Expand Down Expand Up @@ -850,7 +852,7 @@ def get_engine_id_name(self, path_and_file, q):
folder = folder.parents[0]

try:
if platform == 'win32':
if sys_os == 'Windows':
engine = chess.engine.SimpleEngine.popen_uci(
path_and_file, cwd=folder,
creationflags=subprocess.CREATE_NO_WINDOW)
Expand Down Expand Up @@ -1075,7 +1077,7 @@ def add_engine_to_config_file(self, engine_path_and_file, pname, que):
data = json.load(json_file)

try:
if platform == 'win32':
if sys_os == 'Windows':
engine = chess.engine.SimpleEngine.popen_uci(
engine_path_and_file, cwd=folder,
creationflags=subprocess.CREATE_NO_WINDOW)
Expand Down Expand Up @@ -1170,7 +1172,7 @@ def check_engine_config_file(self):
folder = epath.parents[0]

try:
if platform == 'win32':
if sys_os == 'Windows':
engine = chess.engine.SimpleEngine.popen_uci(
engine_path_and_file, cwd=folder,
creationflags=subprocess.CREATE_NO_WINDOW)
Expand Down

0 comments on commit cc4ec81

Please sign in to comment.