示例#1
0
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()
示例#2
0
文件: Plots.py 项目: vingar/DIRAC
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()
示例#3
0
文件: Plots.py 项目: DIRACGrid/DIRAC
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()