def test_python_lib_pyqt4(self, verb=2): # actual lib test libname = 'PyQt4' rv = MT.simple_import_test(libname, verb=verb) # if failure, no biggie for now if rv: print('-- %s is no longer needed for an AFNI bootcamp' % libname) return 1 # it loads, but how about QtCore and QtGui if not MT.test_import(libname, verb=0): self.have_pyqt4 = 1 # but check for partial install cmd = 'from PyQt4 import QtCore, QtGui' try: exec(cmd) except: print('\n** have PyQt4, but cannot load QtCore, QtGui; error is:' \ '\n\n' \ ' **************************************************') os.system('python -c "%s"' % cmd) print(' **************************************************\n') self.comments.append('check for partial install of PyQt4') self.have_pyqt4 = 0 return 1 return 0
def test_python_lib(self, pylib, mesg='', verb=2): # actual lib test rv = MT.simple_import_test(pylib, verb=verb) if mesg : pmesg = mesg else: pmesg = 'not required, but is desirable' # if failure, no biggie, but warn if rv: print('-- %s is %s' % (pylib, pmesg)) return 1 if pylib.startswith('matplotlib'): self.have_matplotlib = 1 return 0