Prechádzať zdrojové kódy

Add documentation for two methods

dustin.born 7 rokov pred
rodič
commit
75ec380c34
1 zmenil súbory, kde vykonal 10 pridanie a 0 odobranie
  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():