_Framework.Resource (runtime)¶
Live 11 — Live Object Model & framework reference (descriptions and signatures).
Module constants¶
DEFAULT_PRIORITY = 0
Functions¶
compose_resources(*resources)¶
first(seq)¶
index_if(predicate, seq)¶
nop(*a, **k)¶
reduce(...)¶
reduce(function, sequence[, initial]) -> value
Apply a function of two arguments cumulatively to the items of a sequence, from left to right, so as to reduce the sequence to a single value. For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates ((((1+2)+3)+4)+5). If initial is present, it is placed before the items of the sequence in the calculation, and serves as a default when the sequence is empty.
Classes¶
class ClientWrapper(NamedTuple)¶
Methods¶
__init__(self, *others, **k)¶
Initialize self. See help(type(self)) for accurate signature.
unwrap(*a, **k)¶
partial(func, args, *keywords) - new function with partial application of the given arguments and keywords.
wrap(*a, **k)¶
partial(func, args, *keywords) - new function with partial application of the given arguments and keywords.
Attributes¶
_eq_dict=<_Framework.Util.lazy_attribute object at 0x14df03c18>
class CompoundResource(Resource)¶
Properties¶
firstownersecond
Methods¶
__init__(self, first_resource=None, second_resource=None, *a, **k)¶
Initialize self. See help(type(self)) for accurate signature.
get_owner(self)¶
grab(self, client, *a, **k)¶
release(self, client)¶
class ExclusiveResource(Resource)¶
Properties¶
owner
Methods¶
__init__(self, on_received_callback=None, on_lost_callback=None, *a, **k)¶
Initialize self. See help(type(self)) for accurate signature.
get_owner(self)¶
grab(self, client, *a, **k)¶
on_lost(self, client)¶
on_received(self, client, *a, **k)¶
release(self, client)¶
class NamedTuple¶
Methods¶
__init__(self, *others, **k)¶
Initialize self. See help(type(self)) for accurate signature.
Attributes¶
_eq_dict=<_Framework.Util.lazy_attribute object at 0x14df03c18>
class PrioritizedResource(StackingResource)¶
Properties¶
clientsmax_priorityownerownersstack_size
Methods¶
__init__(self, on_received_callback=None, on_lost_callback=None, *a, **k)¶
Initialize self. See help(type(self)) for accurate signature.
_actual_owners(self)¶
_add_client(self, client, priority)¶
_on_lost_set(self, clients)¶
_on_received_set(self, clients)¶
_remove_client(self, client)¶
get_owner(self)¶
grab(self, client, priority=None)¶
on_lost(self, client)¶
on_received(self, client)¶
release(self, client)¶
release_all(self)¶
release_stacked(self)¶
class Proxy(ProxyBase)¶
Properties¶
proxied_interface
Methods¶
__init__(self, proxied_object=None, proxied_interface=None, *a, **k)¶
Initialize self. See help(type(self)) for accurate signature.
proxy_old_hasattr(self, attr)¶
Attributes¶
_proxied_interface=None_skip_wrapper_lookup=Noneproxied_object=None
class ProxyResource(Proxy)¶
Properties¶
ownerownersproxied_interface
Methods¶
__init__(self, proxied_resource=None, client_wrapper=<_Framework.Resource.ClientWrapper object at 0x162c99470>, *a, **k)¶
Initialize self. See help(type(self)) for accurate signature.
grab(self, client, *a, **k)¶
proxy_old_hasattr(self, attr)¶
release(self, client, *a, **k)¶
Attributes¶
_proxied_interface=None_skip_wrapper_lookup=Noneproxied_object=None
class Resource¶
Properties¶
owner
Methods¶
__init__(self, /, *args, **kwargs)¶
Initialize self. See help(type(self)) for accurate signature.
get_owner(self)¶
grab(self, client, *a, **k)¶
release(self, client)¶
class SharedResource(Resource)¶
Properties¶
owner
Methods¶
__init__(self, on_received_callback=None, on_lost_callback=None, *a, **k)¶
Initialize self. See help(type(self)) for accurate signature.
get_owner(self)¶
grab(self, client, *a, **k)¶
on_lost(self, client)¶
on_received(self, client, *a, **k)¶
release(self, client)¶
class StackingResource(Resource)¶
Properties¶
clientsmax_priorityownerownersstack_size
Methods¶
__init__(self, on_received_callback=None, on_lost_callback=None, *a, **k)¶
Initialize self. See help(type(self)) for accurate signature.
_actual_owners(self)¶
_add_client(self, client, priority)¶
_on_lost_set(self, clients)¶
_on_received_set(self, clients)¶
_remove_client(self, client)¶
get_owner(self)¶
grab(self, client, priority=None)¶
on_lost(self, client)¶
on_received(self, client)¶
release(self, client)¶
release_all(self)¶
release_stacked(self)¶
class partial¶
partial(func, args, *keywords) - new function with partial application of the given arguments and keywords.
Methods¶
__call__(self, /, *args, **kwargs)¶
Call self as a function.
__init__(self, /, *args, **kwargs)¶
Initialize self. See help(type(self)) for accurate signature.
Attributes¶
args=<member 'args' of 'functools.partial' objects>- tuple of arguments to future partial callsfunc=<member 'func' of 'functools.partial' objects>- function object to use in future partial callskeywords=<member 'keywords' of 'functools.partial' objects>- dictionary of keyword arguments to future partial calls