Update of /cvsroot/jtoolkit/jToolkit/widgets
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24617
Modified Files:
chart.py
Log Message:
improved error handling slightly (and added a TODO to do so more) - using jToolkit.errors
made failure to import matplotlib get handled more gracefully (and added a TODO...)
Index: chart.py
===================================================================
RCS file: /cvsroot/jtoolkit/jToolkit/widgets/chart.py,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** chart.py 10 Feb 2004 09:23:17 -0000 1.23
--- chart.py 8 Mar 2004 16:41:21 -0000 1.24
***************
*** 3,12 ****
# per object.
- from matplotlib.matlab import *
import cStringIO, tempfile, os, math
from jToolkit.widgets import widgets
from jToolkit.data import dates
import random, os
! import traceback
#We need this lock for gdchart, as it's not thread-safe
--- 3,20 ----
# per object.
import cStringIO, tempfile, os, math
from jToolkit.widgets import widgets
from jToolkit.data import dates
+ from jToolkit import errors
import random, os
!
! # TODO: improve error handling here...
! try:
! # TODO: change to from matplotlib import matlab...
! from matplotlib.matlab import *
! except:
! # not importing these functions will cause charts to fail...
! print "error importing matplotlib. jToolkit.widgets.chart functions will fail later."
! print errors.ConsoleErrorHandler().traceback_str()
#We need this lock for gdchart, as it's not thread-safe
***************
*** 78,84 ****
self.drawimage()
except:
! (etype, evalue, trace) = sys.exc_info()
! print "Unexpected Error:",etype,evalue
! traceback.print_tb(trace)
# gdchartLock.release()
return None
--- 86,91 ----
self.drawimage()
except:
! print "Unexpected Error:"
! print errors.ConsoleErrorHandler().traceback_str()
# gdchartLock.release()
return None
***************
*** 224,226 ****
self.im_height = 8 #This should take tagname length into account
!
\ No newline at end of file
--- 231,233 ----
self.im_height = 8 #This should take tagname length into account
!
|