Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Firefox/testing/raptor/raptor/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  support_class_utils.py   Sprache: Python

 
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

import importlib
import inspect
import pathlib

from base_python_support import BasePythonSupport


def import_support_class(path):
    """This function returns a BasePythonSupport subclass from the given path.

    :param str path: The path pointing to the custom support subclass.
    :return: A subclass of BasePythonSupport.
    """
    file = pathlib.Path(path)

    if not file.exists():
        raise Exception(f"The support_class path {path} does not exist.")

    # Importing a source file directly
    spec = importlib.util.spec_from_file_location(name=file.name, location=path)
    module = importlib.util.module_from_spec(spec)
    spec.loader.exec_module(module)

    members = inspect.getmembers(
        module,
        lambda c: inspect.isclass(c)
        and c != BasePythonSupport
        and issubclass(c, BasePythonSupport),
    )

    if not members:
        raise Exception(
            f"The path {path} was found but it was not a valid support_class."
        )

    return members[0][-1]

Messung V0.5
C=97 H=83 G=90

¤ Dauer der Verarbeitung: 0.16 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

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.