Commits

Cédric Bonhomme committed 43e6c96

Added comments.

Comments (0)

Files changed (1)

pyenigma/enigma.py

 from rotor import *
 
 class Enigma(object):
+    """
+    Represents an Enigma machine.
+    """
     def __init__(self, ref, r3, r2, r1, setting='AAA', plugs = [], ringset=1):
+        """
+        Initialization of the Enigma machine.
+        """
         self.reflector = ref
         self.rotor1 = r1
         self.rotor2 = r2
             self.transtab = maketrans(alpha,"".join(alpha_out))
 
     def encipher(self, plaintext_in):
+        """
+        Encrypt 'plaintext_in'.
+        """
         ciphertext = ''
         plaintext_in_upper = plaintext_in.upper()
         plaintext = plaintext_in_upper.translate(self.transtab)