From b37d9ae8ed60028ef018a54454fb111209f91c21 Mon Sep 17 00:00:00 2001 From: Giovani Date: Fri, 25 Jun 2021 19:13:39 +0000 Subject: [PATCH] refactor: add class decorator to class method --- dopey.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) mode change 100644 => 100755 dopey.py diff --git a/dopey.py b/dopey.py old mode 100644 new mode 100755 index 579a460..d07f36d --- a/dopey.py +++ b/dopey.py @@ -104,16 +104,17 @@ class Operation: if Memory.buffer[Memory.get_pointer()]: program[1] = last_open_loop_pos - def get_operations_in_switch() -> Dict: + @classmethod + def get_operations_in_switch(cls) -> Dict: return { - Operation.SHIFT_LEFT: Operation.shift_left, - Operation.SHIFT_RIGHT: Operation.shift_right, - Operation.INCREMENT: Operation.increment, - Operation.DECREMENT: Operation.decrement, - Operation.OUTPUT: Operation.output, - Operation.INPUT: Operation.input, - Operation.OPEN_LOOP: Operation.open_loop, - Operation.CLOSE_LOOP: Operation.close_loop + cls.SHIFT_LEFT: cls.shift_left, + cls.SHIFT_RIGHT: cls.shift_right, + cls.INCREMENT: cls.increment, + cls.DECREMENT: cls.decrement, + cls.OUTPUT: cls.output, + cls.INPUT: cls.input, + cls.OPEN_LOOP: cls.open_loop, + cls.CLOSE_LOOP: cls.close_loop } def main() -> None: