#!/usr/bin/env python3 import argparse import os from typing import Any, List, Optional, Text, TYPE_CHECKING
from . import manifest from . import vcs from .log import get_logger, enable_debug_logging from .download import download_from_github if TYPE_CHECKING: from .manifest import Manifest # avoid cyclic import
ifnot kwargs["rebuild"] and kwargs["download"]:
download_from_github(path, tests_root)
paths_to_update = [] for path_to_update in kwargs["tests"]: if path_to_update.startswith(tests_root):
paths_to_update.append(os.path.relpath(path_to_update, tests_root)) else:
logger.warning(f"{path_to_update} is not a WPT path")
def create_parser() -> argparse.ArgumentParser:
parser = argparse.ArgumentParser()
parser.add_argument( "-v", "--verbose", action="store_true",
help="Turn on verbose logging")
parser.add_argument( "-p", "--path", type=abs_path, help="Path to manifest file.")
parser.add_argument( "--tests-root", type=abs_path, default=wpt_root, help="Path to root of tests.")
parser.add_argument( "-r", "--rebuild", action="store_true",
help="Force a full rebuild of the manifest.")
parser.add_argument( "--url-base", default="/",
help="Base url to use as the mount point for tests in this manifest.")
parser.add_argument( "--no-download", dest="download", action="store_false",
help="Never attempt to download the manifest.")
parser.add_argument( "--cache-root", default=os.path.join(wpt_root, ".wptcache"),
help="Path in which to store any caches (default /.wptcache/)")
parser.add_argument( "--no-parallel", dest="parallel", action="store_false",
help="Do not parallelize building the manifest")
parser.add_argument('tests',
type=abs_path,
nargs='*',
help=('Test files or directories to update. ' 'Omit to update all items under the test root.')) return parser
def run(*args: Any, **kwargs: Any) -> None: if kwargs["path"] isNone:
kwargs["path"] = os.path.join(kwargs["tests_root"], "MANIFEST.json") if kwargs["verbose"]:
enable_debug_logging()
update_from_cli(**kwargs)
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.