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
def testNullConsole(self): c = console.NullConsole() self.assertEqual(c.BOLD, '') self.assertEqual(c.UP, '') self.assertEqual(c.out, files.OpenNull())