Public and private (INTERNAL) utility functions.
|
aspect_ratio(width,
*height,
**Error_kwds)
Compute the smallest, integer aspect ratio. |
|
|
|
clipstr(bytestr,
limit=50)
Clip a string to the given length limit. |
|
|
|
errorf(fmtxt,
*args,
**file_flush_nl_nt_argv0)
Like printf, but writing to file=sys.stderr. |
|
|
|
flint(f)
Return int for integer float . |
|
|
|
gcd(a,
b)
Calculate the Greatest Common Divisor of a and b. |
|
|
|
inst2strepr(inst,
strepr,
*attrs)
Convert an instance's attributes, maintaining the order. |
|
|
|
isinstanceOf(inst,
*classes,
**raiser_name)
Check a Python instance' class. |
|
|
|
|
|
logf(fmtxt,
*args,
**file_flush_nl_nt_argv0)
Like printf, but writing to file=NSMain.stdlog. |
|
|
|
machine()
Return the platform.machine string, distinguishing Intel
from emulating Intel on Apple Silicon (on macOS). |
|
|
|
macOSver()
Return the macOS release as str . |
|
|
|
macOSver2(n=2)
Return the macOS release as 1-, 2- or 3-tuple of int s. |
|
|
|
name2objc(name_)
Convert a (selector) name to bytes and ObjC naming
rules. |
|
|
|
name2py(name_)
Convert a (selector) name str and Python naming
conventions. |
|
|
|
name2pymethod(name_)
Convert a (selector) name to a valid Python callback method. |
|
|
|
printf(fmtxt,
*args,
**file_flush_nl_nt_argv0)
Formatted print fmt % args with optional keywords. |
|
|
|
|
|
terminating(app,
timeout=None)
Set up a separate thread to terminate an NSApplication app by
calling its .terminate_ method at the given
timeout in seconds. |
|
|
|
type2strepr(inst,
strepr=<type 'str'>,
**kwds)
Represent a Python Type instance as str or
repr . |
|
|
|
z1000str(size,
sep='_')
Convert a size to string with 1_000's seperator. |
|
|
|
zfstr(flt,
prec=3)
Format a float and strip trailing zero decimals. |
|
|
|
zSIstr(size,
B=' B ' ,
K=1024)
Convert a size to string with SI-units suffix. |
|
|