Activity log for bug #293927

Date Who What changed Old value New value Message
2008-11-05 02:16:48 Luiz Fernando Barbosa Vital bug added bug
2008-11-05 02:16:48 Luiz Fernando Barbosa Vital bug added attachment 'patch_r3.diff' (Quick fix against rev 3 to be able to pass and use a surface instance)
2008-11-05 02:19:44 Luiz Fernando Barbosa Vital description I was trying to get data generated from Plot classes to a StringIO object instead of a file, so I passed a Cairo surface instance to the Plot class for later access to the surface methods wanted. {{{ data = [3,1,10,2] width, height = 300, 300 surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, width, height) CairoPlot.bar_plot(surface, data, width, height, border = 20, grid = True, rounded_corners = True) resp = StringIO() surface.write_to_png(resp) }}} That raised 2 errors: * one complaining about endswith called with None (the value of self.filename in the class) * and the other of calling write_to_png on a finished surface. I'm attaching a quick and dirty fix for this. Probably a better approach to solve this problem is to accept file-like objects as argument as well strings and surface instances. I was trying to get data generated from Plot classes to a StringIO object instead of a file, so I passed a Cairo surface instance to the Plot class for later access to the surface methods wanted. {{{ data = [3,1,10,2] width, height = 300, 300 surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, width, height) CairoPlot.bar_plot(surface, data, width, height, border = 20, grid = True, rounded_corners = True) resp = StringIO() surface.write_to_png(resp) }}} That raised 2 errors: * one complaining about endswith called with None (the value of self.filename in the class) * and the other of calling write_to_png on a finished surface. I'm attaching a quick and dirty fix for this. Probably a better approach to solve this problem is to accept file-like objects as argument in addition to strings and surface instances.
2009-03-11 11:58:03 Rodrigo Moreira Araújo cairoplot: assignee alf-rodrigo
2009-03-11 11:58:03 Rodrigo Moreira Araújo cairoplot: statusexplanation