direct.showbase.PythonUtil

from direct.showbase.PythonUtil import AlphabetCounter, Averager, Default, DelayedCall, DelayedFunctor, FrameDelayedCall, Functor, GoldenRectangle, MiniLog, MiniLogSentry, PStatScope, PriorityCallbacks, Queue, ScratchPad, SerialMaskedGen, SerialNumGen, Singleton, Stack, StackTrace, StdoutCapture, StdoutPassthrough, SubframeCall, Sync, addListsByValue, adjust, appendStr, average, boolEqual, bound, callerInfo, clampScalar, closestDestAngle, closestDestAngle2, configIsToday, contains, convertTree, deeptype, difference, disjoint, doc, exceptionLogged, extractProfile, fastRepr, findPythonModule, fitDestAngle2Src, fitSrcAngle2Dest, flywheel, formatElapsedSeconds, formatTimeCompact, formatTimeExact, getAnnounceGenerateTime, getBase, getNumberedTypedSortedString, getNumberedTypedString, getProfileResultString, getRepository, getSetter, getSetterName, getShortestRotation, getTotalAnnounceTime, histogramDict, indent, intersection, invertDict, invertDictLossless, isDefaultValue, itype, lerp, lineInfo, lineTag, lineupPos, list2dict, listToIndex2item, listToItem2index, logBlock, loopGen, makeFlywheelGen, makeList, makeTuple, mostDerivedLast, normalDistrib, nullGen, pretty_print, printListEnum, printListEnumGen, printNumberedTyped, printNumberedTypes, printNumberedTypesGen, printProfile, printReverseStack, printStack, printThisCall, printVerboseStack, profileFunc, profiled, pstatcollect, quickProfile, r_convertTree, r_pretty_print, randFloat, randInt32, randUint31, reduceAngle, replace, report, safeRepr, safeReprTypeOnFail, safeTypeName, sameElements, serialNum, solveQuadratic, stackEntryInfo, startProfile, traceFunctionCall, traceParentCall, typeName, unescapeHtmlString, union, uniqueElements, uniqueName, weightedChoice, weightedRand

Contains miscellaneous utility functions and classes.

Inheritance diagram

digraph inheritanceb245ec4d30 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "AlphabetCounter" [URL="direct.showbase.PythonUtil.html#direct.showbase.PythonUtil.AlphabetCounter",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top"]; "Averager" [URL="direct.showbase.PythonUtil.html#direct.showbase.PythonUtil.Averager",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top"]; "Default" [URL="direct.showbase.PythonUtil.html#direct.showbase.PythonUtil.Default",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top"]; "DelayedCall" [URL="direct.showbase.PythonUtil.html#direct.showbase.PythonUtil.DelayedCall",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="calls a func after a specified delay"]; "DelayedFunctor" [URL="direct.showbase.PythonUtil.html#direct.showbase.PythonUtil.DelayedFunctor",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="Waits for this object to be called, then calls supplied functor after a delay."]; "FrameDelayedCall" [URL="direct.showbase.PythonUtil.html#direct.showbase.PythonUtil.FrameDelayedCall",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="calls a func after N frames"]; "Functor" [URL="direct.showbase.PythonUtil.html#direct.showbase.PythonUtil.Functor",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top"]; "Generic" [URL="https://docs.python.org/3/library/typing.html#typing.Generic",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="Abstract base class for generic types."]; "GoldenRectangle" [URL="direct.showbase.PythonUtil.html#direct.showbase.PythonUtil.GoldenRectangle",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top"]; "HierarchyException" [URL="direct.showbase.PythonUtil.html#direct.showbase.PythonUtil.HierarchyException",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top"]; "MiniLog" [URL="direct.showbase.PythonUtil.html#direct.showbase.PythonUtil.MiniLog",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top"]; "MiniLogSentry" [URL="direct.showbase.PythonUtil.html#direct.showbase.PythonUtil.MiniLogSentry",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top"]; "PStatScope" [URL="direct.showbase.PythonUtil.html#direct.showbase.PythonUtil.PStatScope",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top"]; "PriorityCallbacks" [URL="direct.showbase.PythonUtil.html#direct.showbase.PythonUtil.PriorityCallbacks",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="manage a set of prioritized callbacks, and allow them to be invoked in order of priority"]; "Queue" [URL="direct.showbase.PythonUtil.html#direct.showbase.PythonUtil.Queue",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top"]; "ScratchPad" [URL="direct.showbase.PythonUtil.html#direct.showbase.PythonUtil.ScratchPad",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="empty class to stick values onto"]; "SerialMaskedGen" [URL="direct.showbase.PythonUtil.html#direct.showbase.PythonUtil.SerialMaskedGen",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top"]; "SerialNumGen" -> "SerialMaskedGen" [arrowsize=0.75,style=""]; "SerialNumGen" [URL="direct.showbase.PythonUtil.html#direct.showbase.PythonUtil.SerialNumGen",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="generates serial numbers"]; "Singleton" [URL="direct.showbase.PythonUtil.html#direct.showbase.PythonUtil.Singleton",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top"]; "SingletonError" [URL="direct.showbase.PythonUtil.html#direct.showbase.PythonUtil.SingletonError",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="Used to indicate an inappropriate value for a Singleton."]; "Stack" [URL="direct.showbase.PythonUtil.html#direct.showbase.PythonUtil.Stack",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top"]; "Generic" -> "Stack" [arrowsize=0.75,style=""]; "StackTrace" [URL="direct.showbase.PythonUtil.html#direct.showbase.PythonUtil.StackTrace",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top"]; "StdoutCapture" [URL="direct.showbase.PythonUtil.html#direct.showbase.PythonUtil.StdoutCapture",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top"]; "StdoutPassthrough" [URL="direct.showbase.PythonUtil.html#direct.showbase.PythonUtil.StdoutPassthrough",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top"]; "StdoutCapture" -> "StdoutPassthrough" [arrowsize=0.75,style=""]; "SubframeCall" [URL="direct.showbase.PythonUtil.html#direct.showbase.PythonUtil.SubframeCall",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="Calls a callback at a specific time during the frame using the"]; "Sync" [URL="direct.showbase.PythonUtil.html#direct.showbase.PythonUtil.Sync",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top"]; }
class AlphabetCounter[source]

Bases: object

class Averager(name)[source]

Bases: object

class Default[source]

Bases: object

class DelayedCall(func, name=None, delay=None)[source]

Bases: object

calls a func after a specified delay

class DelayedFunctor(functor, name=None, delay=None)[source]

Bases: object

Waits for this object to be called, then calls supplied functor after a delay. Effectively inserts a time delay between the caller and the functor.

class FrameDelayedCall(name, callback, frames=None, cancelFunc=None)[source]

Bases: object

calls a func after N frames

class Functor(function, *args, **kargs)[source]

Bases: object

class GoldenRectangle[source]

Bases: object

exception HierarchyException(owner, description)[source]

Bases: Exception

JOSWILSO = 0
class MiniLog(name)[source]

Bases: object

class MiniLogSentry(log, funcName, *args, **kw)[source]

Bases: object

class PStatScope(level=None)[source]

Bases: object

collectors: dict = {}
class PriorityCallbacks[source]

Bases: object

manage a set of prioritized callbacks, and allow them to be invoked in order of priority

class Queue[source]

Bases: object

class ScratchPad(**kArgs)[source]

Bases: object

empty class to stick values onto

class SerialMaskedGen(mask, start=None)[source]

Bases: SerialNumGen

class SerialNumGen(start: int | None = None)[source]

Bases: object

generates serial numbers

class Singleton(name, bases, dic)[source]

Bases: type

exception SingletonError[source]

Bases: ValueError

Used to indicate an inappropriate value for a Singleton.

class Stack[source]

Bases: Generic[_T]

class StackTrace(label='', start=0, limit=None)[source]

Bases: object

class StdoutCapture[source]

Bases: object

class StdoutPassthrough[source]

Bases: StdoutCapture

class SubframeCall(functor, taskPriority, name=None)[source]

Bases: object

Calls a callback at a specific time during the frame using the task system

class Sync(name: str, other: Sync | None = None)[source]

Bases: object