def main_window(qtbot): """Main Window fixture.""" CONF.reset_to_defaults() window = start.main() main_window.window = window qtbot.addWidget(window) yield window
def main_window(request): """Main Window fixture""" # Tests assume inline backend CONF.set('ipython_console', 'pylab/backend', 0) # Check if we need to use introspection in a given test # (it's faster and less memory consuming not to use it!) use_introspection = request.node.get_marker('use_introspection') if use_introspection: os.environ['SPY_TEST_USE_INTROSPECTION'] = 'True' else: try: os.environ.pop('SPY_TEST_USE_INTROSPECTION') except KeyError: pass # Only use single_instance mode for tests that require it single_instance = request.node.get_marker('single_instance') if single_instance: CONF.set('main', 'single_instance', True) else: CONF.set('main', 'single_instance', False) # Start the window window = start.main() # Teardown def close_window(): window.close() request.addfinalizer(close_window) return window
def main_window(request): """Main Window fixture""" # Tests assume inline backend CONF.set('ipython_console', 'pylab/backend', 0) # Check if we need to use introspection in a given test # (it's faster and less memory consuming not to use it!) use_introspection = request.node.get_marker('use_introspection') if use_introspection: os.environ['SPY_TEST_USE_INTROSPECTION'] = 'True' else: try: os.environ.pop('SPY_TEST_USE_INTROSPECTION') except KeyError: pass # Only use single_instance mode for tests that require it single_instance = request.node.get_marker('single_instance') if single_instance: CONF.set('main', 'single_instance', True) else: CONF.set('main', 'single_instance', False) # Start the window window = start.main() # Teardown def close_window(): window.close() request.addfinalizer(close_window) return window
sys.exit("ERROR: Your qtpy version is outdated. Please install qtpy " "1.1.0 or higher to be able to work with Spyder!") # --- Executing Spyder if args.show_console: print("(Deprecated) --show console does nothing, now the default behavior " "is to show the console, use --hide-console if you want to hide it") if args.hide_console and os.name == 'nt': print("*. Hiding parent console (Windows only)") sys.argv.append("--hide-console") # Windows only: show parent console # Reset temporary config directory if starting in --safe-mode if args.safe_mode or os.environ.get('SPYDER_SAFE_MODE'): from spyder.config.base import get_conf_path # analysis:ignore conf_dir = get_conf_path() if osp.isdir(conf_dir): shutil.rmtree(conf_dir) print("*. Running Spyder") from spyder.app import start # analysis:ignore time_lapse = time.time() - time_start print("Bootstrap completed in " + time.strftime("%H:%M:%S.", time.gmtime(time_lapse)) # gmtime() converts float into tuple, but loses milliseconds + ("%.4f" % time_lapse).split('.')[1]) start.main()
print("03. Imported Spyder %s" % versions['spyder']) print(" [Python %s %dbits, Qt %s, %s %s on %s]" % \ (versions['python'], versions['bitness'], versions['qt'], versions['qt_api'], versions['qt_api_ver'], versions['system'])) # Check that we have the right qtpy version from spyder.utils import programs if not programs.is_module_installed('qtpy', '>=1.1.0'): print("") sys.exit("ERROR: Your qtpy version is outdated. Please install qtpy " "1.1.0 or higher to be able to work with Spyder!") # --- Executing Spyder if not options.hide_console and os.name == 'nt': print("0x. Enforcing parent console (Windows only)") sys.argv.append("--show-console") # Windows only: show parent console print("04. Running Spyder") from spyder.app import start time_lapse = time.time()-time_start print("Bootstrap completed in " + time.strftime("%H:%M:%S.", time.gmtime(time_lapse)) + # gmtime() converts float into tuple, but loses milliseconds ("%.4f" % time_lapse).split('.')[1]) start.main()
#!/work/irlin355_1/gratienj/BigData/local/anaconda3/bin/python # -*- coding: utf-8 -*- import re import sys from spyder.app.start import main if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) sys.exit(main())