def generatePiePlot( fileName, data, metadata ): try: fn = file( fileName, "wb" ) except: return S_ERROR( "Can't open %s" % fileName ) checkMetadata( metadata ) pieGraph( data, fn, **metadata ) fn.close() return S_OK()
def generatePiePlot(fileName, data, metadata): """ It is used to create pie charts. :param str fileName the nanme of the file :param list data the data which is used to create the plot :param dict metadata extra information used to create the plot. """ try: with open(fileName, "wb") as fn: checkMetadata(metadata) pieGraph(data, fn, **metadata) except IOError as e: return S_ERROR(errno.EIO, e) return S_OK()
def generatePiePlot( fileName, data, metadata ): """ It is used to create pie charts. :param str fileName the nanme of the file :param list data the data which is used to create the plot :param dict metadata extra information used to create the plot. """ try: with open( fileName, "wb" ) as fn: checkMetadata( metadata ) pieGraph( data, fn, **metadata ) except IOError as e: return S_ERROR( errno.EIO, e ) return S_OK()