(_, request)
| 18 | |
| 19 | @staticmethod |
| 20 | def communicate_command(_, request): |
| 21 | # type: (any, dict) -> dict |
| 22 | rs = { |
| 23 | 'result': 'success', |
| 24 | 'result_code': '', |
| 25 | 'message': '' |
| 26 | } |
| 27 | action = KeeperApiHelper._expected_commands.pop(0) |
| 28 | |
| 29 | if callable(action): |
| 30 | props = action(request) |
| 31 | if type(props) == dict: |
| 32 | rs.update(props) |
| 33 | return rs |
| 34 | |
| 35 | if type(action) == str: |
| 36 | if action == request['command']: |
| 37 | return rs |
| 38 | |
| 39 | raise Exception() |