Exemplo n.º 1
0
    def debug_shell_gtk(self, app):
        from IPython.lib.inputhook import enable_gtk3
        enable_gtk3()
        from IPython.frontend.terminal.ipapp import TerminalIPythonApp
        ip = TerminalIPythonApp.instance()
        ip.initialize(argv=[])
        ip.shell.enable_gui('gtk3')
        ip.shell.user_global_ns['app'] = app

        def ipy_import(module_name, identifier):
            module = importlib.import_module(module_name)
            ip.shell.user_global_ns[identifier] = getattr(module, identifier)

        #ipy_import('sage_notebook.model.git_interface', 'GitInterface')
        ip.start()
Exemplo n.º 2
0
def debug_shell(app):
    from IPython.lib.inputhook import enable_gtk3
    enable_gtk3()
    from IPython.frontend.terminal.ipapp import TerminalIPythonApp
    ip = TerminalIPythonApp.instance()
    ip.initialize(argv=[])
    ip.shell.enable_gui('gtk3')
    ip.shell.user_global_ns['app'] = app
    ip.shell.user_global_ns['repo'] = app.model.repo
    ip.shell.user_global_ns['git'] = app.model.repo.git
    def ipy_import(module_name, identifier):
        module = importlib.import_module(module_name)
        ip.shell.user_global_ns[identifier] = getattr(module, identifier) 
    ipy_import('sageui.model.git_interface', 'GitInterface')
    ipy_import('sageui.model.git_repository', 'GitRepository')
    ip.start()
Exemplo n.º 3
0
    def debug_shell_gtk(self, app):
        from IPython.lib.inputhook import enable_gtk3

        enable_gtk3()
        from IPython.frontend.terminal.ipapp import TerminalIPythonApp

        ip = TerminalIPythonApp.instance()
        ip.initialize(argv=[])
        ip.shell.enable_gui("gtk3")
        ip.shell.user_global_ns["app"] = app

        def ipy_import(module_name, identifier):
            module = importlib.import_module(module_name)
            ip.shell.user_global_ns[identifier] = getattr(module, identifier)

        # ipy_import('sage_notebook.model.git_interface', 'GitInterface')
        ip.start()
Exemplo n.º 4
0
def debug_shell(app):
    from IPython.lib.inputhook import enable_gtk3
    enable_gtk3()
    from IPython.frontend.terminal.ipapp import TerminalIPythonApp
    ip = TerminalIPythonApp.instance()
    ip.initialize(argv=[])
    ip.shell.enable_gui('gtk3')
    ip.shell.user_global_ns['app'] = app
    ip.shell.user_global_ns['repo'] = app.model.repo
    ip.shell.user_global_ns['git'] = app.model.repo.git

    def ipy_import(module_name, identifier):
        module = importlib.import_module(module_name)
        ip.shell.user_global_ns[identifier] = getattr(module, identifier)

    ipy_import('sageui.model.git_interface', 'GitInterface')
    ipy_import('sageui.model.git_repository', 'GitRepository')
    ip.start()
Exemplo n.º 5
0
In [2]: %run gui-gtk3.py
"""

from gi.repository import Gtk


def hello_world(wigdet, data=None):
    print("Hello World")

def delete_event(widget, event, data=None):
    return False

def destroy(widget, data=None):
    Gtk.main_quit()

window = Gtk.Window(Gtk.WindowType.TOPLEVEL)
window.connect("delete_event", delete_event)
window.connect("destroy", destroy)
button = Gtk.Button("Hello World")
button.connect("clicked", hello_world, None)

window.add(button)
button.show()
window.show()

try:
    from IPython.lib.inputhook import enable_gtk3
    enable_gtk3()
except ImportError:
    Gtk.main()
Exemplo n.º 6
0
from gi.repository import Gtk


def hello_world(wigdet, data=None):
    print("Hello World")


def delete_event(widget, event, data=None):
    return False


def destroy(widget, data=None):
    Gtk.main_quit()


window = Gtk.Window(Gtk.WindowType.TOPLEVEL)
window.connect("delete_event", delete_event)
window.connect("destroy", destroy)
button = Gtk.Button("Hello World")
button.connect("clicked", hello_world, None)

window.add(button)
button.show()
window.show()

try:
    from IPython.lib.inputhook import enable_gtk3
    enable_gtk3()
except ImportError:
    Gtk.main()