Skip to content

Commit 6587b56

Browse files
Change methods not using its bound instance to staticmethods (#12)
1 parent cd9031a commit 6587b56

File tree

5 files changed

+10
-5
lines changed

5 files changed

+10
-5
lines changed

src/Action.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ class Action:
22
def __init__(self, expression :str):
33
self.expression = expression
44

5-
def to_string(self):
5+
@staticmethod
6+
def to_string():
67
result_s = ""
78
return result_s

src/Actions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ class Actions:
22
def __init__(self, actions = []):
33
self.actions = actions
44

5-
def to_string(self):
5+
@staticmethod
6+
def to_string():
67
result_s = ""
78
return result_s

src/Condition.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ def __init__(self, expression :str, result : str ):
33
self.expression = expression
44
self.result = result
55

6-
def to_string(self):
6+
@staticmethod
7+
def to_string():
78
result_s = ""
89
return result_s

src/Conditions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ class Conditions:
22
def __init__(self, conditions = [] ):
33
self.conditions = conditions
44

5-
def to_string(self):
5+
@staticmethod
6+
def to_string():
67
result_s = ""
78
return result_s

src/StateMachine.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ def __RestoreState(self):
7171
self.current_state = self.saved_state[0]
7272
self.context = self.saved_state[1]
7373

74-
def __PrepareExpression(self,expression):
74+
@staticmethod
75+
def __PrepareExpression(expression):
7576
module_expression=expression.rsplit('.',1)
7677
return module_expression[0],module_expression[1]
7778

0 commit comments

Comments
 (0)