Пример #1
0
def CreateTaskGraph(options):
    """Creates the instance of TaskGraph to use for this session."""
    if options.parallelism == 0:
        graph = taskgraph.SerialTaskGraph()
    else:
        graph = taskgraph.FiberTaskGraph(parallelism=options.parallelism,
                                         debug=options.debug)
    return graph
Пример #2
0
def LoadRequiredModules():
    # TODO(nya): Fix this hacky implementation.
    module_loader.LoadPackage('rime.basic')
    while True:
        commands = commands_mod.GetCommands()
        default_options = struct.Struct(commands[None].GetDefaultOptionDict())
        null_console = console_mod.NullConsole()
        graph = taskgraph.SerialTaskGraph()
        fake_ui = ui_mod.UiContext(default_options, null_console, commands,
                                   graph)
        try:
            LoadProject(os.getcwd(), fake_ui)
            break
        except targets.ConfigurationError:
            # Configuration errors should be processed later.
            break
        except targets.ReloadConfiguration:
            # Processed use_plugin(). Retry.
            pass