mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-13 22:54:27 -04: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 os
|
||||||
|
import sys
|
||||||
|
|
||||||
from subprocess import run, PIPE
|
from subprocess import run, PIPE
|
||||||
|
|
||||||
# os.getenv('VARIABLE', 'DEFAULT') gets the value of environment
|
# 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():
|
def check_dependencies():
|
||||||
print('[*] Checking 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 FETCH_PDF or FETCH_SCREENSHOT:
|
||||||
if run(['which', CHROME_BINARY]).returncode:
|
if run(['which', CHROME_BINARY]).returncode:
|
||||||
print('[X] Missing dependency: {}'.format(CHROME_BINARY))
|
print('[X] Missing dependency: {}'.format(CHROME_BINARY))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue