[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [PATCH] Add a method to cmdline.py:InstallInterface to handle missing attrs.



On 02/03/2010 05:05 PM, Chris Lumens wrote:
+    def __getattr__(self, attr):
+        # This method is called if "attr" does not exist in this class.  It's
+        # useful for catching calls to methods that other InstallInterface
+        # classes have but cmdline mode does not.
+        print(_("Can't have a question in command line mode!"))
+        print("(%s)" % attr)
+
+        # don't exit
+        while True:
+            time.sleep(5)
+
      def __del__(self):
          pass

Ack. The new __getattr__ method really ties the class together.

Ales


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]