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"]; "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"]; "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"]; "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."]; "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=""]; "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 DelayedCall(func, name=None, delay=None)[source]¶
Bases:
objectcalls a func after a specified delay
- class DelayedFunctor(functor, name=None, delay=None)[source]¶
Bases:
objectWaits 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:
objectcalls a func after N frames
- class PriorityCallbacks[source]¶
Bases:
objectmanage a set of prioritized callbacks, and allow them to be invoked in order of priority
- class SerialMaskedGen(mask, start=None)[source]¶
Bases:
SerialNumGen
- exception SingletonError[source]¶
Bases:
ValueErrorUsed to indicate an inappropriate value for a Singleton.
- class StdoutPassthrough[source]¶
Bases:
StdoutCapture