/[ascend]/branches/adrian/pygtk/celsiusunits.py
ViewVC logotype

Diff of /branches/adrian/pygtk/celsiusunits.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3042 by adrian, Wed Jul 15 16:00:10 2015 UTC revision 3043 by adrian, Wed Aug 5 12:43:22 2015 UTC
# Line 19  class CelsiusUnits: Line 19  class CelsiusUnits:
19      def convert_celsius_to_kelvin(value, instype):      def convert_celsius_to_kelvin(value, instype):
20          if instype.startswith("delta"):          if instype.startswith("delta"):
21              return value              return value
22            try:
23                temp = float(value)
24            except ValueError:
25                return value
26    
         temp = float(value)  
27          return str(temp + 273.15)          return str(temp + 273.15)
28    
29      @staticmethod      @staticmethod
30      def convert_kelvin_to_celsius(value, instype):      def convert_kelvin_to_celsius(value, instype):
31          if instype.startswith("delta"):          if instype.startswith("delta"):
32              return value              return value
33            try:
34                temp = float(value)
35            except ValueError:
36                return value
37    
         temp = float(value)  
38          return str(temp - 273.15)          return str(temp - 273.15)
39  ##### CELSIUS TEMPERATURE WORKAROUND  ##### CELSIUS TEMPERATURE WORKAROUND

Legend:
Removed from v.3042  
changed lines
  Added in v.3043

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22