Launching with __main__.py
This commit is contained in:
@@ -23,6 +23,7 @@ pdf support is coming, along with support for a bunch of other formats. Please s
|
|||||||
|
|
||||||
$ python setup.py build
|
$ python setup.py build
|
||||||
# python setup.py install
|
# python setup.py install
|
||||||
|
3. OR launch with `lector/__main__.py`
|
||||||
|
|
||||||
## Reporting issues
|
## Reporting issues
|
||||||
When reporting issues:
|
When reporting issues:
|
||||||
|
@@ -19,8 +19,16 @@
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import hashlib
|
import hashlib
|
||||||
|
import pathlib
|
||||||
from PyQt5 import QtWidgets, QtGui, QtCore
|
from PyQt5 import QtWidgets, QtGui, QtCore
|
||||||
|
|
||||||
|
# This allows for the program to be launched from the
|
||||||
|
# dir where it's been copied instead of needing to be
|
||||||
|
# installed
|
||||||
|
install_dir = os.path.realpath(__file__)
|
||||||
|
install_dir = pathlib.Path(install_dir).parents[1]
|
||||||
|
sys.path.append(str(install_dir))
|
||||||
|
|
||||||
from lector import database
|
from lector import database
|
||||||
from lector import sorter
|
from lector import sorter
|
||||||
from lector.toolbars import LibraryToolBar, BookToolBar
|
from lector.toolbars import LibraryToolBar, BookToolBar
|
||||||
|
Reference in New Issue
Block a user