Add local Windows Server inventory collection and validation; include core package
This commit is contained in:
20
samsara/core/startup.py
Normal file
20
samsara/core/startup.py
Normal file
@@ -0,0 +1,20 @@
|
||||
"""Check common desktop prerequisites before Qt can abort the process."""
|
||||
import ctypes
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
||||
def desktop_error():
|
||||
if not sys.platform.startswith('linux'):
|
||||
return None
|
||||
backend = os.environ.get('QT_QPA_PLATFORM', '').split(':')[0]
|
||||
uses_xcb = backend == 'xcb' or (not backend and os.environ.get('DISPLAY') and not os.environ.get('WAYLAND_DISPLAY'))
|
||||
if uses_xcb:
|
||||
try:
|
||||
ctypes.CDLL('libxcb-cursor.so.0')
|
||||
except OSError:
|
||||
return ('Samsara needs the Qt X11 cursor library. On Debian-based desktops run:\n'
|
||||
' sudo apt install libxcb-cursor0\n'
|
||||
'Then retry: python -m samsara.main\n'
|
||||
'For other Linux distributions install the package providing libxcb-cursor.so.0.')
|
||||
return None
|
||||
Reference in New Issue
Block a user