Exemplo n.º 1
0
def main(args, bootstrap_args):
    from nion.swift import Facade
    from nion.swift import Application
    from nion.ui import Application as ApplicationUI
    warnings.simplefilter("always", RuntimeWarning)
    Facade.initialize()
    app = Application.Application(ApplicationUI.make_ui(bootstrap_args))
    app.initialize(use_root_dir=False)
    Facade.start_server()
    return app
Exemplo n.º 2
0
def main(args, bootstrap_args):
    sys.path.insert(0, os.path.join(os.path.dirname(__file__), "nionutils"))
    sys.path.insert(0, os.path.join(os.path.dirname(__file__), "nionui"))
    sys.path.insert(0, os.path.join(os.path.dirname(__file__), "niondata"))
    sys.path.insert(0, os.path.join(os.path.dirname(__file__), "nionswift"))
    sys.path.insert(
        0,
        os.path.join(os.path.dirname(__file__),
                     "nionswift-instrumentation-kit"))
    sys.path.insert(0, os.path.join(os.path.dirname(__file__), "nionswift-io"))
    sys.path.insert(0, os.path.join(os.path.dirname(__file__),
                                    "eels-analysis"))
    # these imports need to occur AFTER the args are parsed and the path
    # is updated accordingly.
    from nion.swift import Facade
    from nion.swift import Application
    from nion.ui import Application as ApplicationUI
    warnings.simplefilter("always", RuntimeWarning)
    Facade.initialize()
    app = Application.Application(ApplicationUI.make_ui(bootstrap_args))
    app.initialize()
    Facade.start_server()
    return app
Exemplo n.º 3
0
# standard libraries
import logging
import unittest
import unittest.mock

# third party libraries
import numpy

# local libraries
from nion.swift import Application
from nion.swift import Facade
from nion.swift.model import DataItem
from nion.swift.test import TestContext
from nion.ui import TestUI

Facade.initialize()


def create_memory_profile_context() -> TestContext.MemoryProfileContext:
    return TestContext.MemoryProfileContext()


def press_ok_and_complete(*args, **kwargs):
    kwargs["completion_fn"]()


def press_ok_cancel_and_ok_complete(*args, **kwargs):
    kwargs["completion_fn"](True)


def press_ok_cancel_and_cancel_complete(*args, **kwargs):