Skip to content

Commit

Permalink
Added support for mocked mode on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahsoka committed Jul 6, 2021
1 parent 4e5bdc8 commit 2321608
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions beskar/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from typing import Generator, Tuple, Union, Literal, List
from PyQt6.QtDataVisualization import QBarDataItem
from nidaqmx._lib import DaqNotFoundError
from nidaqmx.system import System
from .constants import offset

Expand Down Expand Up @@ -46,11 +47,12 @@ def interact_with_LEDs(device_name: str, interaction: Literal['on', 'off', 'on&o
task.write(True)

def get_number_of_devices(system=True):
errors = (FileNotFoundError, DaqNotFoundError)
try:
from __main__ import PyInstallerImportError
errors = (FileNotFoundError, PyInstallerImportError)
errors += PyInstallerImportError
except ImportError:
errors = FileNotFoundError
pass
the_system = System.local()
try:
num_of_devices = len(the_system.devices)
Expand Down

0 comments on commit 2321608

Please sign in to comment.