Update of /cvsroot/freevo/freevo/src/plugins
In directory sc8-pr-cvs1:/tmp/cvs-serv12443

Modified Files:
        idlebar.py 
Log Message:
added patch for different temp units from Michael Ruelle

Index: idlebar.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/plugins/idlebar.py,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** idlebar.py  18 Jul 2003 03:47:34 -0000      1.23
--- idlebar.py  20 Jul 2003 18:22:35 -0000      1.24
***************
*** 22,25 ****
--- 22,28 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.24  2003/07/20 18:22:35  dischi
+ # added patch for different temp units from Michael Ruelle
+ #
  # Revision 1.23  2003/07/18 03:47:34  outlyer
  # Nasty bug that would cause a crash if you hit any remote button not used
***************
*** 267,272 ****
      show the current weather
      """
!     def __init__(self, zone='CYYZ'):
          IdleBarPlugin.__init__(self)
          self.METARCODE = zone
          self.WEATHERCACHE = config.FREEVO_CACHEDIR + '/weather'
--- 270,276 ----
      show the current weather
      """
!     def __init__(self, zone='CYYZ', units='C'):
          IdleBarPlugin.__init__(self)
+         self.TEMPUNITS = units
          self.METARCODE = zone
          self.WEATHERCACHE = config.FREEVO_CACHEDIR + '/weather'
***************
*** 288,292 ****
                  weather.fetchMetarReport(self.METARCODE)
                  if (weather.getTemperatureCelsius()):
!                     temperature = '%2d' % weather.getTemperatureCelsius()
                  else:
                      temperature = '0'  # Make it a string to match above.
--- 292,304 ----
                  weather.fetchMetarReport(self.METARCODE)
                  if (weather.getTemperatureCelsius()):
!                     if self.TEMPUNITS == 'F':
!                         ctemp = weather.getTemperatureCelsius()
!                         ftemp = ((ctemp + 40) * 9 / 5) - 40
!                         temperature = '%2d' % ftemp
!                     elif self.TEMPUNITS == 'K':
!                         ktemp = weather.getTemperatureCelsius() + 273
!                         temperature = '%3d' % ktemp
!                     else:
!                         temperature = '%2d' % weather.getTemperatureCelsius()
                  else:
                      temperature = '0'  # Make it a string to match above.




-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to