Cleaned up initialisation and config settings for spell checking
This commit is contained in:
+6
-17
@@ -5,7 +5,7 @@ import sys
|
||||
|
||||
if sys.hexversion < 0x030500F0:
|
||||
print("ERROR: At least Python 3.5 is required")
|
||||
exit(1)
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
import PyQt5.QtWidgets
|
||||
@@ -13,37 +13,26 @@ try:
|
||||
import PyQt5.QtCore
|
||||
except:
|
||||
print("ERROR: Failed to load dependency python3-pyqt5")
|
||||
exit(1)
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
import PyQt5.QtSvg
|
||||
except:
|
||||
print("ERROR: Failed to load dependency python3-pyqt5.qtsvg")
|
||||
exit(1)
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
import lxml
|
||||
except:
|
||||
print("ERROR: Failed to load dependency python3-lxml")
|
||||
exit(1)
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
import appdirs
|
||||
except:
|
||||
print("ERROR: Failed to load dependency python3-appdirs")
|
||||
exit(1)
|
||||
|
||||
spellPack = None
|
||||
try:
|
||||
import enchant
|
||||
spellPack = "enchant"
|
||||
except:
|
||||
print("WARNING: No spell check library found.")
|
||||
print("Please install python3-enchant if you want to use spell checking")
|
||||
sys.exit(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
import nw
|
||||
inArgs = sys.argv[1:]
|
||||
if spellPack is not None:
|
||||
inArgs.append("--spell=%s" % spellPack)
|
||||
nw.main(inArgs)
|
||||
nw.main(sys.argv[1:])
|
||||
|
||||
Reference in New Issue
Block a user