-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e446c1c
commit 622c7ad
Showing
2 changed files
with
26 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,8 @@ | |
TODO: write docs on example usage/ what inputs etc. and what attributes that the data_store class needs | ||
''' | ||
# Author: Matt Clifford <[email protected]> | ||
import os | ||
import subprocess | ||
import platform | ||
import sys | ||
from typing import Any | ||
import warnings | ||
|
@@ -48,6 +49,7 @@ def __init__(self, | |
self.restrict_options = restrict_options | ||
self.num_steps_range = num_steps_range | ||
self.debug = debug | ||
check_pyqt_install_deps() | ||
self.show() | ||
|
||
def show(self): | ||
|
@@ -183,4 +185,23 @@ def __eq__(self, other): | |
return self.function == other.function | ||
else: | ||
# unwrapped tranform function | ||
return self.function == other | ||
return self.function == other | ||
|
||
|
||
def check_pyqt_install_deps(): | ||
''' PyQt6 on linux doesn't always ship with all the required libraries | ||
so here we will warn the user if they need to install them, avoiding a crash ''' | ||
system_info = platform.system() | ||
if not system_info == "Linux": | ||
return True | ||
|
||
# if on linux try see if package installed (only for debian based) | ||
package_name = "libxcb-cursor0" | ||
installed = False | ||
try: | ||
result = subprocess.run(["dpkg", "-l", package_name], check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True) | ||
installed = "ii" in result.stdout | ||
except subprocess.CalledProcessError: | ||
installed = False | ||
if installed == False: | ||
print(f"{'*'*30}\n\nWarning: not all dependencies are installed. If you get an 'Aborted (core dumped)' error below this message then please install them using:\n\n 'sudo apt install libxcb-cursor0'\n\n\n{'*'*30}\n\n") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters