[yum-cvs] yum output.py,1.60,1.61
Seth Vidal
skvidal at login.linux.duke.edu
Mon Jun 13 02:09:46 UTC 2005
Update of /home/groups/yum/cvs/yum
In directory login:/tmp/cvs-serv13407
Modified Files:
output.py
Log Message:
cleanup userconfirm()
Index: output.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/output.py,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -r1.60 -r1.61
--- output.py 9 Jun 2005 21:44:57 -0000 1.60
+++ output.py 13 Jun 2005 02:09:44 -0000 1.61
@@ -110,15 +110,16 @@
def userconfirm(self):
"""gets a yes or no from the user, defaults to No"""
- while 1:
+ while True:
choice = raw_input('Is this ok [y/N]: ')
- if len(choice) == 0 or choice[0] in ['Y', 'y', 'N','n']:
+ choice = choice.lower()
+ if len(choice) == 0 or choice[0] in ['y', 'n']:
break
- if len(choice) == 0 or choice[0] not in ['y', 'Y']:
- return 0
+ if len(choice) == 0 or choice[0] != 'y':
+ return False
else:
- return 1
+ return True
def displayPkgsInGroups(self, group):
More information about the Yum-cvs-commits
mailing list