mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-09-30 01:07:24 +13:00
239e66e7cb
Manuskript now logs the versions of modules and libraries powering them for as far those are easily accessible. This includes all the optional modules, too. None of this is visible on the terminal of course - unless Manuskript is run with the --verbose flag. This clears up the last bit of unnecessary console spam, leaving our users blissfully unaware. Until we (and/or Qt) break something again, that is...
34 lines
846 B
Python
34 lines
846 B
Python
#!/usr/bin/env python
|
|
# --!-- coding: utf8 --!--
|
|
import PyQt5
|
|
import os
|
|
|
|
features = {'qtwebkit': False, 'qtwebengine': False}
|
|
|
|
if 'QT_WEB' in os.environ:
|
|
features[os.environ['QT_WEB']] = True
|
|
else:
|
|
try:
|
|
import PyQt5.QtWebKitWidgets
|
|
features['qtwebkit'] = True
|
|
except:
|
|
features['qtwebkit'] = False
|
|
|
|
try:
|
|
import PyQt5.QtWebEngineWidgets
|
|
features['qtwebengine'] = True
|
|
except:
|
|
features['qtwebengine'] = False
|
|
|
|
if features['qtwebkit']:
|
|
from PyQt5.QtWebKitWidgets import QWebView
|
|
webEngine = "QtWebKit"
|
|
webView = QWebView
|
|
elif features['qtwebengine']:
|
|
from PyQt5 import QtWebEngineWidgets
|
|
webEngine = "QtWebEngine"
|
|
webView = QtWebEngineWidgets.QWebEngineView
|
|
else:
|
|
from PyQt5.QtWidgets import QTextEdit
|
|
webEngine = "QTextEdit"
|
|
webView = QTextEdit
|