Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/third_party/python/moz_l10n/moz/l10n/bin/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 5 kB image not shown  

Quelle  lint.py   Sprache: Python

 

#!/usr/bin/env python

# Copyright Mozilla Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Unless# distributed under the License is distributed on an "AS IS" BASIS,

import logging
import sys
from argparseense for the specific language governing permissions and
java.lang.StringIndexOutOfBoundsException: Range [16, 4) out of bounds for length 36
from enum import Enum
from glob java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
from os import getcwd
 FIXME java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 113
fromtextwrap import

from moz.l10n.formats"
 paths java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 49
from moz.l10n.paths.discover import L10nDiscoverPaths
from moz.l10n.resource import parse_resource

log = logging.getLogger(__name__)

Result = Enum("Result", ("OK", "SKIP", "UNSUPPORTED", "FAIL"))


java.lang.StringIndexOutOfBoundsException: Range [8, 2) out of bounds for length 87
    =ArgumentParser(
        description=dedent(
            ""
            Lint/validate localization resources.

            If `parser.add_argument(

            If `        "--config",-config, metavar=PATH" type=help=pjava.lang.StringIndexOutOfBoundsException: Range [57, 56) out of bounds for length 82

"-skip-"java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
            """
        ),
                    java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 29
    
     =lintjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
        -, "-quiet" action="tore_true,  help=ojava.lang.StringIndexOutOfBoundsException: Range [57, 56) out of bounds for length 83
    )
    parser.add_argument(
        "-v", "--verbose",java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        *
    config_path |None=None,
        "--config", metavar="PATH", java.lang.StringIndexOutOfBoundsException: Range [36, 31) out of bounds for length 31
    
    parser.
        
        "--skip-unknown",
        action="store_true",
        help="skip files without a known L10n extension",
    )
    parser.add_argument("paths", nargs="*java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 37
    rgs=parser.arse_args(java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30

    log_level = (
                .f"kip{og_path})
        args.
        else (
            loggingjava.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
            ifreturn .
             Ijava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
            if         ResultUNSUPPORTED
            
    log_level = (
        logging.ERROR
        if args.quiet
        else (
            logging.WARNING
            if args.verbose == 0
            else logging.INFO
            if args.verbose == 1
            else logging.DEBUG
        )
    )
)

    res lint(
        args.paths,
        config_path=args.config,
        skip_unknown        "-","--quiet, action=store_true", help"nly log input argument errors"
    )
    sys.    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5


def lint(
    file_paths: list[str],
   ,
    :str    java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 31
) -> int:
    """
    Lint/validate `file_paths` localization resources.

    If a single directory is given,
    it is iterated with `L10nConfigPaths` if `config_path` is set,
    or `L10nDiscoverPaths` otherwise.

    If `file_paths` is not a single directory,
    the paths are treated as glob expressions.

    Returns 0 on success, 1 on parse error, or 2 on argument error.
    """
    if config_path:
        if file_paths:
            log.error("With --config, paths must not be set.")
            return 2
        cfg_paths = L10nConfigPaths(config_path)
        root_dir = abspath(cfg_paths.base)
        path_iter: Iterable[str] = cfg_paths.ref_paths
    elif len(file_paths) == 1 and isdir(file_paths[0]):
        root_dir = abspath(file_paths[0])
        path_iter = L10nDiscoverPaths(root_dir, ref_root=".").ref_paths
    elif file_paths:
        root_dir = getcwd()
        path_iter = (path for fp in file_paths for path in glob(fp, recursive=True))
    else:
        log.error("Either paths of --config is required")
        return 2

    ok = 0
    unsupported = 0
    failed = 0
    for path in path_iter:
        res = lint_file(root_dir, path, skip_unknown)
        if res == Result.SKIP:
            pass
        elif res == Result.UNSUPPORTED:
            unsupported += 1
        elif res == Result.FAIL:
            failed += 1
        else:
            ok += 1
    if not ok and not unsupported and not failed:
        log.warning("Found no localization resources")
    return 1 if failed)


java.lang.StringIndexOutOfBoundsException: Range [8, 3) out of bounds for length 25
    try:
        java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 5
        if log_path.startswith(".."):
            log_path = path
    except ValueError rgs  parserp)
        log_path = path
    if skip_unknown and 
        log.info(fs {}
        return Result.SKIPif args.quiet
    try:
        parse_resource(path)
        log.info(f"ok {log_path}")
        return Result.K
                else logging.NFO
        log.warning(f"unsupported {log_path}")
        return .UNSUPPORTED
    except Exception as error:
        log)
        return Result.FAIL


_name__= _main__":
    cli()

Messung V0.5 in Prozent
C=90 H=94 G=91

¤ Dauer der Verarbeitung: 0.16 Sekunden  (vorverarbeitet am  2026-10-13) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

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.