def test_command(self): help = HelpCommand() options = OptionsContext() for option in HelpCommand.common_options: options.add_option(option) context = CmdContext(["configure"], options, None, None) context.options_registry = self.options_registry help.run(context)
def write_record(self): dist = self.distribution install = InstallCommand() options_context = OptionsContext.from_command(install) context = CmdContext([], options_context, dist.pkg, dist.run_node) if self.record: n = context.build_node.make_node(IPKG_PATH) ipkg = InstalledPkgDescription.from_file(n.abspath()) scheme = context.get_paths_scheme() ipkg.update_paths(scheme) file_sections = ipkg.resolve_paths(src_root_dir=context.build_node.abspath()) fid = open(self.record, "w") try: for kind, source, target in iter_files(file_sections): fid.write("%s\n" % target) finally: fid.close()