FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 02-03-2010, 03:05 PM
Chris Lumens
 
Default Add a method to cmdline.py:InstallInterface to handle missing attrs.

The presence of this method means that we no longer need to add methods to
the cmdline interface that just sleep, as missing methods will map to
__getattr__ and sleep there.
---
cmdline.py | 46 +++++++++++-----------------------------------
1 files changed, 11 insertions(+), 35 deletions(-)

diff --git a/cmdline.py b/cmdline.py
index 700e741..348fea7 100644
--- a/cmdline.py
+++ b/cmdline.py
@@ -67,6 +67,17 @@ class InstallInterface:
# signal.signal(signal.SIGINT, signal.SIG_IGN)
signal.signal(signal.SIGTSTP, signal.SIG_DFL)

+ 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

@@ -113,47 +124,12 @@ class InstallInterface:
self.messageWindow(title, text, type=type, default=default,
custom_buttons=custom_buttons, custom_icon=custom_icon)

- def passphraseEntryWindow(self, device):
- print(_("Can't have a question in command line mode!"))
- print("(passphraseEntryWindow: '%s')" % device)
- # don't exit
- while 1:
- time.sleep(5)
-
- def getLUKSPassphrase(self, passphrase = "", isglobal = False):
- print(_("Can't have a question in command line mode!"))
- print("(getLUKSPassphrase)")
- # don't exit
- while 1:
- time.sleep(5)
-
- def enableNetwork(self):
- print(_("Can't have a question in command line mode!"))
- print("(enableNetwork)")
- # don't exit
- while 1:
- time.sleep(5)
-
def resetInitializeDiskQuestion(self):
pass

- def questionInitializeDisk(self, path, description, size, details=""):
- print(_("Can't have a question in command line mode!"))
- print("(questionInitializeDisk)")
- # don't exit
- while 1:
- time.sleep(5)
-
def resetReinitInconsistentLVMQuestion(self):
pass

- def questionReinitInconsistentLVM(self, pv_names=None, lv_name=None, vg_name=None):
- print(_("Can't have a question in command line mode!"))
- print("(questionReinitInconsistentLVM)")
- # don't exit
- while 1:
- time.sleep(5)
-
def mainExceptionWindow(self, shortText, longTextFile):
print(shortText)

--
1.6.5.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 09:46 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org