mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-20 01:45:10 -04:00

Some checks are pending
CodeQL / Analyze (python) (push) Waiting to run
Build Debian package / build (push) Waiting to run
Build Docker image / buildx (push) Waiting to run
Build Homebrew package / build (push) Waiting to run
Build GitHub Pages website / build (push) Waiting to run
Build GitHub Pages website / deploy (push) Blocked by required conditions
Run linters / lint (push) Waiting to run
Build Pip package / build (push) Waiting to run
Run tests / python_tests (ubuntu-22.04, 3.11) (push) Waiting to run
Run tests / docker_tests (push) Waiting to run
93 lines
9.6 KiB
Python
Executable file
93 lines
9.6 KiB
Python
Executable file
#!/usr/bin/env python3
|
|
#
|
|
# █████╗ ██████╗ ██████╗██╗ ██╗██╗██╗ ██╗███████╗██████╗ ██████╗ ██╗ ██╗
|
|
# ██╔══██╗██╔══██╗██╔════╝██║ ██║██║██║ ██║██╔════╝██╔══██╗██╔═══██╗╚██╗██╔╝
|
|
# ███████║██████╔╝██║ ███████║██║██║ ██║█████╗ ██████╔╝██║ ██║ ╚███╔╝
|
|
# ██╔══██║██╔══██╗██║ ██╔══██║██║╚██╗ ██╔╝██╔══╝ ██╔══██╗██║ ██║ ██╔██╗
|
|
# ██║ ██║██║ ██║╚██████╗██║ ██║██║ ╚████╔╝ ███████╗██████╔╝╚██████╔╝██╔╝ ██╗
|
|
# ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═══╝ ╚══════╝╚═════╝ ╚═════╝ ╚═╝ ╚═╝
|
|
# Welcome to the ArchiveBox source code! Thanks for checking it out!
|
|
#
|
|
# "We are swimming upstream against a great torrent of disorganization.
|
|
# In this, our main obligation is to establish arbitrary enclaves of order and system.
|
|
# It is the greatest possible victory to be, to continue to be, and to have been.
|
|
# No defeat can deprive us of the success of having existed for some moment of time
|
|
# in a universe that seems indifferent to us."
|
|
# --Norber Weiner
|
|
|
|
__package__ = 'archivebox'
|
|
|
|
import os
|
|
import sys
|
|
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' # 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))
|
|
|
|
from .config.constants import CONSTANTS, VERSION # noqa
|
|
|
|
os.environ['ARCHIVEBOX_PACKAGE_DIR'] = str(PACKAGE_DIR)
|
|
os.environ['ARCHIVEBOX_DATA_DIR'] = str(DATA_DIR)
|
|
os.environ['DJANGO_SETTINGS_MODULE'] = 'core.settings'
|
|
|
|
# print('INSTALLING MONKEY PATCHES')
|
|
from .monkey_patches import * # noqa
|
|
# print('DONE INSTALLING MONKEY PATCHES')
|
|
|
|
# print('LOADING VENDORED LIBRARIES')
|
|
from .vendor import load_vendored_libs # noqa
|
|
load_vendored_libs()
|
|
# print('DONE LOADING VENDORED LIBRARIES')
|
|
|
|
__version__ = VERSION
|
|
__author__ = 'Nick Sweeting'
|
|
__license__ = 'MIT'
|
|
|
|
# ██████████████████████████████████████████████████████████████████████████████████████████████████
|
|
# ██████████████████████████████████████████████████████████████████████████████████████████████████
|
|
# ██████████████████████████████████████████████████████████████████████████████████████████████████
|
|
# ██████████████████████████████████████████████████████████████████████████████████████████████████
|
|
# ██████████████████████████████████████████████████████████████████████████████████████████████████
|
|
# ██████████████████████████████████████████████████████████████████████████████████████████████████
|
|
# ██████████████████████████████████████████████████████████████████████████████████████████████████
|
|
# ██ ██
|
|
# ██ ██
|
|
# ██ ██
|
|
# ██ ██
|
|
# ██ ██
|
|
# ██ ██
|
|
# ██ ██
|
|
# ██ ██
|
|
# ██ ██
|
|
# ██ ██
|
|
# ██ ██
|
|
# ██ ██
|
|
# ██ ████████████████████████████████████ ██
|
|
# ██ ██ █████████████████████████ █ ██
|
|
# ██ ██ █████████████████████████ █ ██
|
|
# ██ ██ █████████████████████████ █ ██
|
|
# ██ ██ █████████████████████████ █ ██
|
|
# ██ ██ █████████████████████████ █ ██
|
|
# ██ ██ █████████████████████████ █ ██
|
|
# ██ ██ █████████████████████████ █ ██
|
|
# ██ ██ █████████████████████████ █ ██
|
|
# ██ ██ █████████████████████████ █ ██
|
|
# ██ ████████████████████████████████████ ██
|
|
# ██ ██
|
|
# ██ ██
|
|
# ██ ██
|
|
# ██ ██
|
|
# ██ ██████████████████████████████████████████ ██
|
|
# ██ ██████████████████████████████████████████ ██
|
|
# ██ ██
|
|
# ██ ██
|
|
# ██ ██
|
|
# ██ ██
|
|
# ██ ██
|
|
# ████████████████████████████████████████████████████████████████████████████████
|