소스 검색

Add documentation for two methods

dustin.born 7 년 전
부모
커밋
75ec380c34
1개의 변경된 파일10개의 추가작업 그리고 0개의 파일을 삭제
  1. 10 0
      code/Attack/MembersMgmtCommAttack.py

+ 10 - 0
code/Attack/MembersMgmtCommAttack.py

@@ -25,9 +25,19 @@ class MessageType(Enum):
     SALITY_HELLO_REPLY = 104
 
     def is_request(mtype):
+        """
+        Checks whether the given message type is a request or not.
+        :param mtype: the message type to check
+        :return: True if it is a request, False otherwise
+        """
         return mtype in {MessageType.SALITY_HELLO, MessageType.SALITY_NL_REQUEST}
 
     def is_response(mtype):
+        """
+        Checks whether the given message type is a response or not.
+        :param mtype: the message type to check
+        :return: True if it is a response, False otherwise
+        """
         return mtype in {MessageType.SALITY_HELLO_REPLY, MessageType.SALITY_NL_REPLY}
 
 class Message():