浏览代码

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
     SALITY_HELLO_REPLY = 104
 
 
     def is_request(mtype):
     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}
         return mtype in {MessageType.SALITY_HELLO, MessageType.SALITY_NL_REQUEST}
 
 
     def is_response(mtype):
     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}
         return mtype in {MessageType.SALITY_HELLO_REPLY, MessageType.SALITY_NL_REPLY}
 
 
 class Message():
 class Message():