mirror of
https://github.com/ArchiveBox/ArchiveBox
synced 2024-11-10 14:44:18 +00:00
add python version check
This commit is contained in:
parent
01687fbe89
commit
c768594b8b
1 changed files with 9 additions and 0 deletions
|
@ -1,4 +1,6 @@
|
|||
import os
|
||||
import sys
|
||||
|
||||
from subprocess import run, PIPE
|
||||
|
||||
# os.getenv('VARIABLE', 'DEFAULT') gets the value of environment
|
||||
|
@ -26,6 +28,13 @@ INDEX_ROW_TEMPLATE = os.getenv('INDEX_ROW_TEMPLATE', 'templates/index_ro
|
|||
|
||||
def check_dependencies():
|
||||
print('[*] Checking Dependencies:')
|
||||
|
||||
python_vers = float('{}.{}'.format(sys.version_info.major, sys.version_info.minor))
|
||||
if python_vers < 3.5:
|
||||
print('[X] Python version is not new enough: {} (>3.5 is required)'.format(python_vers))
|
||||
print(' See https://github.com/pirate/bookmark-archiver#troubleshooting for help upgrading your Python installation.')
|
||||
raise SystemExit(1)
|
||||
|
||||
if FETCH_PDF or FETCH_SCREENSHOT:
|
||||
if run(['which', CHROME_BINARY]).returncode:
|
||||
print('[X] Missing dependency: {}'.format(CHROME_BINARY))
|
||||
|
|
Loading…
Reference in a new issue