Skip to content

Commit

Permalink
Merge pull request NeuralEnsemble#1400 from h-mayorquin/add_plexon_te…
Browse files Browse the repository at this point in the history
…st_skip_condition

Skip plexon 2 tests when wine is not present
  • Loading branch information
zm711 authored Feb 13, 2024
2 parents c96ec93 + cf651e1 commit 0c175b4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
.idea
*.swp
*.swo
.vscode


# Compiled source #
###################
Expand Down
22 changes: 13 additions & 9 deletions neo/rawio/plexon2rawio/pypl2/pypl2lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 0c175b4

Please sign in to comment.