New depends module to check dependencies. Moved version check to new depends module. #751

Merged
Atheros1 merged 2 commits from master into master 2014-12-26 02:01:51 +01:00
Showing only changes of commit 29e75ac7c6 - Show all commits

View File

@ -6,7 +6,7 @@ import sys
#them. The logging module was introduced in Python 2.3 #them. The logging module was introduced in Python 2.3
if not hasattr(sys, 'hexversion') or sys.hexversion < 0x20300F0: if not hasattr(sys, 'hexversion') or sys.hexversion < 0x20300F0:
sys.stdout.write('Python version: ' + sys.version) sys.stdout.write('Python version: ' + sys.version)
sys.stdout.write('PyBitmessage requires Python 2.7.5 or greater (but not Python 3)') sys.stdout.write('PyBitmessage requires Python 2.7.3 or greater (but not Python 3)')
sys.exit() sys.exit()
#We can now use logging so set up a simple configuration #We can now use logging so set up a simple configuration
@ -144,7 +144,7 @@ def check_openssl():
#TODO: The minimum versions of pythondialog and dialog need to be determined #TODO: The minimum versions of pythondialog and dialog need to be determined
def check_curses(): def check_curses():
if sys.hexversion < 0x20600F0: if sys.hexversion < 0x20600F0:
logger.error('The curses interface requires Python 2.6 or later, the pythondialog package and the dialog utility.') logger.error('The curses interface requires the pythondialog package and the dialog utility.')
return False return False
try: try:
import curses import curses
@ -195,7 +195,7 @@ def check_dependencies(verbose = False, optional = False):
logger.error('PyBitmessage requires Python 2.7.3 or greater (but not Python 3+)') logger.error('PyBitmessage requires Python 2.7.3 or greater (but not Python 3+)')
has_all_dependencies = False has_all_dependencies = False
if sys.hexversion >= 0x3000000: if sys.hexversion >= 0x3000000:
logger.error('PyBitmessage does not support Python 3+. Python 2.7.5 or greater is required.') logger.error('PyBitmessage does not support Python 3+. Python 2.7.3 or greater is required.')
has_all_dependencies = False has_all_dependencies = False
check_functions = [check_hashlib, check_sqlite, check_openssl] check_functions = [check_hashlib, check_sqlite, check_openssl]