Update of /cvsroot/pythoncard/PythonCard/samples/conversions
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19204/conversions
Modified Files:
conversions.py
Log Message:
Removed all of the plain except: clauses I could
Index: conversions.py
===================================================================
RCS file: /cvsroot/pythoncard/PythonCard/samples/conversions/conversions.py,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** conversions.py 14 Nov 2005 22:33:13 -0000 1.16
--- conversions.py 13 Dec 2005 11:13:22 -0000 1.17
***************
*** 2,8 ****
"""
__version__ = "$Revision$"
__date__ = "$Date$"
- """
from PythonCard import model
--- 2,9 ----
"""
+ conversions provides conversion between english <-> morse code and celsius
+ """
__version__ = "$Revision$"
__date__ = "$Date$"
from PythonCard import model
***************
*** 80,84 ****
try:
converted += self.morseAlphabet[self.alphabet.index(ordC)] + ' '
! except:
return converted + "\n\ncharacter out of bounds, unable to complete conversion"
return converted[:-1]
--- 81,85 ----
try:
converted += self.morseAlphabet[self.alphabet.index(ordC)] + ' '
! except ValueError:
return converted + "\n\ncharacter out of bounds, unable to complete conversion"
return converted[:-1]
***************
*** 94,98 ****
try:
ordC = self.alphabet[self.morseAlphabet.index(c)]
! except:
return converted + "\n\nmorse out of bounds error, unable to complete conversion"
converted += ordC
--- 95,99 ----
try:
ordC = self.alphabet[self.morseAlphabet.index(c)]
! except ValueError:
return converted + "\n\nmorse out of bounds error, unable to complete conversion"
converted += ordC
***************
*** 107,115 ****
try:
dummy = float(txt)
! except:
return "Cannot convert anything but numbers"
try:
rate = server.getRate(fromCur, toCur)
! except:
return "Error getting exchange rate"
return str(float(txt) * rate)
--- 108,116 ----
try:
dummy = float(txt)
! except ValueError:
return "Cannot convert anything but numbers"
try:
rate = server.getRate(fromCur, toCur)
! except ValueError:
return "Error getting exchange rate"
return str(float(txt) * rate)
|