Ejemplo n.º 1
0
def spyder_launch(event):
    """ Launch spyder """
    # Options
    try:
        # pylint: disable=import-error
        from spyderlib import spyder
    except ImportError:
        g.es_print('Can not import spyderlib')
        return
    data = spyder.get_options()

    # Create the main window
    try:
        # Version 1.x
        # pylint: disable=too-many-function-args
        # pylint: disable=unbalanced-tuple-unpacking
        commands, intitle, message, options = data
        g.spyder = main = spyder.MainWindow(commands, intitle, message,
                                            options)
    except TypeError:
        # Version 2.x
        g.spyder = main = spyder.MainWindow(options=data)

    main.setup()
    g.spyderns = main.console.shell.interpreter.namespace
    spyder_update(event)
    main.show()
Ejemplo n.º 2
0
    def run(self, session):
        from spyderlib import spyder
        from spyderlib.config import CONF

        cs.exit_if_not_exists(session)
        app = spyder.initialize()

        # This should come from our command line parser, however, Spyder does
        # not provide a way to get the argument parser but only the parsed
        # arguments.
        opts = {
            'working_directory': cs.path(),
            'debug': False,
            'profile': False,
            'multithreaded': False,
            'light': False
        }

        # The python executable is set explicitly here, because Spyder tends
        # not to pick up the one used in a virtualenv. This should be set in a
        # profile in order to not mess with the user's settings.
        CONF.set('console', 'pythonexecutable', sys.executable)

        main = spyder.MainWindow(Bunch(opts))
        main.setup()
        main.show()
        main.open_file(cs.path(session))

        app.exec_()
Ejemplo n.º 3
0
def spyder_launch(event):
    """ Launch spyder """
    # Options
    from spyderlib import spyder
    data = spyder.get_options()

    # Create the main window
    try:
        # Version 1.x
        commands, intitle, message, options = data
        g.spyder = main = spyder.MainWindow(commands, intitle, message, options)
    except TypeError:
        # Version 2.x
        g.spyder = main = spyder.MainWindow(options=data)

    main.setup()
    g.spyderns = main.console.shell.interpreter.namespace
    spyder_update(event)
    main.show()