本文整理汇总了Python中DIRAC.AccountingSystem.Client.ReportsClient.ReportsClient.plotView方法的典型用法代码示例。如果您正苦于以下问题:Python ReportsClient.plotView方法的具体用法?Python ReportsClient.plotView怎么用?Python ReportsClient.plotView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DIRAC.AccountingSystem.Client.ReportsClient.ReportsClient
的用法示例。
在下文中一共展示了ReportsClient.plotView方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: do_plotView
# 需要导入模块: from DIRAC.AccountingSystem.Client.ReportsClient import ReportsClient [as 别名]
# 或者: from DIRAC.AccountingSystem.Client.ReportsClient.ReportsClient import plotView [as 别名]
def do_plotView( self, args ):
"""
Gets a summary
Usage : getSummary <Summary name> <startdate YYYYMMDDHHMM> <enddate YYYYMMDDHHMM> <destLocation> (<field name> <field value>)*
"""
try:
argList = List.fromChar( args, " " )
if len( argList ) < 4:
gLogger.error( "Missing arguments!" )
return
startDT = self.__getDatetimeFromArg( argList[1] )
if not startDT:
gLogger.error( "Start time has invalid format" )
endDT = self.__getDatetimeFromArg( argList[2] )
if not endDT:
gLogger.error( "End time has invalid format" )
gLogger.info( "Start time is %s" % startDT )
gLogger.info( "End time is %s" % endDT )
sumArgs = {}
for iP in range( 4, len( argList ), 2 ):
key = argList[ iP ]
if key in sumArgs:
sumArgs[ key ].append( argList[ iP + 1 ] )
else:
sumArgs[ key ] = [ argList[ iP + 1 ] ]
repClient = ReportsClient()
retVal = repClient.plotView( argList[ 0 ], startDT, endDT, sumArgs )
if not retVal[ 'OK' ]:
gLogger.error( "Error: %s" % retVal[ 'Message' ] )
return
destDir = argList[3]
plotImg = retVal[ 'Value' ]
print "Downloading %s plot to %s.." % ( plotImg, destDir )
retVal = repClient.getPlotToDirectory( plotImg, destDir )
if not retVal[ 'OK' ]:
print " Error: %s" % retVal[ 'Message' ]
else:
print " done (%s/%s)!" % ( destDir, plotImg )
except:
self.showTraceback()