mirror of
https://github.com/ChronosX88/medved.git
synced 2024-11-22 06:32:19 +00:00
23 lines
538 B
Python
23 lines
538 B
Python
class Action:
|
|
"""Base class for remote actions"""
|
|
#this part should be removed, I think
|
|
#dunno
|
|
def __init__(self, datapool):
|
|
self._datapool = datapool
|
|
self.result = None
|
|
|
|
def run(self, data):
|
|
pass
|
|
|
|
class data_get(Action):
|
|
def run(self, data):
|
|
return self._datapool.get(data["plugin"], data["count"])
|
|
|
|
class data_put(Action):
|
|
def run(self, data):
|
|
self._datapool.put(data['plugin'], data['items'])
|
|
|
|
class ActionManager:
|
|
@staticmethod
|
|
def get(name: str):
|
|
return globals()[name.replace('.', '_')] |