#NEWLINE# def check_dependencies( settings ) : #NEWLINE# #INDENT# from djblets.util.filesystem import is_exe_in_path #NEWLINE# from reviewboard.admin.import_utils import has_module #NEWLINE# dependency_error = settings . dependency_error #NEWLINE# if ( ( sys . version_info [ 0 ] < 2 ) or ( ( sys . version_info [ 0 ] == 2 ) and ( sys . version_info [ 1 ] < 6 ) ) ) : #NEWLINE# #INDENT# dependency_error ( 'Python 2.6 or newer is required.' ) #NEWLINE# #UNINDENT# if ( not has_module ( 'django_evolution' ) ) : #NEWLINE# #INDENT# dependency_error ( 'django_evolution is required.\nhttp://code.google.com/p/django-evolution/' ) #NEWLINE# #UNINDENT# if ( ( not has_module ( 'PIL' ) ) and ( not has_module ( 'Image' ) ) ) : #NEWLINE# #INDENT# dependency_error ( 'The Python Imaging Library (Pillow or PIL) is required.' ) #NEWLINE# #UNINDENT# def dependency_warning( string ) : #NEWLINE# #INDENT# sys . stderr . write ( ( 'Warning: %s\n' % string ) ) #NEWLINE# global warnings_found #NEWLINE# warnings_found += 1 #NEWLINE# #UNINDENT# if ( ( not has_module ( 'pysvn' ) ) and ( not has_module ( 'subvertpy' ) ) ) : #NEWLINE# #INDENT# dependency_warning ( 'Neither subvertpy nor pysvn found. SVN integration will not work.' ) #NEWLINE# #UNINDENT# if has_module ( 'P4' ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# subprocess . call ( [ 'p4' , '-h' ] , stdin = subprocess . PIPE , stdout = subprocess . PIPE ) #NEWLINE# #UNINDENT# except OSError : #NEWLINE# #INDENT# dependency_error ( 'p4 command not found. Perforce integration will not work.' ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# dependency_warning ( 'p4python (>=07.3) not found. Perforce integration will not work.' ) #NEWLINE# #UNINDENT# if ( not has_module ( 'mercurial' ) ) : #NEWLINE# #INDENT# dependency_warning ( 'hg not found. Mercurial integration will not work.' ) #NEWLINE# #UNINDENT# if ( not has_module ( 'bzrlib' ) ) : #NEWLINE# #INDENT# dependency_warning ( 'bzrlib not found. Bazaar integration will not work.' ) #NEWLINE# #UNINDENT# if ( not is_exe_in_path ( 'cvs' ) ) : #NEWLINE# #INDENT# dependency_warning ( 'cvs binary not found. CVS integration will not work.' ) #NEWLINE# #UNINDENT# if ( not is_exe_in_path ( 'git' ) ) : #NEWLINE# #INDENT# dependency_warning ( 'git binary not found. Git integration will not work.' ) #NEWLINE# #UNINDENT# if ( not is_exe_in_path ( 'mtn' ) ) : #NEWLINE# #INDENT# dependency_warning ( 'mtn binary not found. Monotone integration will not work.' ) #NEWLINE# #UNINDENT# if warnings_found : #NEWLINE# #INDENT# sys . stderr . write ( settings . install_help ) #NEWLINE# sys . stderr . write ( '\n\n' )