Module tf.convert.app.app

Expand source code Browse git
import types
from tf.advanced.app import App

# INSERT import

KNOWN_RENDS = "rèndValues"


def fmt_layout(app, n, **kwargs):
    return app._wrapHtml(n)


class TfApp(App):
    def __init__(app, *args, **kwargs):
        app.fmt_layout = types.MethodType(fmt_layout, app)
        super().__init__(*args, **kwargs)
        app.rendFeatures = tuple(
            (f, f[5:]) for f in app.api.Fall() if f.startswith("rend_")
        )
        app.isFeatures = tuple(f for f in app.api.Fall() if f.startswith("is_"))

    # INSERT init

    def _wrapHtml(app, n):
        rendFeatures = app.rendFeatures
        isFeatures = app.isFeatures
        api = app.api
        F = api.F
        Fs = api.Fs
        material = F.matérial
        rClses = " ".join(
            f"r_{r}" if r in KNOWN_RENDS else "r_"
            for (fr, r) in rendFeatures
            if Fs(fr).v(n)
        )
        iClses = " ".join(ic for ic in isFeatures if Fs(ic).v(n))
        if rClses or iClses:
            material = f'<span class="{rClses} {iClses}">{material}</span>'
        return material

    # INSERT extra

Functions

def fmt_layout(app, n, **kwargs)
Expand source code Browse git
def fmt_layout(app, n, **kwargs):
    return app._wrapHtml(n)

Classes

class TfApp (*args, **kwargs)

Set up the advanced TF API.

The parameters are explained in tf.about.usefunc.

Parameters

appName, appPath, checkout, version : string
 
commit, release, local : string
 
backend : string
 
checkout : string, optional ""
 
mod : string or iterable, optional []
 
version : string, optional None
 
versionOverride : boolean, optional False
 
locations, modules : string, optional None
 
collection, volume : string, optional None
 
api : object, optional, None``
 
setFile : string, optional, None``
 
silent : string, optional SILENT_D
See Timestamp
hoist : dict, optional False
 
configOverrides : list of tuple
 
_withGc : boolean, optional True
If False, it disables the Python garbage collector before loading features. Used to experiment with performance.
Expand source code Browse git
class TfApp(App):
    def __init__(app, *args, **kwargs):
        app.fmt_layout = types.MethodType(fmt_layout, app)
        super().__init__(*args, **kwargs)
        app.rendFeatures = tuple(
            (f, f[5:]) for f in app.api.Fall() if f.startswith("rend_")
        )
        app.isFeatures = tuple(f for f in app.api.Fall() if f.startswith("is_"))

    # INSERT init

    def _wrapHtml(app, n):
        rendFeatures = app.rendFeatures
        isFeatures = app.isFeatures
        api = app.api
        F = api.F
        Fs = api.Fs
        material = F.matérial
        rClses = " ".join(
            f"r_{r}" if r in KNOWN_RENDS else "r_"
            for (fr, r) in rendFeatures
            if Fs(fr).v(n)
        )
        iClses = " ".join(ic for ic in isFeatures if Fs(ic).v(n))
        if rClses or iClses:
            material = f'<span class="{rClses} {iClses}">{material}</span>'
        return material

    # INSERT extra

Ancestors

Inherited members