Skip to content

Commit 440f307

Browse files
committed
fix os selection
1 parent a4b746c commit 440f307

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

arduino_logique.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
draw a breadboard, etc.
66
"""
77
import os
8+
import platform
89
from pathlib import Path
910
import tkinter as tk
1011
from breadboard import Breadboard
@@ -14,7 +15,7 @@
1415
from toolbar import Toolbar
1516
from utils import resource_path
1617

17-
if os.name == "darwin" or os.name == "posix":
18+
if (os.name in ("posix", "darwin")) and "linux" not in platform.platform().lower():
1819
from tkinter import font
1920
from tkmacosx import Button # type: ignore
2021
else:

menus.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
CLOCK,
3232
)
3333

34-
if os.name == "posix" or os.name=="darwin":
34+
if (os.name in ("posix", "darwin")) and "linux" not in platform.platform().lower():
3535
from tkinter import messagebox, filedialog, ttk
3636
from tkmacosx import Button # type: ignore
3737
else:

sidebar.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from pathlib import Path
99
import tkinter as tk
1010
import os
11+
import platform
1112
from typing import Callable, Tuple
1213
import subprocess
1314
import sys
@@ -17,11 +18,11 @@
1718
from dataCDLT import FREE, USED
1819
from object_model.circuit_object_model import Chip, get_all_available_chips, get_chip_modification_times
1920

20-
# if os.name == "posix" or os.name=="darwin":
21-
# from tkinter import messagebox, font
22-
# from tkmacosx import Button # type: ignore
23-
# else:
24-
from tkinter import Button, messagebox, font
21+
if (os.name in ("posix", "darwin")) and "linux" not in platform.platform().lower():
22+
from tkinter import messagebox, font
23+
from tkmacosx import Button # type: ignore
24+
else:
25+
from tkinter import Button, messagebox, font
2526

2627

2728
@dataclass

toolbar.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@
88
import os
99
from dataclasses import dataclass
1010
from pathlib import Path
11+
import platform
1112
import tkinter as tk
1213
from idlelib.tooltip import Hovertip # type: ignore
1314

1415
from component_sketch import ComponentSketcher
1516
from dataCDLT import INPUT, OUTPUT, FREE, CLOCK
1617
from utils import resource_path
1718

18-
if os.name == "posix" or os.name=="darwin":
19+
if (os.name in ("posix", "darwin")) and "linux" not in platform.platform().lower():
1920
from tkinter import messagebox, colorchooser
2021
from tkmacosx import Button # type: ignore
2122
else:

0 commit comments

Comments
 (0)