Commits

Cédric Bonhomme  committed 07c3fe6

Pretty display for generators.

  • Participants
  • Parent commits 0c1c0ad

Comments (0)

Files changed (1)

File pyenigma/rotor.py

     def __eq__(self,rotor):
         return self.name == rotor.name
 
+    def __str__(self):
+        """
+        Pretty display.
+        """
+        return """
+        Name: %s
+        Model: %s
+        Date: %s
+        Wiring: %s""" % (self.name, self.model, self.date, self.wiring)
+
 class Rotor(object):
     def __init__(self, wiring=None, notchs=None, name=None, model=None, date=None, state="A"):
         if wiring != None:
         return self.name == rotor.name
 
     def __str__(self):
+        """
+        Pretty display.
+        """
         return """
         Name: %s
         Model: %s