|
52 | 52 | import chess.engine |
53 | 53 | import chess.polyglot |
54 | 54 | import logging |
| 55 | +import platform as sys_plat |
55 | 56 |
|
56 | 57 |
|
57 | 58 | log_format = '%(asctime)s :: %(funcName)s :: line: %(lineno)d :: %(' \ |
|
61 | 62 |
|
62 | 63 |
|
63 | 64 | APP_NAME = 'Python Easy Chess GUI' |
64 | | -APP_VERSION = 'v1.13' |
| 65 | +APP_VERSION = 'v1.14' |
65 | 66 | BOX_TITLE = '{} {}'.format(APP_NAME, APP_VERSION) |
66 | 67 |
|
67 | 68 |
|
68 | 69 | platform = sys.platform |
| 70 | +sys_os = sys_plat.system() |
69 | 71 |
|
70 | 72 |
|
71 | 73 | ico_path = {'win32': {'pecg': 'Icon/pecg.ico', 'enemy': 'Icon/enemy.ico', |
@@ -442,7 +444,7 @@ def run(self): |
442 | 444 | folder = folder.parents[0] |
443 | 445 |
|
444 | 446 | try: |
445 | | - if platform == 'win32': |
| 447 | + if sys_os == 'Windows': |
446 | 448 | self.engine = chess.engine.SimpleEngine.popen_uci( |
447 | 449 | self.engine_path_and_file, cwd=folder, |
448 | 450 | creationflags=subprocess.CREATE_NO_WINDOW) |
@@ -850,7 +852,7 @@ def get_engine_id_name(self, path_and_file, q): |
850 | 852 | folder = folder.parents[0] |
851 | 853 |
|
852 | 854 | try: |
853 | | - if platform == 'win32': |
| 855 | + if sys_os == 'Windows': |
854 | 856 | engine = chess.engine.SimpleEngine.popen_uci( |
855 | 857 | path_and_file, cwd=folder, |
856 | 858 | creationflags=subprocess.CREATE_NO_WINDOW) |
@@ -1075,7 +1077,7 @@ def add_engine_to_config_file(self, engine_path_and_file, pname, que): |
1075 | 1077 | data = json.load(json_file) |
1076 | 1078 |
|
1077 | 1079 | try: |
1078 | | - if platform == 'win32': |
| 1080 | + if sys_os == 'Windows': |
1079 | 1081 | engine = chess.engine.SimpleEngine.popen_uci( |
1080 | 1082 | engine_path_and_file, cwd=folder, |
1081 | 1083 | creationflags=subprocess.CREATE_NO_WINDOW) |
@@ -1170,7 +1172,7 @@ def check_engine_config_file(self): |
1170 | 1172 | folder = epath.parents[0] |
1171 | 1173 |
|
1172 | 1174 | try: |
1173 | | - if platform == 'win32': |
| 1175 | + if sys_os == 'Windows': |
1174 | 1176 | engine = chess.engine.SimpleEngine.popen_uci( |
1175 | 1177 | engine_path_and_file, cwd=folder, |
1176 | 1178 | creationflags=subprocess.CREATE_NO_WINDOW) |
|
0 commit comments