ArchiveBox/archivebox/__init__.py

34 lines
1.1 KiB
Python
Raw Normal View History

2019-04-17 03:18:42 +00:00
__package__ = 'archivebox'
2024-05-06 14:13:25 +00:00
import os
import sys
from pathlib import Path
2024-09-30 22:59:05 +00:00
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' # archivebox snapshot data dir
# 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))
2024-09-30 22:59:05 +00:00
from .config.constants import CONSTANTS, VERSION, PACKAGE_DIR, DATA_DIR, ARCHIVE_DIR # noqa
os.environ['OUTPUT_DIR'] = str(DATA_DIR)
os.environ['DJANGO_SETTINGS_MODULE'] = 'core.settings'
2024-09-30 22:59:05 +00:00
# print('INSTALLING MONKEY PATCHES')
from .monkey_patches import * # noqa
# print('DONE INSTALLING MONKEY PATCHES')
2024-09-30 22:59:05 +00:00
# print('LOADING VENDOR LIBRARIES')
from .vendor import load_vendored_libs # noqa
load_vendored_libs()
# print('DONE LOADING VENDOR LIBRARIES')
__version__ = VERSION
2024-09-30 22:59:05 +00:00
__author__ = 'Nick Sweeting'
__license__ = 'MIT'