def sys_info(fname=None, overwrite=False):
 if ((fname is not None) and op.isfile(fname) and (not overwrite)):
  raise IOError('file exists, use overwrite=True to overwrite')
 out = ''
 try:
  from ..app import use_app, Canvas
  from ..app.backends import BACKEND_NAMES
  from ..gloo import gl
  from ..testing import has_backend
  with use_log_level('warning'):
   app = use_app(call_reuse=False)
  out += ('Platform: %s\n' % platform.platform())
  out += ('Python:   %s\n' % str(sys.version).replace('\n', ' '))
  out += ('Backend:  %s\n' % app.backend_name)
  for backend in BACKEND_NAMES:
   if backend.startswith('ipynb_'):
    continue
   with use_log_level('warning', print_msg=False):
    which = has_backend(backend, out=['which'])[1]
   out += '{0:<9} {1}\n'.format((backend + ':'), which)
  out += '\n'
  canvas = Canvas('Test', (10, 10), show=False, app=app)
  canvas._backend._vispy_set_current()
  out += ('GL version:  %r\n' % (gl.glGetParameter(gl.GL_VERSION),))
  x_ = gl.GL_MAX_TEXTURE_SIZE
  out += ('MAX_TEXTURE_SIZE: %r\n' % (gl.glGetParameter(x_),))
  out += ('Extensions: %r\n' % (gl.glGetParameter(gl.GL_EXTENSIONS),))
  canvas.close()
 except Exception:
  out += ('\nInfo-gathering error:\n%s' % traceback.format_exc())
  pass
 if (fname is not None):
  with open(fname, 'w') as fid:
   fid.write(out)
 return out

def sys_info ( fname = None , overwrite = False ) : if ( ( fname is not None ) and op . isfile ( fname ) and ( not overwrite ) ) : raise IOError ( 'file exists, use overwrite=True to overwrite' ) out = '' try : from . . app import use_app , Canvas from . . app . backends import BACKEND_NAMES from . . gloo import gl from . . testing import has_backend with use_log_level ( 'warning' ) : app = use_app ( call_reuse = False ) out += ( 'Platform: %s\n' % platform . platform ( ) ) out += ( 'Python:   %s\n' % str ( sys . version ) . replace ( '\n' , ' ' ) ) out += ( 'Backend:  %s\n' % app . backend_name ) for backend in BACKEND_NAMES : if backend . startswith ( 'ipynb_' ) : continue with use_log_level ( 'warning' , print_msg = False ) : which = has_backend ( backend , out = [ 'which' ] ) [ 1 ] out += '{0:<9} {1}\n' . format ( ( backend + ':' ) , which ) out += '\n' canvas = Canvas ( 'Test' , ( 10 , 10 ) , show = False , app = app ) canvas . _backend . _vispy_set_current ( ) out += ( 'GL version:  %r\n' % ( gl . glGetParameter ( gl . GL_VERSION ) , ) ) x_ = gl . GL_MAX_TEXTURE_SIZE out += ( 'MAX_TEXTURE_SIZE: %r\n' % ( gl . glGetParameter ( x_ ) , ) ) out += ( 'Extensions: %r\n' % ( gl . glGetParameter ( gl . GL_EXTENSIONS ) , ) ) canvas . close ( ) except Exception : out += ( '\nInfo-gathering error:\n%s' % traceback . format_exc ( ) ) pass if ( fname is not None ) : with open ( fname , 'w' ) as fid : fid . write ( out ) return out
return useful information about ipython and the system .