rename action_prop to action_fn

This commit is contained in:
onyx-and-iris 2023-06-23 03:39:07 +01:00
parent b10a90418e
commit 435a9e2085
3 changed files with 7 additions and 9 deletions

View File

@ -1,6 +1,5 @@
from .error import VMError
from .iremote import IRemote from .iremote import IRemote
from .meta import action_prop from .meta import action_fn
class Command(IRemote): class Command(IRemote):
@ -22,10 +21,9 @@ class Command(IRemote):
(cls,), (cls,),
{ {
**{ **{
param: action_prop(param) param: action_fn(param) for param in ["show", "shutdown", "restart"]
for param in ["show", "shutdown", "restart"]
}, },
"hide": action_prop("show", val=0), "hide": action_fn("show", val=0),
}, },
) )
return CMD_cls(remote) return CMD_cls(remote)

View File

@ -22,8 +22,8 @@ def float_prop(param):
return property(fget, fset) return property(fget, fset)
def action_prop(param, val: int = 1): def action_fn(param, val: int = 1):
"""A param that performs an action""" """meta function that performs an action"""
def fdo(self): def fdo(self):
self.setter(param, val) self.setter(param, val)

View File

@ -1,7 +1,7 @@
from .error import VMError from .error import VMError
from .iremote import IRemote from .iremote import IRemote
from .kinds import kinds_all from .kinds import kinds_all
from .meta import action_prop, bool_prop from .meta import action_fn, bool_prop
class Recorder(IRemote): class Recorder(IRemote):
@ -24,7 +24,7 @@ class Recorder(IRemote):
(cls, CHANNELOUTMIXIN_cls), (cls, CHANNELOUTMIXIN_cls),
{ {
**{ **{
param: action_prop(param) param: action_fn(param)
for param in [ for param in [
"play", "play",
"stop", "stop",