mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-15 07:34:27 -04:00
improve archivebox.__init__ and load vendor libs at very beginning
This commit is contained in:
parent
446b38dc41
commit
80d3def206
1 changed files with 11 additions and 0 deletions
|
@ -7,12 +7,18 @@ from .monkey_patches import * # noqa
|
|||
|
||||
|
||||
import os
|
||||
import sys
|
||||
import importlib.metadata
|
||||
from pathlib import Path
|
||||
|
||||
PACKAGE_DIR = Path(__file__).resolve().parent # archivebox source code dir
|
||||
DATA_DIR = Path(os.curdir).resolve() # archivebox user data dir
|
||||
ARCHIVE_DIR = DATA_DIR / 'archive'
|
||||
|
||||
# make sure PACKAGE_DIR is in sys.path so we can import all subfolders
|
||||
# without necessarily waiting for django to load them thorugh INSTALLED_APPS
|
||||
if str(PACKAGE_DIR) not in sys.path:
|
||||
sys.path.append(str(PACKAGE_DIR))
|
||||
|
||||
def _detect_installed_version():
|
||||
try:
|
||||
|
@ -35,3 +41,8 @@ __version__ = VERSION
|
|||
|
||||
|
||||
from .constants import CONSTANTS
|
||||
|
||||
|
||||
# load fallback libraries from vendor dir
|
||||
from .vendor import load_vendored_libs
|
||||
load_vendored_libs()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue