diff --git a/.gitignore b/.gitignore index 5f70fb3d7..84710b91b 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,8 @@ .idea *.swp *.swo +.vscode + # Compiled source # ################### diff --git a/neo/rawio/plexon2rawio/pypl2/pypl2lib.py b/neo/rawio/plexon2rawio/pypl2/pypl2lib.py index 59ba26967..ae35aac7c 100644 --- a/neo/rawio/plexon2rawio/pypl2/pypl2lib.py +++ b/neo/rawio/plexon2rawio/pypl2/pypl2lib.py @@ -8,22 +8,26 @@ # You are free to modify or share this file, provided that the above # copyright notice is kept intact. -from sys import platform -import os +import platform +import subprocess import pathlib import warnings +import numpy as np -if any(platform.startswith(name) for name in ("linux", "darwin", "freebsd")): - from zugbruecke import CtypesSession +platform_is_windows = platform.system() == "Windows" - ctypes = CtypesSession(log_level=100) - -elif platform.startswith("win"): +if platform_is_windows: import ctypes else: - raise SystemError("unsupported platform") + is_wine_available = subprocess.run( + ["which", "wine"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=False + ) + if is_wine_available.returncode != 0: + raise ImportError("Wine is not installed. Please install wine to use the PL2FileReader.dll") -import numpy as np + from zugbruecke import CtypesSession + + ctypes = CtypesSession(log_level=100) class tm(ctypes.Structure):