mirror of
https://github.com/onyx-and-iris/vban-cmd-python.git
synced 2024-11-15 17:10:46 +00:00
use _cmd() helper method to build cmd string
This commit is contained in:
parent
7416108489
commit
ebacdcf82a
@ -7,9 +7,8 @@ def cache_bool(func, param):
|
|||||||
|
|
||||||
def wrapper(*args, **kwargs):
|
def wrapper(*args, **kwargs):
|
||||||
self, *rem = args
|
self, *rem = args
|
||||||
cmd = f"{self.identifier}.{param}"
|
if self._cmd(param) in self._remote.cache:
|
||||||
if cmd in self._remote.cache:
|
return self._remote.cache.pop(self._cmd(param)) == 1
|
||||||
return self._remote.cache.pop(cmd) == 1
|
|
||||||
if self._remote.sync:
|
if self._remote.sync:
|
||||||
self._remote.clear_dirty()
|
self._remote.clear_dirty()
|
||||||
return func(*args, **kwargs)
|
return func(*args, **kwargs)
|
||||||
@ -22,9 +21,8 @@ def cache_string(func, param):
|
|||||||
|
|
||||||
def wrapper(*args, **kwargs):
|
def wrapper(*args, **kwargs):
|
||||||
self, *rem = args
|
self, *rem = args
|
||||||
cmd = f"{self.identifier}.{param}"
|
if self._cmd(param) in self._remote.cache:
|
||||||
if cmd in self._remote.cache:
|
return self._remote.cache.pop(self._cmd(param))
|
||||||
return self._remote.cache.pop(cmd)
|
|
||||||
if self._remote.sync:
|
if self._remote.sync:
|
||||||
self._remote.clear_dirty()
|
self._remote.clear_dirty()
|
||||||
return func(*args, **kwargs)
|
return func(*args, **kwargs)
|
||||||
|
Loading…
Reference in New Issue
Block a user